This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Compare Between Snp, Deletion And Insertion And Repacment Vcf Tools

My data looks like this

CHOM POS REF       ALT        ALT1    ALT2 ...
1    121  A        AA         AT        0
2    254  GCGC    GCGCG      AGCG       0
3    214   C        T         0         0

The variation system is

REF   ALT1 ALT2
A     T     NA   = SNP
AT    T          = deletion
CG    CGG        = insertion
ATT   AGAAAA         = SNP or insertion  (because the second letter in REF is T and it was changed to G)

I did this

ref <- c("A", "AT", "CG", "ATT")
alt1 <- c("T", "T", "CGG", "AT")
ref.length <- nchar(ref)
alt1.length <- nchar(alt1)
variations <- ifelse(ref.length==alt1.length, "SNP",
                     ifelse(ref.length>alt1.length, "deletion", 
                            "insertion"))

but I do not know is it correct..

 cbind(ref, alt1, variations)
    ref   alt1  variations 
A   "A"   "T"   "SNP"      
AT  "AT"  "T"   "deletion" 
CG  "CG"  "CGG" "insertion"
ATT "ATT" "AT"  "deletion" 

 My main Question how can I compare between the different types of varaition in VCF , SNP, INSERTION ,and Deletions?
snp vcf variation

I think your approach is right. You can compare the lengths of the strings to determine if it is a SNP, insertion or deletion. Be cautious with cases where alternate alleles correspond to more than one strings because the variant caller couldnt decide which string is the alternative one. All the possible strings will be shown separated by commas in such cases. For example:

(Ref) A (Alternate) AT,ATTT,ATTTTTTTT

0 answers

No answers yet.

Log in to answer this question.