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

No such file or directory error #67

Open
jeremysutherland opened this issue Aug 5, 2024 · 3 comments
Open

No such file or directory error #67

jeremysutherland opened this issue Aug 5, 2024 · 3 comments

Comments

@jeremysutherland
Copy link

Script

db="ncbi_nt/ncbi_nt"
kma -ipe A16_S5_3_F22_S139_R1_001.atria.fastq.gz A16_S5_3_F22_S139_R2_001.atria.fastq.gz -o A16_S5_3_F22_S139_out_kma -t_db $db -t 20 -1t1 -mem_mode -and -apm f

List files

(ccmetagen) [jus1990@p-sc-2393 ccmetagen]$ ls
A16_S5_3_F22_S139_out_kma.aln
A16_S5_3_F22_S139_out_kma.fsa
A16_S5_3_F22_S139_R1_001.atria.fastq.gz
A16_S5_3_F22_S139_R2_001.atria.fastq.gz
merged.tab
syn.tab
taxdump.tar.gz
A16_S5_3_F22_S139_out_kma.frag.gz
A16_S5_3_F22_S139_out_kma.res
ncbi_nt
taxa.tab

run CCMetagen.py

(ccmetagen) [jus1990@p-sc-2393 ccmetagen]$ CCMetagen.py -i A16_S5_3_F22_S139_out_kma -o results

Reading file A16_S5_3_F22_S139_out_kma

Traceback (most recent call last):
File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/bin/CCMetagen.py", line 211, in
df = pd.read_csv(f, sep='\t', index_col=0, encoding='latin1')
File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/lib/python3.6/site-packages/pandas/io/parsers.py", line 688, in read_csv
return _read(filepath_or_buffer, kwds)
File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/lib/python3.6/site-packages/pandas/io/parsers.py", line 454, in _read
parser = TextFileReader(fp_or_buf, **kwds)
File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/lib/python3.6/site-packages/pandas/io/parsers.py", line 948, in init
self._make_engine(self.engine)
File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/lib/python3.6/site-packages/pandas/io/parsers.py", line 1180, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/lib/python3.6/site-packages/pandas/io/parsers.py", line 1993, in init
src = open(src, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'A16_S5_3_F22_S139_out_kma' <<<<<<<<<<<<<<<<<<<<<

@vrmarcelino
Copy link
Owner

I think the .res is missing. Try: CCMetagen.py -i A16_S5_3_F22_S139_out_kma.res -o results

@jeremysutherland
Copy link
Author

Thanks that did the trick. But I ran into a different issue:

(ccmetagen) [jus1990@p-sc-2360 ccmetagen]$ CCMetagen.py -i A16_S5_3_F22_S139_out_kma.res -o results

Reading file A16_S5_3_F22_S139_out_kma.res


Traceback (most recent call last):
  File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/bin/CCMetagen.py", line 274, in <module>
    df = fParseKMA.populate_w_tax(df, ref_database, st, gt, ft, ot, ct, pt)
  File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/lib/python3.6/site-packages/ccmetagen/fParseKMA.py", line 104, in populate_w_tax
    match_info = fNCBItax.lineage_extractor(match_info.TaxId, match_info, taxfile)
  File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/lib/python3.6/site-packages/ccmetagen/fNCBItax.py", line 24, in lineage_extractor
    lineage = ncbi.get_lineage(query_taxid)
  File "/storage/home/jus1990/work/miniconda3/envs/ccmetagen/lib/python3.6/site-packages/ete3/ncbi_taxonomy/ncbiquery.py", line 238, in get_lineage
    raise ValueError("%s taxid not found" %taxid)
ValueError: 3878 taxid not found

@vrmarcelino
Copy link
Owner

You probably need to update your local ETE3 database, which contains the taxids and lineage information:

python
from ete3 import NCBITaxa
ncbi = NCBITaxa()
ncbi.update_taxonomy_database()
quit()

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

2 participants