#Alignments and output data unaligned_DNA = LoadSeqs(data=curated_protein_list, moltype=DNA, aligned=False) unaligned_AA = unaligned_DNA.getTranslation() #Generate alignments using muscle aligned_AA = mafft_align_unaligned_seqs(unaligned_AA, PROTEIN) #Replace the aminoacid sequences with the nucleotide sequence aligned_DNA = aligned_AA.replaceSeqs(unaligned_DNA) #Make protein trees using FastTree protein_tree = build_tree_fasttree(aligned_AA, PROTEIN) protein_tree_output = open( protein_tree_folder + "/" + cluster + ".tre", 'w') protein_tree_output.write(protein_tree.getNewick(with_distances=True)) protein_tree_output.close() #Make nucleotide trees using FastTree nucleotide_tree = build_tree_fasttree(aligned_DNA, DNA) nucleotide_tree_output = open(dna_tree_folder + "/" + cluster + ".tre", 'w') nucleotide_tree_output.write( nucleotide_tree.getNewick(with_distances=True)) nucleotide_tree_output.close() #Write the unaligned and aligned sequences unaligned_DNA.writeToFile(dna_unaligned_folder + "/" + cluster +
continue #Alignments and output data unaligned_DNA = LoadSeqs(data=curated_protein_list, moltype=DNA, aligned=False) unaligned_AA = unaligned_DNA.getTranslation() #Generate alignments using muscle aligned_AA = mafft_align_unaligned_seqs(unaligned_AA, PROTEIN) #Replace the aminoacid sequences with the nucleotide sequence aligned_DNA = aligned_AA.replaceSeqs(unaligned_DNA) #Make protein trees using FastTree protein_tree = build_tree_fasttree(aligned_AA, PROTEIN) #Tree file tree_output = open(tree_folder + "/" + cluster + ".tre", 'w') tree_output.write(protein_tree.getNewick(with_distances=True)) #Write the unaligned and aligned sequences unaligned_DNA.writeToFile(dna_unaligned_folder + "/" + cluster + ".fna", format="fasta") unaligned_AA.writeToFile(protein_unaligned_folder + "/" + cluster + ".faa", format="fasta") aligned_DNA.writeToFile(dna_aligned_folder + "/" + cluster + ".fna", format="fasta") aligned_AA.writeToFile(protein_alignment_folder + "/" + cluster + ".faa", format="fasta") tree_output.close() #Print log files
#Alignments and output data unaligned_DNA = LoadSeqs(data=curated_protein_list, moltype=DNA, aligned=False) unaligned_AA = unaligned_DNA.getTranslation() #Generate alignments using muscle aligned_AA = mafft_align_unaligned_seqs(unaligned_AA, PROTEIN) #Replace the aminoacid sequences with the nucleotide sequence aligned_DNA = aligned_AA.replaceSeqs(unaligned_DNA) #Make protein trees using FastTree protein_tree = build_tree_fasttree(aligned_AA, PROTEIN) #Tree file tree_output = open(tree_folder + "/" + cluster + ".tre", 'w') tree_output.write(protein_tree.getNewick(with_distances=True)) #Write the unaligned and aligned sequences unaligned_DNA.writeToFile(dna_unaligned_folder + "/" + cluster + ".fna", format="fasta") unaligned_AA.writeToFile(protein_unaligned_folder + "/" + cluster + ".faa", format="fasta") aligned_DNA.writeToFile(dna_aligned_folder + "/" + cluster + ".fna", format="fasta")
continue #Alignments and output data unaligned_DNA = LoadSeqs(data=curated_protein_list, moltype=DNA, aligned=False) unaligned_AA = unaligned_DNA.getTranslation() #Generate alignments using muscle aligned_AA = mafft_align_unaligned_seqs(unaligned_AA, PROTEIN) #Replace the aminoacid sequences with the nucleotide sequence aligned_DNA = aligned_AA.replaceSeqs(unaligned_DNA) #Make protein trees using FastTree protein_tree = build_tree_fasttree(aligned_AA, PROTEIN) protein_tree_output = open(protein_tree_folder + "/" + cluster + ".tre", 'w') protein_tree_output.write(protein_tree.getNewick(with_distances=True)) protein_tree_output.close() #Make nucleotide trees using FastTree nucleotide_tree = build_tree_fasttree(aligned_DNA, DNA) nucleotide_tree_output = open(dna_tree_folder + "/" + cluster + ".tre", 'w') nucleotide_tree_output.write(nucleotide_tree.getNewick(with_distances=True)) nucleotide_tree_output.close() #Write the unaligned and aligned sequences unaligned_DNA.writeToFile(dna_unaligned_folder + "/" + cluster + ".fna", format="fasta") unaligned_AA.writeToFile(protein_unaligned_folder + "/" + cluster + ".faa", format="fasta") aligned_DNA.writeToFile(dna_aligned_folder + "/" + cluster + ".fna", format="fasta")