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

uberBlast.py / parseDiamond: FileNotFoundError #24

Open
MrTomRod opened this issue Feb 21, 2023 · 1 comment
Open

uberBlast.py / parseDiamond: FileNotFoundError #24

MrTomRod opened this issue Feb 21, 2023 · 1 comment

Comments

@MrTomRod
Copy link

I get this error message:

$ PEPPAN --testunit
$ PEPPAN_parser -g examples/ST131.PEPPAN.gff -s examples/PEPPAN_out -t -c -a 95
(...)
2023-02-21 15:11:25.606204	Run BLASTn starts
2023-02-21 15:11:28.556587	Run BLASTn finishes. Got 7122 alignments
2023-02-21 15:11:28.557285	Run diamond starts
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "CONDAENV/peppan/lib/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "CONDAENV/peppan/lib/python3.9/site-packages/PEPPAN/modules/uberBlast.py", line 19, in parseDiamond
    with open(fn) as fin :
FileNotFoundError: [Errno 2] No such file or directory: './NS_m9qoyw5k/aaMatch.0'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "CONDAENV/peppan/lib/python3.9/site-packages/PEPPAN/modules/uberBlast.py", line 345, in run
    blastab.append(tools[method.lower()](ref, qry))
  File "CONDAENV/peppan/lib/python3.9/site-packages/PEPPAN/modules/uberBlast.py", line 554, in runDiamond
    for r in self.pool.imap_unordered(parseDiamond, [ ['{0}.{1}'.format(aaMatch, id), self.refSeq, self.qrySeq, self.min_id, self.min_cov, self.min_ratio] for id in xrange(5) ]) :
  File "CONDAENV/peppan/lib/python3.9/multiprocessing/pool.py", line 870, in next
    raise value
FileNotFoundError: [Errno 2] No such file or directory: './NS_m9qoyw5k/aaMatch.0'
(...)
$ PEPPAN_parser -g examples/ST131.PEPPAN.gff -s examples/PEPPAN_out -t -c -a 95

The error does not cause the program to crash and I get seemingly normal output. Even step 2 seems to work normally.

What does that mean?!

This is how I installed PEPPAN:

conda config --add channels defaults
conda config --add channels conda-forge
conda config --add channels bioconda
conda create --prefix ./CONDAENV python=3.9
conda activate ./CONDAENV
conda install mmseqs2 blast diamond rapidnj fasttree
pip3 install peppan

Also:

 $ diamond --version
diamond version 2.0.15

See also full_output.zip

@MrTomRod
Copy link
Author

MrTomRod commented Feb 23, 2023

I dumped some stuff here:

Popen(diamond_cmd.split(), stdout=PIPE, stderr=PIPE, universal_newlines=True).communicate()

How I dumped:

            if not os.path.isfile(f'{aaMatch}.{id}'):
                import random, string
                with open(f'logs/{"".join(random.choice(string.ascii_letters) for i in range(10))}', 'w') as f:
                    f.write(f'CMD=       {diamond_cmd}\n')
                    f.write(f'CMD_split= {diamond_cmd.split()}\n')
                    f.write(f'STDOUT:\n')
                    f.write(stdout)
                    f.write(f'\nSTDERR:\n')
                    f.write(stderr)

This creates 25 files, the contains is always very similar. Here's an example:

CMD=       conda-envs/peppan/lib/python3.9/site-packages/PEPPAN/dependencies/diamond blastp --no-self-hits --threads 1 --db "./NS_uaax4ld6/refAA.3" --query ./NS_uaax4ld6/qryAA --out "./NS_uaax4ld6/aaMatch.3" --id 40.0 --query-cover 25.0 --evalue 1 -k 10 --dbsize 5000000 --outfmt 101
CMD_split= ['conda-envs/peppan/lib/python3.9/site-packages/PEPPAN/dependencies/diamond', 'blastp', '--no-self-hits', '--threads', '1', '--db', '"./NS_uaax4ld6/refAA.3"', '--query', './NS_uaax4ld6/qryAA', '--out', '"./NS_uaax4ld6/aaMatch.3"', '--id', '40.0', '--query-cover', '25.0', '--evalue', '1', '-k', '10', '--dbsize', '5000000', '--outfmt', '101']
STDOUT:

STDERR:
diamond v0.9.24.125 | by Benjamin Buchfink <buchfink@gmail.com>
Licensed under the GNU GPL <https://www.gnu.org/licenses/gpl.txt>
Check http://github.com/bbuchfink/diamond for updates.

#CPU threads: 1
Scoring parameters: (Matrix=BLOSUM62 Lambda=0.267 K=0.041 Penalties=11/1)
No such file or directory
Error: Error opening temporary file "./NS_uaax4ld6/diamond-tmp-ojBR6p

If I prevent the deletion of the temporary folder and execute the command after the fact, it works. This is the command I mean:

diamond blastp --no-self-hits --threads 1 --db "./NS_uaax4ld6/refAA.3" --query ./NS_uaax4ld6/qryAA --out "./NS_uaax4ld6/aaMatch.3" --id 40.0 --query-cover 25.0 --evalue 1 -k 10 --dbsize 5000000 --outfmt 101

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

1 participant