I am using the code below to reformat the input (hp.txt). The output (newhp.txt) is not in the desired format and I can not seem to figure it out. I have attached both. Thank you.
perl -aF/\\t/ -lne 'print join(" ",@F[0,1,2,$_,5]) for ("0 A","0 G","0 C","0 T","A 0","G 0","C 0","T 0")' hp.txt > newhp.txt
So in hp.txt the file looks like:
2 39224622 3922462 - T intron_7homopolymer
3 12632440 12632440 - C CDS_4homopolymer
Desired Output of newhp.txt
2 39224622 39224622 0 A intron_7homopolymer
2 39224622 39224622 0 T intron_7homopolymer
2 39224622 39224622 0 C intron_7homopolymer
2 39224622 39224622 0 G intron_7homopolymer
2 39224622 39224622 A 0 intron_7homopolymer
2 39224622 39224622 T 0 intron_7homopolymer
2 39224622 39224622 C 0 intron_7homopolymer
2 39224622 39224622 G 0 intron_7homopolymer
3 12632440 12632440 0 A CDS_4homopolymer
3 12632440 12632440 0 T CDS_4homopolymer
3 12632440 12632440 0 C CDS_4homopolymer
3 12632440 12632440 0 G CDS_4homopolymer
3 12632440 12632440 A 0 CDS_4homopolymer
3 12632440 12632440 T 0 CDS_4homopolymer
3 12632440 12632440 C 0 CDS_4homopolymer
3 12632440 12632440 G 0 CDS_4homopolymer