Write Python Program Converts Input File Fasta Format Called Fastatxt Output File Phylip F Q37028847

Write a Python program that converts an input file inFASTA format, called “fasta.txt”, to an output file in PHYLIPformat called “phylip.txt”. For example if the input filecontains:
>human
ACCGTTATAC
CGATCTCGCA
>chimp
ACGGTTATAC
CGTACGATCG
>monkey
ACCTCTATAC
CGATCGATCC
>gorilla
ATCTATATAC
CGATCGATCG
Then the output file should be
human ACCGTTATACCGATCTCGCA
chimp ACGGTTATACCGTACGATCG
monkey ACCTCTATACCGATCGATCC
gorilla ATCTATATACCGATCGATCG
FASTA format has a description (indicated with a ‘>’) followedby 1 or more lines of a DNA sequence. PHYLIP format has adescription followed by a single line of a DNA sequence and eachsequence is the same length. For this homework, the input file willhave an arbitrary number of sequences of arbitrary, but identical,length.


Solution


NOTE: I have completed answer for your question. Please checkand

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.