Thank you for your response
• 0 views
•
link
Hello all,
I have a text file whose first column is the name of the transcript and the second column is the nucleotide sequence. My question is how to convert this text file to fasta in Linux ?
TCONS_00000128
CGTAACCTGAGGTTTATTCCGGATATGGCTCAGAGCAgtgatcattatcaaatgaGTTGTCAGCGTCAACAGTGATCTCGTTGAATTCTGGCATCCGGCAGCTGGTCTGGGGATTTCTGAAGA
TCONS_00000042
GATTGATGACCGTCGCCGAAGAGATAGTATTCCGGGTCCATTCGGCCTATACCGACGACGTTGACGGACTGGTGGCGATATAACTATCGAGGTTCCTCGTTCGAAGGTATCGGTTAT
$ seqkit -w 0 tab2fx <input.fa> -o <output.fa(.gz)>
$ awk -v OFS="\n" '{print ">"$1,$2}' test.txt
$ awk -v OFS="\n" '{$1=">"$1}1' test.txt
$ sed 's/^/>/;s/\t/\n/' test.txt
$ sed -r 's/^(.*)\t(.*)/>\1\n\2/' test.txt
$ parallel --colsep '\t' echo '\>'{1}'\\n'{2} :::: test.txt
Thank you for your complete answer
Log in to answer this question.