thanks, it also worked!
• 0 views
•
link
Hi All,
I have a SNP data genotyped with Affymatrix 6.0 Chip. Its BIM file is in 1234 format. e.g.
1 rs3094315 0 792429 3 1
1 rs11240776 0 805132 3 1
1 rs2980319 0 816985 1 4
1 rs2905036 0 832343 2 4
And I want to convert it in to AGCT format. e.g.
1 rs3094315 0 792429 C A
1 rs11240776 0 805132 C A
1 rs2980319 0 816985 A T
1 rs2905036 0 832343 G T
thanks
You could combine the unix commands tr and cut
while read L
do
echo $L | cut -d ' ' -f 1,4 | tr -d "\n"
echo -n " "
echo $L | cut -d ' ' -f 5 | tr "1234" "AGCT" | tr -d "\n"
echo -n " "
echo $L | cut -d ' ' -f 6 | tr "1234" "AGCT"
done < yourfile.txt | tr " " "\t"
thanks, it worked!
Log in to answer this question.