bobeobibo / phigaro Goto Github PK
View Code? Open in Web Editor NEWPhigaro is a scalable command-line tool for predicting phages and prophages
License: MIT License
Phigaro is a scalable command-line tool for predicting phages and prophages
License: MIT License
Hi
This is a great tool, all steps work fine. However, I am not able to download the prophage sequences in fasta-format. The double-stranded DNA icon for BLAST works perfectly alright. But, the vertical arrow to download fasta sequences does not seem to work. In short, how can I extract fasta sequences of these prophage regions? Thanks.
Hi there!
Thank you to develop this helpful software! I've already successfully got the results using the Acinetobacter baumannii genome.
But in the html result file, I can only see the plot of the first prophage, and can not switch to the other predicted prophages list on the left.
my cammand was:
phigaro -f ../../02genome/njn001.fasta -o ./njn001/ -e tsv gff bed stdout html -t 12 -d -p --not-open
Could I get the plots of all prophages in the html file?
Thanks again,
Liu Xiong
Hello, currently, i want to identity the viral sequences with length > 1000, but phigaro seems to automatically exclude sequences with length < 20000. If i don't add the option "-d", it will prompt me whether to remove these sequences. So how to deal with the problem…… Looking forward to your reply.
(phigaro) ➜ ~ sudo phigaro-setup
sudo: phigaro-setup: command not found
Hello,
I'm a bit lost in phigaro
releases.
On github, the last tag is v2.2.6. However, on pypi, v2.3.0 is available.
The date of the pypi package matches the date of a batch of commits but there has been a few commits since then. So I feel that a tag is missing on github: aea9469 should be v2.3.0
.
Any thoughts ?
Downloading/unpacking phigaro
Downloading phigaro-0.2.1.8-2.tar.gz (70kB): 70kB downloaded
Running setup.py (path:/tmp/pip_build_root/phigaro/setup.py) egg_info for package phigaro
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/phigaro/setup.py", line 2, in
with open("Readme.md", "r") as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'Readme.md'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/phigaro/setup.py", line 2, in
with open("Readme.md", "r") as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'Readme.md'
Hi there!
Thank you to develop this kind of software! I've already successfully got the results using the Bacillus genome that you provide here, but now I am trying to use it with a multifasta of ~600 bacterial genomes, and I am having the following error. I guess that it could be solved without asking for .html file, couldn't it? Moreover, the program made a folder called "proc", could I get the results from there?
Thanks again,
Laura
phigaro -f NatBiotech2019.639genomes.fasta -o NatBiotech2019.phigaro.out -p --not-open -e html tsv gff bed stdout -t 12 -d
aTraceback (most recent call last):
File "/home/user/software/envs/phigaro_env/bin/phigaro", line 8, in
sys.exit(main())
File "/home/user/software/envs/phigaro_env/lib/python3.7/site-packages/phigaro/cli/batch.py", line 210, in main
task_output_file = run_tasks_chain(tasks)
File "/home/user/software/envs/phigaro_env/lib/python3.7/site-packages/phigaro/batch/runner.py", line 20, in run_tasks_chain
task.run()
File "/home/user/software/envs/phigaro_env/lib/python3.7/site-packages/phigaro/batch/task/run_phigaro.py", line 283, in run
plot_html(hmmer_records, begin, end)
File "/home/user/software/envs/phigaro_env/lib/python3.7/site-packages/phigaro/to_html/preprocess.py", line 190, in plot_html
widths = 1.0 * (np.array(widths) - min(widths)) / max(widths) + 0.1
ValueError: min() arg is an empty sequence
Hello,
our policy is to install tagged release versions
can you provide a tagged on please.
regards
Eric
People might find it easier to install phigaro via conda, we could document how to do this. Here is a lightweight way:
conda env create -f environment.yml
conda activate phigaro_env
Where environment.yml
contains:
name: phigaro_env
dependencies:
- python=3.7
- pip
- prodigal
- hmmer
- pip:
- phigaro
Then run phigaro-setup
Error running version phigaro 2.2.4-1:
$ phigaro -c config.yml -f test.fna -o out/${SLURM_ARRAY_TASK_ID} --not-open -e tsv -d
Traceback (most recent call last):
File "/global/home/users/snayfach/.conda/envs/phigaro_env/bin/phigaro", line 8, in <module>
sys.exit(main())
File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/cli/batch.py", line 210, in main
task_output_file = run_tasks_chain(tasks)
File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/batch/runner.py", line 20, in run_tasks_chain
task.run()
File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/batch/task/run_phigaro.py", line 69, in run
mean_gc = self.config['phigaro']['mean_gc']
KeyError: 'mean_gc'
I couldn't find this information in the publication.
Thanks,
Stephen
Hi, when I tried to run multiple Phigaro processes in parallel, I found that they only generated one intermediate directory 'proc'. This means that the output of the results will overlap and cause errors. Can you modify the program so that the intermediate directory is located in each outdir?
Hello,
while testing phigaro-2.2.1 I encounter the following problem
[gensoft@e211aa82115c 0.2.1.8-3]$ phigaro -f ../../datas/phigaro/Bacillus_anthracis_str_ames.fna -o out.phg -p --not-open
Traceback (most recent call last):
File "/local/gensoft2/exe/phigaro/2.2.1/bin/phigaro", line 11, in <module>
load_entry_point('phigaro==2.2.1', 'console_scripts', 'phigaro')()
File "/local/gensoft2/exe/phigaro/2.2.1/venv/lib/python3.8/site-packages/phigaro-2.2.1-py3.8.egg/phigaro/cli/batch.py", line 126, in main
os.mkdir(fold)
FileNotFoundError: [Errno 2] No such file or directory: ''
problem is located in phigaro/cli/batch.py as fold is defined this way:
fold = '/'.join(config['phigaro']['output'].replace('\\', '/').split('/')[:-1])
'str_whitout_/_inside'.split('/')[:-1]) => returns empty string
nb works with following command line.
but it is legit to name a local file without dot-slahs
regards
Eric
Hello!
Is there a built-in method to skip the "please select appropriate "x" location" prompts during setup?
...
Please select appropriate Prodigal location
[1] /local/home/rpetit/miniconda3/envs/bt-phigaro/bin/prodigal
[2] Add another path manually
Choose your option (Enter for /local/home/rpetit/miniconda3/envs/bt-phigaro/bin/prodigal):
Please select appropriate HMMER location
[1] /local/home/rpetit/miniconda3/envs/bt-phigaro/bin/hmmsearch
[2] Add another path manually
Choose your option (Enter for /local/home/rpetit/miniconda3/envs/bt-phigaro/bin/hmmsearch):
Found Prodigal in: /local/home/rpetit/miniconda3/envs/bt-phigaro/bin/prodigal
Found HMMER in: /local/home/rpetit/miniconda3/envs/bt-phigaro/bin/hmmsearch
...
Thank you!
I've run into the error when using the -c option (to avoid running the setup script):
$ phigaro -c config.yml -f $FNA -o out/${SLURM_ARRAY_TASK_ID} --not-open -t 4 -e tsv
Traceback (most recent call last):
File "/global/home/users/snayfach/.conda/envs/phigaro_env/bin/phigaro", line 8, in <module>
sys.exit(main())
File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/cli/batch.py", line 206, in main
hmmer_task=hmmer_task,
File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/cli/batch.py", line 35, in create_task
task = task_class(*args, **kwargs)
File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/batch/task/run_phigaro.py", line 35, in __init__
super().__init__()
File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/batch/task/base.py", line 25, in __init__
self._prepare()
File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/batch/task/run_phigaro.py", line 44, in _prepare
'threshold_min_%s' % self.mode
KeyError: 'threshold_min_basic'
My config file looks like:
hmmer:
bin: /global/home/users/snayfach/.conda/envs/phigaro_env/bin/hmmsearch
e_value_threshold: 0.00445
pvog_path: /global/scratch/snayfach/projects/checkv/4_imgvr_dtrs/2_run_tools/phigaro/phigaro-db/allpvoghmms
phigaro:
penalty_black: 2.2
penalty_white: 0.7
threshold_max: 46.0
threshold_min: 45.39
window_len: 32
prodigal:
bin: /global/home/users/snayfach/.conda/envs/phigaro_env/bin/prodigal
Is there an easy fix to this?
Hello,
can you provide a mirror of download.ripcm.com/phigaro/.
google drive is not useable with command line tools. (wgat, curl) that breaks some automatic build mechanism of phigaro.
can you provide a wget-able (or curl-able) location for the dbs.
regards
Eric
Hi Polly,
I was trying to download the pvog database to setup phigaro but this link is not working (http://download.ripcm.com/phigaro/).
Is there another way to download pvog and setup phigaro?
Cheers
Alan
Phigaro currently uses the GC score in a way that prophages are more likely to be GC-rich (i.e. genes have high GC content) than GC-poor. Although the benchmarking suggests this is a good approach it is puzzling biologically because we don't expect phages/prophages to have high GC content generally (indeed apparently this is not even the case in the training data). Instead, we might expect that the GC content of a prophage is different from that of the surrounding bacterial region. In this case, looking at the difference between the bacterial and prophage GC content (i.e. the GC skew) would be expected to be more useful than the absolute GC content.
A possible explanation for this puzzle is that, I think, for genes without significant pVOG hits or genes with no pVOG hits at all the GC content is set to 0. I'm basing this understanding on the hmmer_res_to_gc
function here in data.py
. This might be downwardly biasing the GC content for non-phage genes (i.e. genes without significant pVOG hits) by artificially assigning these genes a score of 0 rather than their actual GC content. This might explain why Phigaro tends to think prophages have high GC content. Note that even for genes without a pVOG hit the GC content is still calculated by Prodigal but these values are never used I think because the GC content is currently only read from the HMMER3 output.
If my understanding is correct (it might be wrong of course!) then my suggestion is for genes without significant pVOG hits the actual GC content of the gene is used rather than a 0 value. Of course this will impact in at least a minor way the resulting phage predictions. Also, this might point towards using a GC skew rather than the absolute GC content, but that remains to be seen. As I said before, I am not confident about this, so please do correct me if I have misunderstood, thank you
Is there a reason Phigaro dismisses contigs <20000 bp? Is there any way to alter the threshold?
Hello,
IIUC, phigaro
config file is, among other things, used to specify the location of some programs used by the software (hmmsearch
and prodigal
) and the location of the pVOG database.
I think that the location of software should not be stored on a config file but rather use the values found in the environment (with prior checks of course and maybe logging the binaries used) and have an CLI option to specify them. This is more flexible and simplify the installation. If I understand correctly, this is easy to do with the sh
package.
Similarly, I think that the location of the pVOG database should be based on an environment variable with a CLI option.
Of course the other parameters could stay in the config file.
Any thoughts ?
Phigaro is a wonderful tool, but I could not download the database. The link 'http://www.download.ripcm.com/phigaro/' seems not work due to unknown reasons. I'm not sure whether the problem is from the server or my own network. It seems that 'Wget' sent the request but the server did not respond. Google drive is also not available for me because of government policy restrictions in our country. Is there any other way to download the database?
Hi,
I'm suddenly getting a type error when analyzing an assembly:
Traceback (most recent call last):
File "/usr/local/bin/phigaro", line 5, in <module>
from phigaro.cli.batch import main
File "/usr/local/lib/python3.7/site-packages/phigaro/cli/batch.py", line 20, in <module>
from phigaro.batch.task.run_phigaro import RunPhigaroTask
File "/usr/local/lib/python3.7/site-packages/phigaro/batch/task/run_phigaro.py", line 21, in <module>
from phigaro.to_html.preprocess import plot_html, form_sequence, if_transposable
File "/usr/local/lib/python3.7/site-packages/phigaro/to_html/preprocess.py", line 40, in <module>
annotations = pickle.load(f)
File "/usr/local/lib/python3.7/copyreg.py", line 43, in _reconstructor
obj = object.__new__(cls)
TypeError: object.__new__(BlockManager) is not safe, use BlockManager.__new__()
Traceback (most recent call last):
File "phigaro_helper.py", line 136, in <module>
unknown_arguments=unknown)
File "/home/annotator/pipeline_script_base.py", line 241, in execute
config_dict=config_dict)
File "phigaro_helper.py", line 41, in entrypoint
debug=parsed_arguments.debug)
File "phigaro_helper.py", line 110, in run_command
shell=True)
File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
I'm not sure exactly what stage the program is failing at, but it looks like the HTML output preprocessing stage. I am actually specifying gff and tsv outputs only though using the following command:
phigaro -c config.yml -f assembly.fasta -e gff tsv --delete-shorts -o /tmp/tmpwbar6v85 -t 2
If you have any suggestions on a workaround or fix, please let me know. I am running phigaro 2.3.0 in a docker container based upon python 3.7 with all the prereqs installed.
Hello,
I tried to use this tool to predict prophage in different strains. It works in most strains. however, in some strains I can't get any results (with an empty output) and come out a problem as shown below. I am preety show that these genomes are good, and I can get results when I tried other tools. I will very appreciate help me to figure out what's the issue.
Thanks
Dai
Traceback (most recent call last):
File "/home/kuangdai/.local/bin/phigaro", line 8, in
sys.exit(main())
File "/home/kuangdai/.local/lib/python3.8/site-packages/phigaro/cli/batch.py", line 246, in main
task_output_file = run_tasks_chain(tasks)
File "/home/kuangdai/.local/lib/python3.8/site-packages/phigaro/batch/runner.py", line 20, in run_tasks_chain
task.run()
File "/home/kuangdai/.local/lib/python3.8/site-packages/phigaro/batch/task/hmmer.py", line 27, in run
self.hmmer(
File "/home/kuangdai/.local/lib/python3.8/site-packages/sh.py", line 1520, in call
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/home/kuangdai/.local/lib/python3.8/site-packages/sh.py", line 784, in init
self.wait()
File "/home/kuangdai/.local/lib/python3.8/site-packages/sh.py", line 841, in wait
self.handle_command_exit_code(exit_code)
File "/home/kuangdai/.local/lib/python3.8/site-packages/sh.py", line 865, in handle_command_exit_code
raise exc
sh.SignalException_SIGSEGV:
RAN: /home/kuangdai/miniconda3/bin/hmmsearch --cpu 16 --notextw --tblout proc/hmmer/A255-6fe68ffa37454fa3bfce47431d78c54f.hmmer_out /home/kuangdai/.phigaro/pvog/allpvoghmms proc/prodigal/A255-6fe68ffa37454fa3bfce47431d78c54f.faa
STDOUT:
Query: VOG0001 [M=98]
Scores for co... (12411522 more, please see e.stdout)
STDERR:
In case anyone is interested in helping with this replikation/What_the_Phage#88
Hi,
Thanks for your work on this tool-just found it in a search for prophage annotation pipelines and I like your approach versus the other tools in the field. Some request that would make it easier to integrate into our annotation pipeline, if possible:
No worries if these are not possible.
Hi,
Thanks for the great tool. I noticed a minor bug in the gff3 and bed outputs where the start positions of genes are shifted 1 bp downstream. See example image below (expected start codon is AUG at this locus).
I may be able to push a fix for this soon, but wanted to get your thoughts on implementation. It looks like the software in batch/task/run_phigaro.py
is doing the correct math assuming 0-based indexing, so the input data must actually be 1-based coming out of find_phages
? I guess there's 2 possible fixes: 1. alter find_phages behavior, or 2. adjust the coordinate shifting math in run_phigaro.py
. I'm assuming fixing the shifting math is easier, but I wonder if there are other places in the codebase that make the 0-based indexing assumption.
Cheers,
-Spencer
Hello
As a result, phigaro gives out various fields such as taxonomy, transposable, VOG, et cetera for each prophage found. Is there any way to get the intact or defective status using that information?
Hi,
I'm trying to run Phigaro in batch from custom scripts, but I am failing because it gives me the following message:
Error! Your fasta file contains at least one sequence length < 20000. The short sequences are:
Do you want to start Phigaro without these sequences? [Y/n]
This is causing me to have to filter these sequences prior to running Phigaro. Would it be able to implement an argument to the main Phigaro CLI script to simply ignore this error? Any workarounds are appreciated :)
Thank you for any assistance you can provide,
V
This is a very interesting and useful tool, but I have a question, which is the bed file in the output results, some of which have the following display
(phigaro) [kxy@zju Phigaro]$ cd /data/users/kxy/kxytry/assembleddata/analysis/phage/Phigaro/sp_2017_ST195_67074
(phigaro) [kxy@zju sp_2017_ST195_67074]$ more sp_2017_ST195_67074.phigaro.bed
##gff-version 3.2.1
NODE_34_length_35751_cov_67.7224 4909 9641 prophage1 . .
NODE_34_length_35751_cov_67.7224 15713 31032 prophage2 . .
NODE_34_length_35751_cov_67.7224 4909 5353 gene10 3.6e-84 -
NODE_34_length_35751_cov_67.7224 5546 5789 gene11 . +
NODE_34_length_35751_cov_67.7224 5795 5999 gene12 . -
NODE_34_length_35751_cov_67.7224 6137 6641 gene13 . -
NODE_34_length_35751_cov_67.7224 6642 7650 gene14 3.2e-194 -
NODE_34_length_35751_cov_67.7224 7701 7917 gene15 9.2e-52 -
NODE_34_length_35751_cov_67.7224 7931 8684 gene16 . -
NODE_34_length_35751_cov_67.7224 8987 9308 gene17 . +
NODE_34_length_35751_cov_67.7224 9369 9642 gene18 5.1e-54 +
NODE_34_length_35751_cov_67.7224 15713 16058 gene30 . +
NODE_34_length_35751_cov_67.7224 16266 16503 gene31 0.017 +
NODE_34_length_35751_cov_67.7224 17167 17623 gene32 . +
NODE_34_length_35751_cov_67.7224 17683 18118 gene33 7.3e-84 +
I want to know if there are no specific names for prophage1 and prophage2? Or is it a newly discovered prophage? Because I have hundreds of genomes to process and have already processed them, but I have to group them for statistics in the future. I don't know how to treat the prophages in the bed files corresponding to each genome。
In addition, are the following genes 10, 11, etc. bacteriophages or other special mobile components
This is a very nice tool. Is there a description of the modes anywhere?
All the best,
Sion
I am trying to install Phigaro using the code: conda install -c bioconda phigaro
However, I get this error. Can you help me?
Output in format: Requested package -> Available versionsThe following specifications were found to be incompatible with your system:
Your installed version is: 2.35
This is a very interesting and useful tool, but I have a question, which is the bed file in the output results, some of which have the following display
(phigaro) [kxy@zju Phigaro]$ cd /data/users/kxy/kxytry/assembleddata/analysis/phage/Phigaro/sp_2017_ST195_67074
(phigaro) [kxy@zju sp_2017_ST195_67074]$ more sp_2017_ST195_67074.phigaro.bed
##gff-version 3.2.1
NODE_34_length_35751_cov_67.7224 4909 9641 prophage1 . .
NODE_34_length_35751_cov_67.7224 15713 31032 prophage2 . .
NODE_34_length_35751_cov_67.7224 4909 5353 gene10 3.6e-84 -
NODE_34_length_35751_cov_67.7224 5546 5789 gene11 . +
NODE_34_length_35751_cov_67.7224 5795 5999 gene12 . -
NODE_34_length_35751_cov_67.7224 6137 6641 gene13 . -
NODE_34_length_35751_cov_67.7224 6642 7650 gene14 3.2e-194 -
NODE_34_length_35751_cov_67.7224 7701 7917 gene15 9.2e-52 -
NODE_34_length_35751_cov_67.7224 7931 8684 gene16 . -
NODE_34_length_35751_cov_67.7224 8987 9308 gene17 . +
NODE_34_length_35751_cov_67.7224 9369 9642 gene18 5.1e-54 +
NODE_34_length_35751_cov_67.7224 15713 16058 gene30 . +
NODE_34_length_35751_cov_67.7224 16266 16503 gene31 0.017 +
NODE_34_length_35751_cov_67.7224 17167 17623 gene32 . +
NODE_34_length_35751_cov_67.7224 17683 18118 gene33 7.3e-84 +
I want to know if there are no specific names for prophage1 and prophage2? Or is it a newly discovered prophage? Because I have hundreds of genomes to process and have already processed them, but I have to group them for statistics in the future. I don't know how to treat the prophages in the bed files corresponding to each genome。
In addition, are the following genes 10, 11, etc. bacteriophages or other special mobile components
Dear colleagues,
I installed phigaro via conda, creating a separate environment (phigaro). But the software does not work, because it accesses programs using the wrong path.
Traceback (most recent call last):
File "/home/user/anaconda3/envs/phigaro/bin/phigaro", line 10, in
sys.exit(main())
File "/home/user/anaconda3/envs/phigaro/lib/python3.6/site-packages/phigaro/cli/batch.py", line 232, in main
substitutions, ProdigalTask, preprocess_task=preprocess_task
File "/home/user/anaconda3/envs/phigaro/lib/python3.6/site-packages/phigaro/cli/batch.py", line 35, in create_task
task = task_class(*args, **kwargs)
File "/home/user/anaconda3/envs/phigaro/lib/python3.6/site-packages/phigaro/batch/task/prodigal.py", line 14, in init
self.prodigal = sh.Command(self.config['prodigal']['bin']).bake(
File "/home/user/anaconda3/envs/phigaro/lib/python3.6/site-packages/sh.py", line 788, in init
raise CommandNotFound(path)
sh.CommandNotFound: /home/user/anaconda3/bin/prodigal
But path must be /home/kabilov/anaconda3/envs/phigaro/bin/prodigal
Hello,
you may want to use 'command' instead of locate in order to find the path of auxiliary binaries
command is posix and available on all unices.
locate is not always available, eg on our cluster it is not, and won't be.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.