I am trying to calculate the dN/dS ratio for a series of HIV viral sequences. I have two in this example. The first is the standard HXB-2 and the second comes from one of our samples. I managed to read in both as CodonSeqs. However, the function codonseq.cal_dn_ds throws an error that comes from one of its internal functions. I'm not sure how to track it down (I'm really an R programmer rather than a Python whiz).
Here is my code:
import Bio.codonalign as bca
C:\Users\james\Anaconda3\lib\site-packages\Bio\codonalign\__init__.py:27: BiopythonExperimentalWarning: Bio.codonalign is an experimental module which may undergo significant changes prior to its future official release.
BiopythonExperimentalWarning)
hxbcodon = bca.codonseq.CodonSeq("CAAGAAATGGAGCCAGTAGATCCTAGACTAGAGCCCTGGAAGCATCCAGGAAGTCAGCCTAAAACTGCTTGTACCAATTGCTATTGTAAAAAGTGTTGCTTTCATTGCCAAGTTTGTTTCATAACAAAAGCCTTAGGCATCTCCTATGGCAGGAAGAAGCGGAGACAGCGACGAAGAGCTCATCAGAACAGTCAGACTCATCAAGCTTCTCTATCAAAGCAGTAA")
aalcodon = bca.codonseq.CodonSeq("CAAGAAATGGAGCCAGTAGATCCTAGACTAGAGCCCTGGCAGCATCCAGGGAGTCAGCCTAAGACTCCCTGTAACAATTGCTATTGTAAAAAATGTTGCTATCATTGCCAAATGTGTTTCACAACAAAAGGCTTAGGCATCTCCTATGGCAGGAAGAAGCGGAGACAGCGACGAAGACCTCCTAAGGACAGTCAGCATCATCAAGTTTCTCTATCAAAGCAGTAA")
res_aal = bca.codonseq.cal_dn_ds(hxbcodon, aalcodon, method = "NG86")
Traceback (most recent call last):
File "<ipython-input-4-98365f54275b>", line 1, in <module>
res_aal = bca.codonseq.cal_dn_ds(hxbcodon, aalcodon, method = "NG86")
File "C:\Users\james\Anaconda3\lib\site-packages\Bio\codonalign\codonseq.py", line 365, in cal_dn_ds
return dnds_func[method](seq1, seq2, k, codon_table)
File "C:\Users\james\Anaconda3\lib\site-packages\Bio\codonalign\codonseq.py", line 375, in _ng86
codon_table=codon_table, k=k)
File "C:\Users\james\Anaconda3\lib\site-packages\Bio\codonalign\codonseq.py", line 438, in _count_site_NG86
aa = codon_table.forward_table[codon]
Am I doing something wrong? My sequences do get a result when run through the LANL Snap program -- wrong result, but they do calculate.
From Biopython's docs and warning messages, I gather this is an experimental module. Is the error something to do with the code itself?
I appreciate any help this community can give.
Jim Hunter