rcs333 / VAPiD

VAPiD: Viral Annotation and Identification Pipeline
MIT License
50 stars 15 forks source link

nboundLocalError: local variable 'name_of_virus' referenced before assignment for Insect virus #15

Open shanmugavadivelps opened 2 years ago

shanmugavadivelps commented 2 years ago

Hi sir, I am using Vapid3 to annotate the insect virus following the command

"python vapid3.py /media/shanmu/shanmu_data/Sanjay_Viral_whole_genome/denovo_with_reference_alignment_27th_Nov_2021/Final_for_paper/NNG1/NNG1_Picard_VirgenA/out_NNg1/ragtag_scaffold.fasta IIPR05_template.sbt --online --r AP010907.1"

I have checked the availability of the reference virus (AP010907.1) in .nhr and .nin files/databases but it was not available.

when I run the command, it throws an error like below.

AP010907.1 was the selected reference Traceback (most recent call last): File "vapid3.py", line 968, in strain2species[virus_strain_list[x]] = annotate_a_virus(virus_strain_list[x], virus_genome_list[x], File "vapid3.py", line 634, in annotate_a_virus name_of_virus, our_seq, ref_seq, ref_accession, need_to_rc = blast_n_stuff(strain, strain + SLASH + strain + '.fasta') File "vapid3.py", line 210, in blast_n_stuff print(name_of_virus + ' was the parsed name of the virus') UnboundLocalError: local variable 'name_of_virus' referenced before assignment

what to do if the selected reference are not available in .nin and .nhr?

pls help me to solve the issue

rcs333 commented 2 years ago

Hey there,

I originally built this only for human viruses so that is why AP010907 is not in the local database. I would try using the -f command to specify a local .gbf file to annotate your submission.

I recommend downloading the AP010907.gbf file from genbank (It will download with the name sequence.gb so I like to rename them right away).

Then try running the command:

python vapid3.py your_file.fasta template.sbt -f AP010907.gbf

Let me know if you have difficulties with this step or if this does not fix the problem!

Ryan

shanmugavadivelps commented 2 years ago

Thanks sir for reply and help

I have done as you said but it failed. the command and output is given below for your reference

python vapid3.py /media/shanmu/shanmu_data/Sanjay_Viral_whole_genome/denovo_with_reference_alignment_27th_Nov_2021/Final_for_paper/NNG1/NNG1_Picard_VirgenA/out_NNg1/ragtag_scaffold.fasta IIPR05_template.sbt --f /home/shanmu/VAPiD-master/all_virus/AP010907.gbf

Output: Warning: [blastn] Examining 5 or more matches is recommended Error: NCBI C++ Exception: T0 "/opt/conda/conda-bld/blast_1595737360567/work/blast/c++/src/corelib/ncbiobj.cpp", line 981: Critical: (CCoreException::eNullPtr) ncbi::CObject::ThrowNullPointerException() - Attempt to access NULL pointer. Stack trace: /home/shanmu/anaconda3/bin/../lib/ncbi-blast+/libxncbi.so ???:0 ncbi::CStackTraceImpl::CStackTraceImpl() offset=0x5D addr=0x7f1274fff29d /home/shanmu/anaconda3/bin/../lib/ncbi-blast+/libxncbi.so ???:0 ncbi::CStackTrace::CStackTrace(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&) offset=0x21 addr=0x7f1274fff341 /home/shanmu/anaconda3/bin/../lib/ncbi-blast+/libxncbi.so ???:0 ncbi::CException::x_GetStackTrace() offset=0x97 addr=0x7f1275093027 /home/shanmu/anaconda3/bin/../lib/ncbi-blast+/libxncbi.so ???:0 ncbi::CException::SetSeverity(ncbi::EDiagSev) offset=0x62 addr=0x7f1275094502 /home/shanmu/anaconda3/bin/../lib/ncbi-blast+/libxncbi.so ???:0 ncbi::CObject::ThrowNullPointerException() offset=0xB4 addr=0x7f12750cce24 /home/shanmu/anaconda3/bin/../lib/ncbi-blast+/libxblast.so ???:0 ncbi::blast::CBlastTracebackSearch::Run() offset=0xBC0 addr=0x7f12763185d0 /home/shanmu/anaconda3/bin/../lib/ncbi-blast+/libxblast.so ???:0 ncbi::blast::CLocalBlast::Run() offset=0x12C4 addr=0x7f12762b2664 blastn ???:0 CBlastnApp::Run() offset=0x107C addr=0x55a32008e5cc /home/shanmu/anaconda3/bin/../lib/ncbi-blast+/libxncbi.so ???:0 ncbi::CNcbiApplicationAPI::x_TryMain(ncbi::EAppDiagStream, char const, int, bool) offset=0x16B addr=0x7f1275010eab /home/shanmu/anaconda3/bin/../lib/ncbi-blast+/libxncbi.so ???:0 ncbi::CNcbiApplicationAPI::AppMain(int, char const const, char const const, ncbi::EAppDiagStream, char const, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&) offset=0x67E addr=0x7f127501394e blastn ???:0 main offset=0x79 addr=0x55a320089159 /lib/x86_64-linux-gnu/libc.so.6 ???:0 __libc_start_main offset=0xF3 addr=0x7f1274bc8083 blastn ???:0 offset=0x123E5 addr=0x55a32008a3e5

Traceback (most recent call last): File "vapid3.py", line 968, in strain2species[virus_strain_list[x]] = annotate_a_virus(virus_strain_list[x], virus_genome_list[x], File "vapid3.py", line 634, in annotate_a_virus name_of_virus, our_seq, ref_seq, ref_accession, need_to_rc = blast_n_stuff(strain, strain + SLASH + strain + '.fasta') File "vapid3.py", line 186, in blast_n_stuff record = Entrez.read(Entrez.esearch(db='nucleotide', term=ref_seq_gb)) UnboundLocalError: local variable 'ref_seq_gb' referenced before assignment

should i make blast database with makeblastdb?

rcs333 commented 2 years ago

Shoot, well I haven't seen the error you pasted ever before. I haven't really tested VAPiD on non-human viruses so I'm not surprised weird stuff is happening.

Yeah, adding your reference to the blast database with the makeblastdb command is a good thing to try next.

If you upload the file you're trying to annotate I can take a look at it. If you don't want to publicly upload it to github you can email it to ryanshean1@gmail.com. I think if I can see your input I might get a better idea of why this happening.