Hi, I'm using the cn.mops package to detect CNV based on the 50X WGS data of PE150. When I use 44 samples data, it goes wrong as follows:
"Error in r@normalizedData[, sampleIdx, drop = FALSE] :
subscript out of bounds
Calls: segplot -> segplot
Execution halted"
And my script is as follows:
#! /public/home/bin
library(cn.mops)
BAMFiles44 <- list.files(path="/path/to/bam/files",pattern=".bam$")
CountsreadsAllx44 <- getReadCountsFromBAM(BAMFiles44,refSeqName=c(paste0("Chr",1:10)),mode="paired",WL=100,parallel=10)
(CountsreadsAllx44)
data(cn.mops)
ls()
head(XRanges[,2:5])
resCNMOPSAllx44 <- cn.mops(XRanges,parallel=10)
resCNMOPSAllx44 <- calcIntegerCopyNumbers(resCNMOPSAllx44)
head(X[,2:5])
resCNMOPSXAllx44 <- cn.mops(X,parallel=10)
resCNMOPSXAllx44 <- calcIntegerCopyNumbers(resCNMOPSXAllx44)
all(individualCall(resCNMOPSXAllx44)==individualCall(resCNMOPSAllx44))
(resCNMOPSAllx44)
cnvs(resCNMOPSAllx44)[1:5]
cnvr(resCNMOPSAllx44)[1,1:5]
(CNVRanges[15,1:5])
ranges(cnvr(resCNMOPSAllx44))[1:2]
ranges(cnvr(resCNMOPSAllx44)) %over% ranges(CNVRanges)
segplot(resCNMOPSAllx44,sampleIdx=1)
segplot(resCNMOPSAllx44,sampleIdx=2)
segplot(resCNMOPSAllx44,sampleIdx=3)
segplot(resCNMOPSAllx44,sampleIdx=4)
......
segplot(resCNMOPSAllx44,sampleIdx=44)
plot(resCNMOPSAllx44,which=1)
data(cn.mops)
resultAllx44 <- calcIntegerCopyNumbers(cn.mops(CountsreadsAllx44))
segmAllx44 <- as.data.frame(segmentation(resultAllx44))
CNVsAllx44 <- as.data.frame(cnvs(resultAllx44))
CNVRegionsAllx44 <- as.data.frame(cnvr(resultAllx44))
write.csv(segmAllx44,file="segmentationAllx44.csv")
write.csv(CNVsAllx44,file="cnvsAllx44.csv")
write.csv(CNVRegionsAllx44,file="cnvrAllx44.csv")
dev.off()
I want to know if there are any wrongs in my script and how to solve this problem. I'm looking forward to your reply. Thanks very much!
Best wishes,
Fengli Zhao