Hello all!! I need help converting tab to fasta... I am a newbie and know only a little bash scripting. I need to convert a tab delimited SNP file into either a single fasta file or a multiple fasta files for each column using the first line as identifier.
The closest I got was a script that generates the required .fasta files but enters a loop and can only be stopped by ctrl-C.
#!/bin/bash
echo ">" > carat.txt
counter=1
#My tab file has 64 columns
while : [ $counter -lt 64]
do
less <SNP.txt |awk "{print$"$counter"}"| cat carat.txt - >$counter.fa
counter=$(($counter +1))
done
exit
SNP_001 SNP_002 SNP_003....
T T T T
C C C C
C C C C
C C C C
A A A A
A A A A
T T T T
T T T T
C C C C
G G G G
G G G G
C C C C
The closest I got was a script that generates the required .fasta files but enters a loop and can only be stopped by ctrl-C.
#!/bin/bash
echo ">" > carat.txt
counter=1
#My tab file has 64 columns
while : [ $counter -lt 64]
do
less <SNP.txt |awk "{print$"$counter"}"| cat carat.txt - >$counter.fa
counter=$(($counter +1))
done
exit
SNP_001 SNP_002 SNP_003....
T T T T
C C C C
C C C C
C C C C
A A A A
A A A A
T T T T
T T T T
C C C C
G G G G
G G G G
C C C C
Comment