AttributeError: 'str' object has no attribute 'to_fasta'
when running
deblur multiple-seq-alignment
This error stems from the multiple_sequence_alignment returning string containing the path to created .msa file and not the Sequence object.
Two changes have been made to fix this issue:
1) optional output_fp argument has been added to multiple_sequence_alignment. To avoid breaking the existing code, if output_fp is not provided, then behavior does not change. If output_fp is provided, then msa_fp gets assigned to output_fp, resulting in the creation of multiple sequence alignment file in a path specified by output_fp.
2) In the multiple_seq_alignment function additional argument output_fp=output_fp is passed to multiple_sequence_alignment; since this already results in the creation of the requested msa file, the problematic code:
with open(output_fp, 'w') as f:
f.write(alignment.to_fasta())
Deblur throws the following error:
when running
This error stems from the multiple_sequence_alignment returning string containing the path to created .msa file and not the Sequence object. Two changes have been made to fix this issue: 1) optional output_fp argument has been added to multiple_sequence_alignment. To avoid breaking the existing code, if output_fp is not provided, then behavior does not change. If output_fp is provided, then msa_fp gets assigned to output_fp, resulting in the creation of multiple sequence alignment file in a path specified by output_fp. 2) In the multiple_seq_alignment function additional argument output_fp=output_fp is passed to multiple_sequence_alignment; since this already results in the creation of the requested msa file, the problematic code:
can be removed.