I'm working on extracting somatic signatures from a group of tumor data. I was able to do this with one dataset pretty easily, I just read in the vcf files and concatenated with c(). Example:
dat1 <- readVcfAsVRanges(file1.vcf, seqinfo(file1))
vr_1 <- mutationContext(dat1, ref)
dat2 <- readVcfAsVRanges(file2.vcf, seqinfo(file1))
vr_2 <- mutationContext(dat2, ref)
vr <- c(vr_1, vr_2)
I was able to build up the object "vr" iteratively, and run the analysis on that. Now I am working on a second dataset with the same approach, but I'm running into some trouble. When I try the c() command I get the error:
Error in .Method(..., deparse.level = deparse.level) : number of columns of matrices must match (see arg 2)
So obviously theres a mismatch in the dimensions of the matrices, but I can't figure out where. The first thing I found was that one file had a single element from the Y chromosome, whereas the other did not. So
vr_1@seqinfo = 83
and
vr_2@seqinfo = 84
I tried to remove the entry from the VRange object. I also removed that entry from the original VCF file and reran. Now seqinfo matches, but I still get the same error.
Is there a simple way to determine where my mismatch is occuring? Thank you.
this was it exactly. thank you!!