Question: rbind VCF Two Objects Column Names Error
gravatar for Dario Strbenac
5 months ago by
Dario Strbenac1.5k
Dario Strbenac1.5k wrote:

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"
[1] "VariantAnnotation"
> class(ind)
[1] "CollapsedVCF"
[1] "VariantAnnotation"
> colnames(snv)
> colnames(ind)
> colnames(mcols(rowRanges(snv))) == colnames(mcols(rowRanges(ind)))
> 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.

variantannotation vcf • 150 views
ADD COMMENTlink written 5 months ago by Dario Strbenac1.5k

Hi Dario,

Hard to know without having access to these objects. DataFrame objects can be nested deep in snv and ind 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 objects x and y have the same colnames. I know I know, hard to believe... but true ;-)


ADD REPLYlink written 5 months ago by Hervé Pagès ♦♦ 14k

Were you able to sort this out?

ADD REPLYlink written 4 months ago by Hervé Pagès ♦♦ 14k

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 and system to execute gatk MergeVcfs instead of VariantAnnotation for this task.

ADD REPLYlink written 4 months ago by Dario Strbenac1.5k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 230 users visited in the last hour