Bioconductor / copy-number-analysis

Explore, compare, and evaluate Bioconductor packages related to genomic copy number analysis
21 stars 12 forks source link

In valid.GenomicRanges.seqinfo #11

Open minn333 opened 1 year ago

minn333 commented 1 year ago

Dear: Could you tell me how I correct the errors?

library(cn.mops)

BAMFiles <- list.files(pattern=".bam$") bamDataRanges <- getReadCountsFromBAM(BAMFiles)

res <- cn.mops(bamDataRanges)

Warning message: In valid.GenomicRanges.seqinfo(x, suggest.trim = TRUE) : GRanges object contains 4 out-of-bound ranges located on sequences chrM, chr18_gl000207_random, chrUn_gl000226, and chrUn_gl000229. Note that ranges located on a sequence whose length is unknown (NA) or on a circular sequence are not considered out-of-bound (use seqlengths() and isCircular() to get the lengths and circularity flags of the underlying sequences). You can use trim() to trim these ranges. See ?trim,GenomicRanges-method for more information.

Starting segmentation algorithm... Using "fastseg" for segmentation. Error in if (all(segMedianT == 0)) { : missing value where TRUE/FALSE needed Calls: cn.mops -> apply -> FUN In addition: Warning messages: 1: In valid.GenomicRanges.seqinfo(x, suggest.trim = TRUE) : GRanges object contains 4 out-of-bound ranges located on sequences chrM, chr18_gl000207_random, chrUn_gl000226, and chrUn_gl000229. Note that ranges located on a sequence whose length is unknown (NA) or on a circular sequence are not considered out-of-bound (use seqlengths() and isCircular() to get the lengths and circularity flags of the underlying sequences). You can use trim() to trim these ranges. See ?trim,GenomicRanges-method for more information. 2: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, : Normalization for reference sequence chrM not applicable, because of low number of segments 3: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, : Normalization for reference sequence chr9_gl000200_random not applicable, because of low number of segments 4: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, : Normalization for reference sequence chr18_gl000207_random not applicable, because of low number of segments 5: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, : Normalization for reference sequence chrUn_gl000226 not applicable, because of low number of segments 6: In normalizeChromosomes(X, chr = chr, normType = normType, qu = normQu, : Normalization for reference sequence chrUn_gl000229 not applicable, because of low number of segments Execution halted

vjcitn commented 1 year ago

Thanks for your note. Without access to your bam files it is not really possible to give detailed help. However, I did note that the proposed code fails when applied to the example data noted on the README of this repo. I did get success when I added segAlgorithm='DNAcopy' to the cn.mops call.

minn333 commented 1 year ago

Hello, I had set refSeqNames to omit the 4 out-of-bound ranges located on sequences chrM, chr18_gl000207_random, chrUn_gl000226, and chrUn_gl000229. Maybe make sense!

Thanks for your reply!

bamDataRanges <- getReadCountsFromBAM(BAMFiles, refSeqNames=c("chr1","chr2","chr3","chr4","chr5","chr6","chr7","chr8","chr9","chr10","chr11","chr12","chr13","chr14","chr15","chr16","chr17","chr18","chr19","chr20","chr21","chr22","chrX","chrY"))