This is a test version of Biostars. For the public version, visit https://www.biostars.org.
In R: Is There A Prior Code/Library Which Can Classify Variations As Indels?

I have a VCF file for one gene which has about 1000 variants. Some of those are SNPs, but others are indels.

e.g., when REF is C and ALT is CT then it is an insertion.

I could write my code for that but I would prefer some library in R (or other language) which could do that. Is there such library?

r vcf

1 answer

perl one liner:

perl -lane 'print if (m/^#/ or ($F[3] =~ m/[ACGT]{1,1}/ and $F[4] =~ m/[ACGT]{1,1}/))' < file.vcf > output.vcf

Log in to answer this question.