[VariantAnnotation] Unable to set a genotype with geno()
1
0
Entering edit mode
@delphinecharif-10744
Last seen 11 weeks ago
France

Hi everyone,

I get this error message when i try to set a genotype to a VCF object:

> geno(object@VCF)

List of length 0

> SimpleList(GT=GenotypeAsMatrix,GL=GenotypeLikAsMatrix)

List of length 2

names(2): GT GL

> geno(object@VCF) <- SimpleList(GT=GenotypeAsMatrix,GL=GenotypeLikAsMatrix)

Error in `assays<-`(`*tmp*`, value = <S4 object of class "SimpleList">) : 

  current and replacement dimnames() differ

> traceback()

5: stop("current and replacement dimnames() differ")

4: `assays<-`(`*tmp*`, value = <S4 object of class "SimpleList">)

3: `assays<-`(`*tmp*`, value = <S4 object of class "SimpleList">)

2: `geno<-`(`*tmp*`, value = <S4 object of class "SimpleList">)

1: `geno<-`(`*tmp*`, value = <S4 object of class "SimpleList">)

> sessionInfo()

R version 3.2.5 (2016-04-14)

Platform: x86_64-pc-linux-gnu (64-bit)

Running under: Ubuntu precise (12.04.5 LTS)

 

Does somebody have an idea ?

Thanks

 

variantannotation • 954 views
ADD COMMENT
0
Entering edit mode
shepherl 4.0k
@lshep
Last seen 15 hours ago
United States

The dimnames in the SimpleList matrices should match the dimnames of the VCF object.  For example, from the help page ?geno 

library(VariantAnnotation)
fl <- system.file("extdata", "ex2.vcf", 
                          package="VariantAnnotation")
vcf <- readVcf(fl, genome="hg19")
dimnames(vcf)
dimnames(geno(vcf)[["GT"]]) = list(LETTERS[1:5], letters[1:3])

This generates the error you have experienced because it is trying to rename dimnames(geno(vcf)[["GT"]]) to something other than the dimnames(vcf) 

 

 

 

 

ADD COMMENT

Login before adding your answer.

Traffic: 500 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6