This is a test version of Biostars. For the public version, visit https://www.biostars.org.
tab to fasta file conversion

can someone kindly help me out how to convert tab delimited protein file (ID in one column and sequence in second column) into fasta file ?? any simple solution plz

thanks

rna-seq

Try something-there are multiple solutions. If you get stuck, post your efforts and errors.

some example data?

Something like

protein1      AGCHCGCGAC
protein2      GAGCSFATHCK

it is easy to make, using for example the interface galaxy, this function is present here

2 answers

I think you could do this with awk, give this a try:

awk '{print ">"$1"\n"$2}' tab.tsv > seqs.fa

Let me know if that works for you!

Dennis

edit: $1 is your name column and $2 is your sequence column, so switch those if the order is sequence, name.

if first column doesn't have >:

awk -v OFS="\n" '{print ">"$1,$2}' test.txt
sed -e 's/^/>/;s/\t/\n/g' test.txt 
parallel  --colsep '\t'  echo -e '\>{1}\\n{2}'  :::: test.txt

Log in to answer this question.