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.
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.
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.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
"Title" refers to a title for your question, not your job title.
added the correct title
please, take the time to write a correct title for your question. Also, show us what you tried.