This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Text Editors Doesn´T Display Fasta Or Stockholm Format Correctly

Hi, I´m trying to display correctly a fasta file but my text editors give some special formatting to it and there are some strange line breaks in the text. I have tried Textedit, Brackets, Sublime Text 2 and TextMate.

Does anybody knows of a text editor that can display the formats correctly or how to change the settings of this editors to display correctly this formats?

Thanks for the Help!

text fasta

There is a lot of information on StckOverflow and wikipedia on this line-break problem - basically each OS has its own opinion. What is your platform?

from wikipedia:

$ awk '{sub("$","\r\n"); printf("%s",$0);}' inputfile > outputfile  # UNIX to DOS  (adding CRs on Linux and BSD based OS that haven't GNU extensions)
$ awk '{gsub("\r",""); print;}' inputfile > outputfile              # DOS to UNIX  (removing CRs on Linux and BSD based OS that haven't GNU extensions)
$ sed -e 's/$/\r/' inputfile > outputfile              # UNIX to DOS  (adding CRs on Linux based OS that use GNU extensions)
$ sed -e 's/\r$//' inputfile > outputfile              # DOS  to UNIX (removing CRs on Linux based OS that use GNU extensions)
$ cat inputfile | tr -d "\r" > outputfile              # DOS  to UNIX (removing CRs using tr(1). Not Unicode compliant.)
$ perl -pe 's/\r?\n|\r/\r\n/g' inputfile > outputfile  # Convert to DOS
$ perl -pe 's/\r?\n|\r/\n/g'   inputfile > outputfile  # Convert to UNIX
$ perl -pe 's/\r?\n|\r/\r/g'   inputfile > outputfile  # Convert to old Mac

You should be able to find an option to set file type somewhere in the preferences of most editors. notepad++ is a pretty good cross platform option. or like Pavel said convert the file to your native type

0 answers

No answers yet.

Log in to answer this question.