This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to annotate position with reference

Hi,
If I have a file like:

CHR POS
1 10001
1 10002
1 10003
1 10004
1 10005
1 10006
...

How can I annotate it with reference? just like:

1 10001 A
1 10002 T
1 10003 C
1 10004 G
1 10005 A
1 10006 G
...

dna position annotate

Did you try some of these solutions?

1 answer

$ cat jeter.tsv RF01 101

RF01 102
RF01 103
RF01 104
RF01 105
RF01 106 



$ cat jeter.tsv | while read  A B; do echo -n "$A $B " && samtools faidx rotavirus_rf.fa "${A}:${B}-${B}" | grep -v '^>' ; done
RF01 101 A
RF01 102 T
RF01 103 T
RF01 104 C
RF01 105 T
RF01 106 T

Log in to answer this question.