Hi all,
Firstly, apologies if this is a daft/duplicated question - I am very new to this forum and data analysis using R in general.
I am trying to analyse some gene panel data using the cn.mops package in R using the code provided under Section 6 of the package vignette ("Exome sequencing data"). The first part of the code seems to work with no errors:
> BAMfiles <-c("~/Alignments/Filename.bam","~/Alignments/Filename2.bam","~/Alignments/Filename3.bam","~/Alignments/Filename4.bam","~/Alignments/Filename5.bam","~/Alignments/Filename6.bam","~/Alignments/Filename7.bam")
> segments <- read.table("~/Alignments/NeuroMetabolicCodingExons.bed",sep="\t",as.is=TRUE)
> gr <- GRanges(segments[,1],IRanges(segments[,2],segments[,3]))
> X <- getSegmentReadCountsFromBAM(BAMfiles,GR=gr,mode="unpaired")
However, when I then enter the following command as instructed:
> resCNMOPS <- exomecn.mops(X)
It comes up with the following error:
Normalizing...
Error in if (n > 512) n <- 2^ceiling(log2(n)) :
missing value where TRUE/FALSE needed
In addition: Warning message:
In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu) :
There exists a reference sequence with zero reads for some samples.
If anyone could enlighten me as to what this error means/how to fix it I would be eternally grateful.
Many thanks.
Hello,
Sorry for the inconveniences with the package. Indeed, the problem comes from chromosomes that have predominantly zeros in the read count matrix. Typically the median read count is used to calculate normalization factors...
I am now catching this case and I am returning an error message saying that people should remove this samples or chromosomes (usually, chromosome "Y").
For copy number detection on chromosomes X and Y, I suggest to run cn.mops separately for males an females. Please do not hesitate to contact me, if you encounter problems with the package.
The updated version should be on Bioconductor in a few days.
Regards,
Günter Klambauer
Thanks for updating the package!
I am sorry but it still gives the same error. The worst thing is that you have to make all the calculations again after trying to exclude some scaffolods with near zero alignments. Could you make it to write error log and automatically exclude bad chromosomes while working on all others without stopping?
Thank you very much!