Converting .txt into .fasta
2
0
Entering edit mode
3.1 years ago

I'm new to biopython and I'm just having trouble converting a .txt file into a .fasta file using biopython.

sequence • 17k views
ADD COMMENT
0
Entering edit mode

You should add a snippet of your file so users can see how it looks and which code is necessary to convert it.

ADD REPLY
1
Entering edit mode
3.1 years ago
raavi21198 ▴ 20

If possible try converting this .txt file to .fasta file using UNIX command line Use awk command
eg. awk '{ print ">"NR"\n"$0 }' yourfile.txt > yourfasta.fas

check this link for more help https://www.researchgate.net/post/How_to_convert_a_Text_File_to_a_Fasta_Format_File

You may try this or other similar methods in UNIX command line (since you r new to biopython)

ADD COMMENT
0
Entering edit mode
3.1 years ago
Mensur Dlakic ★ 27k

FASTA files are plain text files - they simply don't end in .txt for reasons of naming convention. It is likely that renaming a file or copying it into something that ends in .fas would do the trick.

If your text file is in some sequence format other than FASTA - it could be, because most of them are plain text files as well - it would help if you show the first few lines of the file and tell us what is it that you tried in BioPython that didn't work.

ADD COMMENT

Login before adding your answer.

Traffic: 2988 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6