I am trying to get a consensus sequence from my multiple alignments files (fasta format).
I have a few fasta files each containing multiple sequence alignments. When I try to run this function below I get an AttributeError: 'generator' object has no attribute 'get_alignment_length'.
I haven't been able to find any code examples for this using AlignIO.parse, I only saw examples using AlignIO.read.
def get_consensus_seq(filename):
alignments = (AlignIO.parse(filename,"fasta"))
summary_align = AlignInfo.SummaryInfo(alignments)
consensus_seq = summary_align.dumb_consensus(0.7,"N")
print(consensus_seq)