This is a test version of Biostars. For the public version, visit https://www.biostars.org.
index tabulate file to get chrom, pos, ref, alt

Hi,

Is there some tool that allows extracting positions based on 4 columns, not based on 2 columns? Like in tabix, to get coordinates like

chrom=10 pos=1001 ref=A alt=G

I need to firstly exectue:

tabix myTabFile.gz 10:1000-1001

and then I need to iterate and parse the results.

Is there some tool so I could extract the data directly? like

someTools myTabFile.gz 10:1001:G:A

??

Yes, I'm interested in parsing VCF files or some big tables that have columns chrom, pos, ref, alt (like dbNSFP).

Thanks!

tabix coordinates variants indexing

1 answer

pipe into awk according to your input syntax. Something like

tabix myTabFile.gz 10:1000-1001 | awk '($3=="A" && $4=="G")'

yeah, but this is still "some parsing" (I use python, pysam... subprocess would be additonal overhead). Hmmm... I'll try to format a file like:

chrom_ref_alt pos the rest of anns

like

10_A_G 1001 DP RD AF
10_T_C 1002 DP RD AF

and then to use tabix...

Log in to answer this question.