covert pandas dataframe into fasta file
How to covert pandas dataframe into fasta file with python script?
I have data in pandas data frame as which contains below data.
I want to store above "df" dataframe content to fasta file.
• 3,801 views
•
link
1 answer
The FASTA format is very loosely defined - all it needs is a single line header with a ">" and sequence in the next line. You can join/concatenate all fields except sequence using a delimiter (say _ or __ or even blank space but I recommend using a non-blank-space delimiter). Append this concatenated string to > and print it, then print sequence in the next line. Rinse and repeat.
I've outlined the approach for you, writing the code should be trivial.
• 0 views
•
link
Log in to answer this question.
please, take the time to write a correct title for your question. Also, show us what you tried.
"Title" refers to a title for your question, not your job title.
added the correct title