PureCN icon indicating copy to clipboard operation
PureCN copied to clipboard

Running PureCN with only one normal samples

Open sleyn opened this issue 1 year ago • 1 comments

Hello!

I have to questions:

  1. What is the recommended way to run PureCN with only one normal sample (if there is any)?
  2. Related to this more technical - why does the minimum coverage value is used differently with and without NormalDB (explained below)?

NormalDB.R refuses to build NormalDB with less than two samples. I know that PureCN manual recommends using panel of normals but I want to look at the results with only one normal to investigate some issues with the data.

I'm trying to run:

Rscript \
    /opt/PureCN/PureCN.R \
    --out . \
    --cores 4 \
    --fun-segmentation CBS \
    --genome hg19 \
    --intervals data/interval.txt \
    --vcf data/sample1.vcf.filtered.vcf.gz \
    --normal data/normal1.bam_coverage_loess.txt.gz \
    --post-optimize \
    --sampleid sample1 \
    --snp-blacklist data/hg19_simpleRepeats.bed \
    --tumor data/sample1.bam_coverage_loess.txt.gz

This way PureCN finishes without errors but removes all off-target intervals due to low coverage.

I've traced this issue and found that in the filterIntervals function there is code:

    if (!is.null(normalDB)) {
        min.coverage <- min.coverage / 10000
        flog.info("normalDB provided. Setting minimum coverage for segmentation to %.4fX.", min.coverage)
    } else {
        flog.warn("No normalDB provided. Provide one for better results.")
    }

If NormalDB is provided min.coverage value decreases 4 times but if not - it is remained untouched and 15X is too high for off-target coverage. Is it intended behavior?

sleyn avatar Jan 05 '24 02:01 sleyn

Hi @sleyn

I'm pretty sure this code pre-dates off-target support and also the switch from average coverage to counts. This code basically ignores the min.coverage when normalDB is provided because poor baits coverage filtering is all taken care of there. Good catch. I'll need to dig into this ancient code to find a better solution without normalDB.

Thanks again for letting me know. Your bug reports have been super helpful!

Markus

lima1 avatar Jan 05 '24 15:01 lima1