I have a long list of sequences and I want to convert this list to a fasta file. How do I add > and a unique identifier to each line?
thanks!
I have a long list of sequences and I want to convert this list to a fasta file. How do I add > and a unique identifier to each line?
thanks!
Awk is a possibility. Assuming one sequence per line in a file called sequencefile.txt:
awk '{print ">" NR; print $0}' sequencefile.txt
NR is the line number, so it will be unique relative to the sequences in sequencefile.txt.
With Biopieces www.biopieces.org) you do:
read_tab -i in.tab -k SEQ | add_ident -k SEQ_NAME | write_fasta -o out.fasta -x
More info here: add_ident
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
You can accept this as the answer by clicking on the checkmark just under the votes.
"assuming" is the grandma' of Satan :o)
worked great, thanks!