Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with ngm binary #23

Open
3miumi opened this issue Apr 27, 2023 · 4 comments
Open

Error with ngm binary #23

3miumi opened this issue Apr 27, 2023 · 4 comments

Comments

@3miumi
Copy link

3miumi commented Apr 27, 2023

Hi,

I successfully installed the read2tree on my ubuntu server. And run the command

ead2tree --tree --standalone_path /marker_genes/ --reads W_001.fastq.gz W_001.fastq.gz  --output_path output

It gave me error with

Traceback (most recent call last):
  File "/home/ming/miniconda3/envs/myenv/bin/read2tree", line 4, in <module>
    __import__('pkg_resources').run_script('read2tree==0.1.5', 'read2tree')
  File "/home/ming/miniconda3/envs/myenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 665, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/ming/miniconda3/envs/myenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1470, in run_script
    exec(script_code, namespace, namespace)
  File "/home/ming/miniconda3/envs/myenv/lib/python3.6/site-packages/read2tree-0.1.5-py3.6.egg/EGG-INFO/scripts/read2tree", line 16, in <module>
  File "/home/ming/miniconda3/envs/myenv/lib/python3.6/site-packages/read2tree-0.1.5-py3.6.egg/read2tree/main.py", line 357, in main
  File "/home/ming/miniconda3/envs/myenv/lib/python3.6/site-packages/read2tree-0.1.5-py3.6.egg/read2tree/Mapper.py", line 80, in __init__
  File "/home/ming/miniconda3/envs/myenv/lib/python3.6/site-packages/read2tree-0.1.5-py3.6.egg/read2tree/Mapper.py", line 290, in _map_reads_to_references
  File "/home/ming/miniconda3/envs/myenv/lib/python3.6/site-packages/read2tree-0.1.5-py3.6.egg/read2tree/Mapper.py", line 101, in _call_wrapper
  File "/home/ming/miniconda3/envs/myenv/lib/python3.6/site-packages/read2tree-0.1.5-py3.6.egg/read2tree/wrappers/read_mappers/ngm.py", line 37, in __init__
  File "/home/ming/miniconda3/envs/myenv/lib/python3.6/site-packages/read2tree-0.1.5-py3.6.egg/read2tree/wrappers/read_mappers/base_mapper.py", line 77, in __init__
read2tree.wrappers.WrapperError: Error searching for binary: ngm

Can you please help me with this issue?

Thanks,
Ming

@alpae
Copy link
Member

alpae commented Apr 28, 2023

you're missing the ngm tool. We recommend installing read2tree via conda (see https://github.com/DessimozLab/read2tree#1-installation-using-conda) as it installs the dependent tools as well. More information on ngm and how to install without conda can be found here: https://github.com/Cibiv/NextGenMap

@sinamajidian
Copy link
Contributor

In addition to Adrian's respond, I would like to mention that you can check whether ngm is installed correctly by running it in terminal

$ ngm
[MAIN] NextGenMap 0.5.5
Usage:  ngm [-c <path>] {-q <reads> [-p] | -1 <mates 1> -2 <mates 2>} -r <reference> -o <output> [parameter]

Besides, I can see that you are using python 3.6, however we suggest using python 3.10.

@3miumi
Copy link
Author

3miumi commented May 10, 2023

Thank you for your reply! I tried your instruction and succesfully installed it. But when I run a ecoli sample against ecoli gene_marker, it gives me this error. Can you please help me with it?

$ read2tree --tree --standalone_path marker_genes/ --reads Q1.fastq Q2.fastq --output_put output/                                                                                            
[E::hts_open_format] Failed to open file "/tmp/ngm_xsqy3ygg/ECOLI_OGs_post_sorted.bam" : No such file or directory
Mapping reads to species:   0%|                                                                                                                                 | 0/2 [02:50<?, ? species/s]
Traceback (most recent call last):
  File "/home/ming/miniconda3/envs/r2t/bin/read2tree", line 4, in <module>
    __import__('pkg_resources').run_script('read2tree==0.1.5', 'read2tree')
  File "/home/ming/miniconda3/envs/r2t/lib/python3.10/site-packages/pkg_resources/__init__.py", line 720, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/ming/miniconda3/envs/r2t/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1570, in run_script
    exec(script_code, namespace, namespace)
  File "/home/ming/miniconda3/envs/r2t/lib/python3.10/site-packages/read2tree-0.1.5-py3.10.egg/EGG-INFO/scripts/read2tree", line 16, in <module>
  File "/home/ming/miniconda3/envs/r2t/lib/python3.10/site-packages/read2tree-0.1.5-py3.10.egg/read2tree/main.py", line 293, in main
  File "/home/ming/miniconda3/envs/r2t/lib/python3.10/site-packages/read2tree-0.1.5-py3.10.egg/read2tree/Mapper.py", line 80, in __init__
  File "/home/ming/miniconda3/envs/r2t/lib/python3.10/site-packages/read2tree-0.1.5-py3.10.egg/read2tree/Mapper.py", line 289, in _map_reads_to_references
  File "/home/ming/miniconda3/envs/r2t/lib/python3.10/site-packages/read2tree-0.1.5-py3.10.egg/read2tree/Mapper.py", line 138, in _call_wrapper
  File "/home/ming/miniconda3/envs/r2t/lib/python3.10/site-packages/read2tree-0.1.5-py3.10.egg/read2tree/Mapper.py", line 570, in _post_process_read_mapping
  File "/home/ming/miniconda3/envs/r2t/lib/python3.10/site-packages/read2tree-0.1.5-py3.10.egg/read2tree/Mapper.py", line 498, in _build_consensus_seq_v2
  File "pysam/libcalignmentfile.pyx", line 747, in pysam.libcalignmentfile.AlignmentFile.__cinit__
  File "pysam/libcalignmentfile.pyx", line 946, in pysam.libcalignmentfile.AlignmentFile._open
FileNotFoundError: [Errno 2] could not open alignment file `/tmp/ngm_xsqy3ygg/ECOLI_OGs_post_sorted.bam`: No such file or directory

@sinamajidian
Copy link
Contributor

I'm glad you installed read2tree. I'm wondering whether you ran test dataset to make sure package is installed successfully.
This situation can happen when there are not enough mapped reads to the reference gene markers. Could you please tell us what are reference species and the outgroup you used and how many OGs are in the 01_ref_ogs_aa & number of genes in one them?
We would be also happy to debug your case if you could share with us your sequencing reads Q1/Q2 and gene_markers. (You can email us as well [email protected])

Best regards,
Sina

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants