[Bioc-devel] VariantAnnotation: writeVcf fails if sample names not ordered

Julian Gehring julian.gehring at embl.de
Wed Feb 5 10:21:55 CET 2014


Hi,

I'm not sure whether this is related to the other bug.  Anyway, 
'writeVcf' fails if the sample names of a 'VRanges' object are not 
sorted in ascending order (in the latest bioc-devel):

#+BEGIN_SRC R
   library(VariantAnnotation)

   vr = VRanges(1:2, IRanges(100:101, 200:201),
       ref = c("G", "G"), alt = c("A", "T"))

   sampleNames(vr) = factor(c("1", "2"))
   writeVcf(vr, tempfile())  ## works, also for "A"/"B", etc

   sampleNames(vr) = factor(c("2", "1"))
   writeVcf(vr, tempfile())  ## fails, also for "B"/"A", etc.
   ## convertion to VCF itself works
   vcf = as(vr, "VCF")
   writeVcf(vcf, tempfile())  ## fails
#+END_SRC

with the error:

Error in relist(genoMatFlat, PartitioningByEnd(genoMat)) :
   shape of 'skeleton' is not compatible with 'NROW(flesh)'

In bioc-release (VariantAnnotation_1.8.10), it fails irrespective of the 
sample name order:

#+BEGIN_SRC R
   library(VariantAnnotation)

   vr = VRanges(1:2, IRanges(100:101, 200:201),
       ref = c("G", "G"), alt = c("A", "T"))

   sampleNames(vr) = factor(c("1", "2"))
   writeVcf(vr, tempfile())  ## fails
#+END_SRC

with

Error in writeVcf(as(obj, "VCF"), filename, ...) :
   error in evaluating the argument 'obj' in selecting a method for 
function 'writeVcf': Error in listClassName("Compressed", class(x)) :
   Could not find a 'CompressedList' subclass for values of type 
'CompressedRleListRleListCompressedAtomicListAtomicListCompressedListListVectorAnnotated'


Please let me know if I can help.

Best wishes
Julian



More information about the Bioc-devel mailing list