rbind VCF Two Objects Column Names Error
0
0
Entering edit mode
Dario Strbenac ★ 1.5k
@dario-strbenac-5916
Last seen 2 days ago
Australia

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.

VariantAnnotation VCF • 1.2k views
ADD COMMENT
0
Entering edit mode

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 ;-)

H.

ADD REPLY
0
Entering edit mode

Were you able to sort this out?

ADD REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 739 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