No need to chomp ;)
perl -e 'while(<>){print ">",$_,$_}' input.txt
• 6 views
•
link
I have a document that one sequence one row.I want to get the fasta format and the name is the sequence.
aaaacccc
aaccctttt
aatgtgtgt
gggg
The result should be this
>aaaacccc
aaaacccc
>aaccctttt
aaccctttt
>aatgtgtgt
aatgtgtgt
>gggg
gggg
awk '{print ">"$0"\n"$0}' document
perl -e 'while(<>){chomp; print ">$_\n$_\n";}' inputfile.txt
No need to chomp ;)
perl -e 'while(<>){print ">",$_,$_}' input.txt
The python version:
import sys
for line in open(sys.argv[1]):
print ">"+line.strip()
print line.strip()
assuming this code is in a file named "makefasta.py", the syntax is:
python makefasta.py input.txt
Log in to answer this question.
I am trying to conceive what purpose this could ever be useful for... Anyone?