How to make consensus sequences for a list?
0
0
Entering edit mode
4.4 years ago
adrian18_07 ▴ 10

I have a sequence list, it looks like this:

[['CATGCCCGACAGAGCGACCCGCGAACACGTTACAAACACTACGCGGGGTGGCCCCGGCTGCCTCGCGCGGAGGTGCTGCGGCTGAGTGCGCAAACTAGCTGCGCGCACGCTGTCCGTGCCACCTCCACTAACAGAACCCCGGCGCGGACTGCGCCAAGGAATAAAAAACGAATGAGAGCGAGCGCGCCCCCCTCGCCCCGGAGACGGTGCGCGATGGTGTGTGCCTCGCTGTCCATTGATAAACTAAACGACTCTCGGCAACGGATATCTCGGCTCTCGCATCGATGAARAACGTAGCGAAATGCGATACTTGGTGTGAATTGCARAATCCCGTGAATCATCGAGTCTTTGAACGCAAGTTGCGCCCGAAGCCTTCTGGCCGAGGGCACGTCTGCCTGGGTGTCACGCAACGTCGCCGCCAACCCCACCCCTAGGGGCGGGAAGTTGGGGGCGGACTCTGGCCTCCCGTGCGCCTCGGCGCGCGGATGGCCTAAATTTCAGCTCCTGGCGAGGATCGCCACGACAAGCGGTGGTTTTTTGAACTAAGGACCTCGGGTGTTGTCGTGCGGCCTCCCGGAGGGAACGGACCCTGTGCGCTCGCGCACCATCCTATCGAGACCCCAGGTCAGTCGG', 'CATGCCCGACAGAGCGACCCGCGAACACGTTACAAACACTACGCGGGGTGGCCCCGGCTGCCTCGCGCGGAGGTGCTGCGGCTGAGTGCGCAAACTAGCTGCGCGCACGCTGTCCGTGCCACCTCCACTAACAGAACCCCGGCGCGGACTGCGCCAAGGAATAAAAAACGAATGAGAGCGAGCGCGCCCCCCTCGCCCCGGAGACGGTGCGCGATGGTGTGTGCCTCGCTGTCCATTGATAAACTAAACGACTCTCGGCAACGGATATCTCGGCTCTCGCATCGATGAAGAACGTAGCGAAATGCGATACTTGGTGTGAATTGCAGAATCCCGTGAATCATCGAGTCTTTGAACGCAAGTTGCGCCCGAAGCCTTCTGGCCGAGGGCACGTCTGCCTGGGTGTCACGCAACGTCGCCGCCAACCCCACCCCTAGGGGCGGGAAGTTGGGGGCGGACTCTGGCCTCCCGTGCGCCTCGGCGCGCGGATGGCCTAAATTTCAGCTCCTGGCGAGGATCGCCACGACAAGCGGTGGTTTTTTGAACTAAGGACCTCGGGTGTTGTCGTGCGGCCTCCCGGAGGGAACGGACCCTGTGCGCTCGCGCACCATCCTATCGAGACCCCAGGTCAGTYAG'], ['CATGCCCGACAGAGCGACCCGCGAACACGTTACAAACACTACGCGGGGTGGCCCCGGCTGCCTCGCGCGGAGGTGCTGCGGCTGAGTGCGCAAACTAGCTGCGCGCACGCTGTCCGTGCCACCTCCACTAACAGAACCCCGGCGCGGACTGCGCCAAGGAATAAAAAACGAATGAGAGCGAGCGCGCCCCCCTCGCCCCGGAGACGGTGCGCGATGGTGTGTGCCTCGCTGTCCATTGATAAACTAAACGACTCTCGGCAACGGATATCTCGGCTCTCGCATCGATGAARAACGTAGCGAAATGCGATACTTGGTGTGAATTGCARAATCCCGTGAATCATCGAGTCTTTGAACGCAAGTTGCGCCCGAAGCCTTCTGGCCGAGGGCACGTCTGCCTGGGTGTCACGCAACGTCGCCGCCAACCCCACCCCTAGGGGCGGGAAGTTGGGGGCGGACTCTGGCCTCCCGTGCGCCTCGGCGCGCGRATGGCCTAAWTTTCAGCTCCTGGCGAGGATCGCCACGACAAGCGGTGGTTTTTTGAACTAAGGACCTCGGGTGTTGTCGTGCGGCCTCCCGGAGGGAACGGACCCTGTGCGCTCGCGCACCATCCTATCGAGACCCCA', 'CATGCCCGACAGAGCGACCCGCGAACACGTTACAAACACTACGCGGGGTGGCCCCGGCTGCCTCGCGCGGAGGTGCTGCGGCTGAGTGCGCAAACTAGCTGCGCGCACGCTGTCCGTGCCACCTCCACTAACAGAACCCCGGCGCGGAYTGCGCCAAGGAATAAAAAACGAATGAGAGCGAGCGCGCCCCCCTCGCCCCGGAGACGGTGCGCGATGGTGTGTGCCTCGCTGTCCATTGATAAACTAAACGACTCTCGGCAACGGATATCTCGGCTCTCGCATCGATGAAGAACGTAGCGAAATGCGATACTTGGTGTGAATTGCAGAATCCCGTGAATCATCGAGTCTTTGAACGCAAGTTGCGCCCGAAGCCTTCTGGCCGAGGGCACGTCTGCCTGGGTGTCACGCAACGTCGCCGCCAACCCCACCCCTAGGGGCGGGAAGTTGGGGGCGGACTCTGGCCTCCCGTGCGCCTCGGCGCGCGGATGGCCTAAATTTCAGCTCCTGGCGAGGATCGCCACGACAAGCGGTGGTTTTTTGAACTAAGGACCTCGGGTGTTGTCGTGCGGCCTCCCGGAGGGAACGGACCCTGTGCGCTCGCGCACCATCCTATCGAGACCCCA']]

I would like to receive consensus sequences in turn for each sub-list. I tried this way:

from Bio.Align import AlignInfo
for z, _ in enumerate(pp):
    summary_align = AlignInfo.SummaryInfo(pp[z])
    consensus = summary_align.dumb_consensus()
    print(consensus)

But I get the error:

 File "C:\...", line 93, in <module>
consensus = summary_align.dumb_consensus()

 File "C:\...", line 77, in dumb_consensus
con_len = self.alignment.get_alignment_length()

AttributeError: 'list' object has no attribute 'get_alignment_length'

Thanks for any answer.

consensus biopython • 1.4k views
ADD COMMENT
0
Entering edit mode

How do you propose to define a consensus between 2 sequences? There is no way to decide which residue should be chosen.

Please also go back and accept answers on your previous questions if they have resolved the problem for you, e.g.:

ADD REPLY
0
Entering edit mode

In addition to my other comment, its not clear what pp is in this case,or why you need to use enumerate to access elements of it instead of just iterating the object itself?

I suspect you aren't passing the object you think you are which is why its failing to find the .get_alignment_length() method.

ADD REPLY

Login before adding your answer.

Traffic: 1759 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6