I'm using Varscan2 to find CNV on cancer exomes. In the recommended workflow suggested by Varscan2 there is this code to apply the segmentation:
library(DNAcopy)
cn <- read.table("your.cn.file",header=F)
CNA.object <-CNA( genomdat = cn[,6], chrom = cn[,1], maploc = cn[,2], data.type = 'logratio')
CNA.smoothed <- smooth.CNA(CNA.object)
segs <- segment(CNA.smoothed, verbose=0, min.width=2)
segs2 = segs$output
write.table(segs2[,2:6], file="out.file", row.names=F, col.names=F, quote=F, sep="\t")
I think there is a mistake in the field genomedat=cn[,6]. It should be the field 7 of the copynumber file made by Varscan. Am I right? Thanks in advance
2 answers
To answer the original question, yes, you're right! The "genomdat" variable should be set to the field with the log2-based copy number value, so if that's in column 7, please use it.
At first, this is more a Bioconductor related question (although you might also get solutions here). You can post your question at the Bioconductor mailing list. Second, why do you think there is a mistake, is there an error message? Third, if you ask help about R/Bioconductor errors it is helpful to post the output of
sessionInfo()
and
traceback()
Then, if you are right that the problem is in the genomedat=cn[,6] it is helpful to give more information about cn[,6] for example
str(cn[,6])
head(cn[,6])
cn[,6] should be a vector or matrix where each row is a genomic marker (for example "probe") and each column is a sample. Obviously the values in the matrix should be copy number estimates
At last, I would recommend to use fastseg in stead of DNAcopy because it is much faster. Especially when you have multiple samples and many genomic markers this becomes more important
Log in to answer this question.