Hello everyone,
I am trying to play with the source code for cn.mops. I inserted the following line at the beginning of the C function "cnmops", which is defined in cnmops.cpp file:
Rprintf("*** cnmops C function call ***\n");
After building the package and importing it into RStudio, I used the following script for testing:
-------------------------------
library(cn.mops) BAMFiles <- list.files(system.file("extdata", package="cn.mops"),pattern=".bam$", full.names=TRUE) bamDataRanges <- getReadCountsFromBAM(BAMFiles, sampleNames=paste("Sample",1:3), refSeqName="20", WL=100, mode="unpaired", parallel=0) res <-cn.mops(bamDataRanges, I = c(0.025, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 8, 16, 32, 64),classes = c("CN0", "CN1", "CN2", "CN3", "CN4", "CN5", "CN6", "CN7","CN8","CN16","CN32","CN64","CN128"), priorImpact = 1, cyc = 20, parallel = 0, norm = 0, normType = "poisson", sizeFactor = "mean", normQu = 0.25, quSizeFactor = 0.75, upperThreshold = 0.5, lowerThreshold = -0.9, minWidth = 3, segAlgorithm = "DNACopy", minReadCount = 5, useMedian = FALSE, returnPosterior = FALSE)
-------------------------------
what I noticed is that the function cnmops is called multiple times despite that I don't see any call to the cnmops function recursively or within a loop.
the following is the output from the R console.. I would appreciate it if I can get help for why there are multiple calls to the function.
> library(cn.mops) > BAMFiles <- list.files(system.file("extdata", package="cn.mops"),pattern=".bam$", + full.names=TRUE) > bamDataRanges <- getReadCountsFromBAM(BAMFiles, + sampleNames=paste("Sample",1:3), + refSeqName="20", + WL=100, + mode="unpaired", + parallel=0) Identified the following reference sequences: 20 Using 20 as reference. Using indexed BAM files. Reading file: /home/alkhamis/R/x86_64-pc-linux-gnu-library/3.3/cn.mops/extdata/test1.bam 20 Reading file: /home/alkhamis/R/x86_64-pc-linux-gnu-library/3.3/cn.mops/extdata/test2.bam 20 Reading file: /home/alkhamis/R/x86_64-pc-linux-gnu-library/3.3/cn.mops/extdata/test3.bam 20 > > res <-cn.mops(bamDataRanges, I = c(0.025, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 8, 16, 32, 64), + classes = c("CN0", "CN1", "CN2", "CN3", "CN4", "CN5", "CN6", + "CN7","CN8","CN16","CN32","CN64","CN128"), + priorImpact = 1, cyc = 20, parallel = 0, norm = 0, + normType = "poisson", sizeFactor = "mean", normQu = 0.25, + quSizeFactor = 0.75, upperThreshold = 0.5, lowerThreshold = -0.9, + minWidth = 3, segAlgorithm = "DNACopy", minReadCount = 5, + useMedian = FALSE, returnPosterior = FALSE) ***cn.mops R function call *** Starting local modeling, please be patient... Reference sequence: 20 *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** *** cnmops C function call *** Starting segmentation algorithm... Using "fastseg" for segmentation. *** segmentation call *** *** segmentation call *** *** segmentation call *** > warnings() NULL
Regards
Mohammad Alkhamis
Thank you so much Günter for your response.. that was very helpful