resfinder empy results files ?

Issue #14 resolved
Eric Deveaud created an issue

hello,

I’m having a problem while running resfinder.py using the following command line using the following test.fsa file: https://bitbucket.org/genomicepidemiology/resfinder/src/master/test.fsa

resfinder.py -mp blastn -i ../../datas/resfinder/test.fsa -p /local/gensoft2/exe/resfinder/3.2/share/resfinder_db -x 2>&1 |tee log

Found: aac(2')-Ic_1_U72714
Saving: gi|375294201|ref|NC_016768.1| Mycobacterium tuberculosis KZN 4207 chromosome, complete genome:314249..314794:aac(2')-Ic_1_U72714:100.000000
Found: erm(37)_1_AL123456
Saving: gi|375294201|ref|NC_016768.1| Mycobacterium tuberculosis KZN 4207 chromosome, complete genome:2187584..2188123:erm(37)_1_AL123456:100.000000
{'resfinder': {'results': {'Aminoglycoside': {'aminoglycoside': {"aac(2')-Ic_1_U72714": {'HSP_length': 546,
                                                                                         'accession': 'U72714',
                                                                                         'contig_name': 'gi|375294201|ref|NC_016768.1| '
                                                                                                        'Mycobacterium '
                                                                                                        'tuberculosis '
                                                                                                        'KZN '
                                                                                                        '4207 '
                                                                                                        'chromosome, '
                                                                                                        'complete '
                                                                                                        'genome',
                                                                                         'coverage': 100.0,
                                                                                         'hit_id': 'gi|375294201|ref|NC_016768.1| '
                                                                                                   'Mycobacterium '
                                                                                                   'tuberculosis '
                                                                                                   'KZN '
                                                                                                   '4207 '
                                                                                                   'chromosome, '
                                                                                                   'complete '
                                                                                                   "genome:314249..314794:aac(2')-Ic_1_U72714:100.000000",
                                                                                         'identity': 100.0,
                                                                                         'note': '1',
                                                                                         'position_in_ref': '1..546',
                                                                                         'positions_in_contig': '314249..314794',
                                                                                         'predicted_phenotype': 'Aminoglycoside '
                                                                                                                'resistance',
                                                                                         'resistance_gene': "aac(2')-Ic",
                                                                                         'template_length': 546}}},
                           'Beta-lactam': {'beta-lactam': 'No hit found'},
                           'Colistin': {'colistin': 'No hit found'},
                           'Fosfomycin': {'fosfomycin': 'No hit found'},
                           'Fusidicacid': {'fusidicacid': 'No hit found'},
                           'Glycopeptide': {'glycopeptide': 'No hit found'},
                           'Macrolide': {'macrolide': {'erm(37)_1_AL123456': {'HSP_length': 540,
                                                                              'accession': 'AL123456',
                                                                              'contig_name': 'gi|375294201|ref|NC_016768.1| '
                                                                                             'Mycobacterium '
                                                                                             'tuberculosis '
                                                                                             'KZN '
                                                                                             '4207 '
                                                                                             'chromosome, '
                                                                                             'complete '
                                                                                             'genome',
                                                                              'coverage': 100.0,
                                                                              'hit_id': 'gi|375294201|ref|NC_016768.1| '
                                                                                        'Mycobacterium '
                                                                                        'tuberculosis '
                                                                                        'KZN '
                                                                                        '4207 '
                                                                                        'chromosome, '
                                                                                        'complete '
                                                                                        'genome:2187584..2188123:erm(37)_1_AL123456:100.000000',
                                                                              'identity': 100.0,
                                                                              'note': '1',
                                                                              'position_in_ref': '1..540',
                                                                              'positions_in_contig': '2187584..2188123',
                                                                              'predicted_phenotype': 'Warning: '
                                                                                                     'gene '
                                                                                                     'is '
                                                                                                     'missing '
                                                                                                     'from '
                                                                                                     'Notes '
                                                                                                     'file. '
                                                                                                     'Please '
                                                                                                     'inform '
                                                                                                     'curator.',
                                                                              'resistance_gene': 'erm(37)',
                                                                              'template_length': 540}}},
                           'Nitroimidazole': {'nitroimidazole': 'No hit found'},
                           'Oxazolidinone': {'oxazolidinone': 'No hit found'},
                           'Phenicol': {'phenicol': 'No hit found'},
                           'Quinolone': {'quinolone': 'No hit found'},
                           'Rifampicin': {'rifampicin': 'No hit found'},
                           'Sulphonamide': {'sulphonamide': 'No hit found'},
                           'Tetracycline': {'tetracycline': 'No hit found'},
                           'Trimethoprim': {'trimethoprim': 'No hit found'}},
               'run_info': {'date': '24.04.2020', 'time': '17:51:53'},
               'user_input': {'file_format': 'fasta',
                              'filename(s)': ['../../datas/resfinder/test.fsa'],
                              'method': 'blast'}}}
[['', '', '', 'No hit found', '', '', '']]

but the outpuT files. Hit_in_genome_seq.fsa , Resistance_genes.fsa and results_tab.tsv are empty

any idea why ?

can you explain ?

NB runnig resfinder on a python3.5 virtualenv buit and installed this way.

/local/gensoft2/adm/python/3.5/bin/python3.5 -m virtualenv /local/gensoft2/exe/resfinder/3.2/venv
mkdir /local/gensoft2/exe/resfinder/3.2/share && cd /local/gensoft2/exe/resfinder/3.2/share && git clone https://git@bitbucket.org/genomicepidemiology/resfinder_db.git 
# know index the fsa files kma is on the path
cd /local/gensoft2/exe/resfinder/3.2/share/resfinder_db && /local/gensoft2/exe/resfinder/3.2/venv/bin/python3.5 ./INSTALL.py
#install required python modules
/local/gensoft2/exe/resfinder/3.2/venv/bin/python3.5 -m pip install biopython cgecore tabulate
#install resfinder
mkdir /local/gensoft2/exe/resfinder/3.2/bin
install -m0755  /local/gensoft2/src/resfinder/resfinder-3.2/resfinder.py /local/gensoft2/exe/resfinder/3.2/bin

Comments (8)

  1. Eric Deveaud reporter

    after taking a look at resfinder.py code. I endend with the above attached patch.

    that I submit for your review, in the hope it'll be accepted

    it allows outputs in Hit_in_genome_seq.fsa , Resistance_genes.fsa and results_tab.tsv files with what’s looks like (for a non biologist, as I am 😉) fine.

    best regards

    Eric

  2. Cyril Savin

    Just to let you know: I tried the patch written by Eric Deveaud and I can confirm that now it allows the extraction of antimicrobial resistance in the 3 files (Hit_in_genome_seq.fsa, Resistance_genes.fsa, results_tab.tsv) that were empty without the patch.

    Thank you Eric!

  3. Alfred Ferrer Florensa

    Dear eric,

    Thank you for taking a look at our code. We have limited resources and some times we made mistakes when pushing our commits. However, if your fixing is removing the “exit()”s and “print()”s, I have to say you might be working with an old version of the code, as I remember that was one mistake I did some time ago. As I cannot find them in the current code… I think if you pull the new commits you will enjoy a better code than what you were using 🙂

    Also, you might want to use the argument “-o” to direct your output.

    From your installation, I would be also cautious which Biopython you are using. We recommend to use the number 1.73, as 1.74 has some bugs that they have not fixed yet.

    If it is not a problem of the new code, please tell us! We will fix it 🙂

    And thanks!

    Alfred

  4. Eric Deveaud reporter

    I was working from the tagged version, as our policy is to install when possible tagged version on our cluster.

    I’ll be happy to install the fixed new release version.

    thanks=

    Eric

  5. Log in to comment