Entering edit mode
I have output from variant caller Strelka2, which puts SNVs and indels into separate files. I am not able to combine them using rbind
> class(snv)
[1] "CollapsedVCF"
attr(,"package")
[1] "VariantAnnotation"
> class(ind)
[1] "CollapsedVCF"
attr(,"package")
[1] "VariantAnnotation"
> colnames(snv)
[1] "NORMAL" "TUMOR"
> colnames(ind)
[1] "NORMAL" "TUMOR"
> colnames(mcols(rowRanges(snv))) == colnames(mcols(rowRanges(ind)))
[1] TRUE TRUE TRUE TRUE TRUE
> all <- rbind(snv, ind)
Error in map_x_colnames_to_object_colnames(colnames(object)) :
the DataFrame objects to rbind must have the same colnames
What other column names could be causing the error message? Perhaps the error message could be more specific.
Hi Dario,
Hard to know without having access to these objects. DataFrame objects can be nested deep in
snv
andind
so this error could originate from trying to rbind some of these deeply nested objects.Anyway, it's hard to help you without being able to reproduce the error. Reproducible example and sessionInfo() please?
Also note that even though you are showing us that
all(colnames(x) == colnames(y))
is TRUE, this doesn't necessarily mean that objectsx
andy
have the same colnames. I know I know, hard to believe... but true ;-)H.
Were you able to sort this out?
I made a request for an accessible VCF file created by Strelka2 and then got sidetracked.
But, I did notice that some of the INFO and FORMAT fields in the SNV and indel VCF files were different, which is the likely explanation for the error which I saw. I side-stepped the problem by the abundant use of
paste
andsystem
to executegatk MergeVcfs
instead ofVariantAnnotation
for this task.