This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Reomve the first occurance of overalapping variants from VCF file

Are there any tools where I could keep the first occurrence of overlapping variants from a VCF file while removing the rest?

example:

#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG002
NC_000001.11    604358  TEST_REMOVE_OVERLAPPING_VARIANTS    CAGA    C   .   PASS    .   GT  1/1
NC_000001.11    604361  TEST_REMOVE_OVERLAPPING_VARIANTS    AAGT    A   .   PASS    .   GT  1/1

output:

#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG002
NC_000001.11    604358  TEST_REMOVE_OVERLAPPING_VARIANTS    CAGA    C   .   PASS    .   GT  1/1
vcf vcftools

A hint

I don't know what is overlap variant but if you want keep first occurrence a row by first column (in any tab delimited file) you can use:

sort -u -k1,1 yourfile

That would just keep one variant per chromosome.

Oh... I think it's a little more complicated! Can you explain the problem?

0 answers

No answers yet.

Log in to answer this question.