LiLabAtVT / DeepTE

Neural network classification of TE
BSD 3-Clause "New" or "Revised" License
85 stars 7 forks source link

Bio.Data.CodonTable.TranslationError: ambiguous codon 'TXA' codes for both proteins and stop codons #1

Closed YTLogos closed 4 years ago

YTLogos commented 4 years ago

Hi @songliVT @yanhaidong1 DeepTE is a very good tool. I got the error when I run the DeepTE_domain.py. the code is

/usr/bin/python ~/biosoft/DeepTE/DeepTE_domain.py -d working_dir_md -o output_dir_md -i all.repeat.lib -s DeepTE/supfile_dir --hmmscan hmmscan

The error is :

....
....
the number of analysis is 12011
the number of analysis is 12012
the number of analysis is 12013
the number of analysis is 12014
the number of analysis is 12015
Traceback (most recent call last):
  File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Data/CodonTable.py", line 424, in __getitem__
    self.ambiguous_nucleotide)
  File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Data/CodonTable.py", line 255, in list_possible_proteins
    " proteins and stop codons" % codon)
Bio.Data.CodonTable.TranslationError: ambiguous codon 'TXA' codes for both proteins and stop codons

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Seq.py", line 2760, in _translate_str
    amino_acids.append(forward_table[codon])
  File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Data/CodonTable.py", line 430, in __getitem__
    raise TranslationError(codon)  # does not code
Bio.Data.CodonTable.TranslationError: TXA

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/taoyan/biosoft/DeepTE/DeepTE_domain.py", line 100, in <module>
    main()
  File "/home/taoyan/biosoft/DeepTE/DeepTE_domain.py", line 91, in main
    te_domain_pattern_dic = domain_detection.collect_domain_from_six_rdframe(ipt_seq, hmmscan_exe, working_dir)
  File "/home/taoyan/biosoft/DeepTE/scripts/DeepTE_detect_domain.py", line 186, in collect_domain_from_six_rdframe
    pro_seq_six_frame_dic = translate_all_te(seq_record.seq)
  File "/home/taoyan/biosoft/DeepTE/scripts/DeepTE_detect_domain.py", line 41, in translate_all_te
    f6 = six_frame_translations(te_seq)
  File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/SeqUtils/__init__.py", line 485, in six_frame_translations
    frames[i + 1] = translate(seq[i:i + fragment_length], genetic_code)
  File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Seq.py", line 2875, in translate
    return sequence.translate(table, stop_symbol, to_stop, cds)
  File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Seq.py", line 1223, in translate
    cds, gap=gap)
  File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Seq.py", line 2777, in _translate_str
    "Codon '{0}' is invalid".format(codon))
Bio.Data.CodonTable.TranslationError: Codon 'TXA' is invalid

Is there any idea to solve the problem? thanks!

yanhaidong1 commented 4 years ago

Hi TOM,

Thanks for using the DeepTE.

The error report shows ‘ambiguous codon 'TXA' codes for both proteins and stop codons’. I imagine the input sequence has an X which triggers an error in biopython.

Can you check with your sequence?

If you have any questions, let me know. Thanks

Best wishes

haidong

On Thu, Nov 21, 2019 at 2:02 AM TOM YAN notifications@github.com wrote:

Hi @songliVT https://github.com/songliVT @yanhaidong1 https://github.com/yanhaidong1 DeepTE is a very good tool. I get the error when I use the DeepTE_domain.py. the code is

/usr/bin/python ~/biosoft/DeepTE/DeepTE_domain.py -d working_dir_md -o output_dir_md -i all.repeat.lib -s DeepTE/supfile_dir --hmmscan hmmscan

The error is :

.... .... the number of analysis is 12011 the number of analysis is 12012 the number of analysis is 12013 the number of analysis is 12014 the number of analysis is 12015 Traceback (most recent call last): File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Data/CodonTable.py", line 424, in getitem self.ambiguous_nucleotide) File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Data/CodonTable.py", line 255, in list_possible_proteins " proteins and stop codons" % codon) Bio.Data.CodonTable.TranslationError: ambiguous codon 'TXA' codes for both proteins and stop codons

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Seq.py", line 2760, in _translate_str amino_acids.append(forward_table[codon]) File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Data/CodonTable.py", line 430, in getitem raise TranslationError(codon) # does not code Bio.Data.CodonTable.TranslationError: TXA

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/taoyan/biosoft/DeepTE/DeepTE_domain.py", line 100, in main() File "/home/taoyan/biosoft/DeepTE/DeepTE_domain.py", line 91, in main te_domain_pattern_dic = domain_detection.collect_domain_from_six_rdframe(ipt_seq, hmmscan_exe, working_dir) File "/home/taoyan/biosoft/DeepTE/scripts/DeepTE_detect_domain.py", line 186, in collect_domain_from_six_rdframe pro_seq_six_frame_dic = translate_all_te(seq_record.seq) File "/home/taoyan/biosoft/DeepTE/scripts/DeepTE_detect_domain.py", line 41, in translate_all_te f6 = six_frame_translations(te_seq) File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/SeqUtils/init.py", line 485, in six_frame_translations frames[i + 1] = translate(seq[i:i + fragment_length], genetic_code) File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Seq.py", line 2875, in translate return sequence.translate(table, stop_symbol, to_stop, cds) File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Seq.py", line 1223, in translate cds, gap=gap) File "/home/taoyan/.local/lib/python3.6/site-packages/Bio/Seq.py", line 2777, in _translate_str "Codon '{0}' is invalid".format(codon)) Bio.Data.CodonTable.TranslationError: Codon 'TXA' is invalid

Is there any idea to solve the problem? thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LiLabAtVT/DeepTE/issues/1?email_source=notifications&email_token=AIO5OYGOPUDFDMA3IBQJBOTQUYXBTA5CNFSM4JP53TM2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3AJBVA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIO5OYHJERXLFFB34XGAPIDQUYXBTANCNFSM4JP53TMQ .

YTLogos commented 4 years ago

Hi @yanhaidong1 , Yes, I have found my input sequence have X. Thanks for your help!