Dear Günter,
Rencently, I am trying to analyze plant genome CNVs across multiple samples, and notice that your cn.MOPS is very suitable for this. We focused on a de novo plant genome, which has many scaffolds (with no chromosome-level sequences). Unfortunately we got some error message when running it.
What we did is as follows:
The first part of the code is loading library:
options(width=75)
set.seed(0)
library(Biobase)
library(GenomicRanges)
library(GenomeInfoDb)
library(cn.mops)
The second part of the code is loading data, which seems to work fine with no error report:
BAMFiles <- list.files(pattern=".bam$")
bamDataRanges <- getReadCountsFromBAM(BAMFiles,mode="paired",refSeqName="scaffolds_0",WL=2000)
bamdata <- as.data.frame(bamDataRanges)
The third part is caculating the different depth of CNV regions. This works fine for some scaffolds:
res <- cn.mops(bamDataRanges,I = c(0.025, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4),classes = c("CN0", "CN1", "CN2", "CN3", "CN4", "CN5", "CN6", "CN7", "CN8"))
data(cn.mops)
ls()
result <- calcIntegerCopyNumbers(res)
segm <- as.data.frame(segmentation(result))
CNVs <- as.data.frame(cnvs(result))
CNVRegions <- as.data.frame(cnvr(result))
write.table(segm,file="segmentation.tbl",sep="\t")
write.table(CNVs,file="cnvs.tbl",sep="\t")
write.table(CNVRegions,file="cnvr.tbl",sep="\t")
write.table(bamdata,file="bamdata.tbl",sep="\t")
But, when I change "refSeqName" and call cn.mops function:
bamDataRanges <- getReadCountsFromBAM(BAMFiles,mode="paired",refSeqName="scaffolds_133",WL=2000)
bamdata <- as.data.frame(bamDataRanges)
res <- cn.mops(bamDataRanges,I = c(0.025, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4),classes = c("CN0", "CN1", "CN2", "CN3", "CN4", "CN5", "CN6", "CN7", "CN8"))
it comes up with the following error message:
Normalizing...
Starting local modeling, please be patient...
Reference sequence: scaffolds_133
Starting segmentation algorithm...
Using "fastseg" for segmentation.
No CNVs detected. Try changing "normalization", "priorImpact" or "thresholds".
I have tried to change the parameter of "norm", "priorImpact", "segAlgorithm", "lowerThreshold" or "upperThreshold". Sometime it works, and sometime it doesn't.
Could you please give us some suggestion for this? Any comments will be very much appreciated.
Best Regards
Ponyo