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 downloading database #28

Open
Niicii opened this issue Sep 8, 2022 · 2 comments
Open

Error downloading database #28

Niicii opened this issue Sep 8, 2022 · 2 comments

Comments

@Niicii
Copy link

Niicii commented Sep 8, 2022

Hello,

I wanted to try tiptoft but similarly to issue #26 I encounter the following error when trying to run tiptoft_database_downloader v1.0.2. Before breaking, the downloader saved nine .fsa files to tiptoft_db.tmp.download .
If you require additional information please let me know.
Thanks for having a look at it!

Best,
Laura

Combining downloaded fasta files...
    RepA_N.fsa
    enterobacteriaceae.fsa
Traceback (most recent call last):
  File "/home/user/.local/bin/tiptoft_database_downloader", line 30, in <module>
    tiptoft.run()
  File "/home/user/.local/lib/python3.9/site-packages/tiptoft/TipToftDatabaseDownloader.py", line 23, in run
    refgenes.run(self.output_prefix)
  File "/home/user/.local/lib/python3.9/site-packages/tiptoft/RefGenesGetter.py", line 85, in run
    exec('self._get_from_' + self.ref_db + '(outprefix)')
  File "<string>", line 1, in <module>
  File "/home/user/.local/lib/python3.9/site-packages/tiptoft/RefGenesGetter.py", line 58, in _get_from_plasmidfinder
    for seq in file_reader:
  File "/home/user/.local/lib/python3.9/site-packages/pyfastaq/sequences.py", line 141, in file_reader
    raise Error('Error determining file type from file "' + fname + '". First line is:\n' + line.rstrip())
pyfastaq.sequences.Error: Error determining file type from file "/path/to/location/enterobacteriaceae.fsa". First line is:
<!DOCTYPE html>
@adriangeerre
Copy link

adriangeerre commented Feb 20, 2023

Hi @Niicii ,

I am trying to use tiptoft and I found the same error as you did. I have solve it by modifying the script RefGenesGetter.py which was located inside the conda enviroment I created "<conda_env_path>/lib/python3.10/site-packages/tiptoft/RefGenesGetter.py".

I modified the lines 41 to 44 to be:

for f in files_to_download:
    cmd = 'wget https://bitbucket.org/genomicepidemiology/plasmidfinder_db/raw/master/'+str(f)
    print('Downloading data with:', cmd, sep='\n')
    subprocess.check_call(cmd, shell=True)

Hope it helps!
Adrián

@AdityaLankapalli
Copy link

This error comes up because tiptoft_database_downloader is trying to download enterobacteriaceae.fsa from plasmidfinder_db, which has been modified to enterobacteriales.fsa.
enterobacteriaceae.fsa → enterobacteriales.fsa
I modified the tiptoft/RefGenesGetter.py line 39:

files_to_download = ['enterobacteriaceae.fsa', 'Inc18.fsa', 'NT_Rep.fsa', 'Rep1.fsa', 'Rep2.fsa', 'Rep3.fsa', 'RepA_N.fsa', 'RepL.fsa', 'Rep_trans.fsa']

to

files_to_download = ['enterobacteriales.fsa', 'Inc18.fsa', 'NT_Rep.fsa', 'Rep1.fsa', 'Rep2.fsa', 'Rep3.fsa', 'RepA_N.fsa', 'RepL.fsa', 'Rep_trans.fsa']

and was able to download.

Hope this helps !!

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