ERROR: segmentationPSCBS requires the PSCBS package
Describe the issue I am building a nextflow pipeline which incorporates purecn as one of the workflows but I am encountering a strange behavior when running the pipeline on a server in my home directory vs in a folder outside of my home directory. When I run the pipeline in my home directory, purecn completes as expected, however when running in a different folder, I get the following error message:
FATAL [2025-07-10 13:15:27] segmentationPSCBS requires the PSCBS package.
FATAL [2025-07-10 13:15:27]
FATAL [2025-07-10 13:15:27] This is most likely a user error due to invalid input data or
FATAL [2025-07-10 13:15:27] parameters (PureCN 2.10.0).
I've opened an interactive shell of the docker image containing PureCN and indeed,the PSCBS library is installed.
To Reproduce #!/bin/bash -ue Rscript /opt/PureCN/PureCN.R --out . --tumor 81034_B05_OPXv8_KB0211.hg38.final_coverage_loess.txt.gz --sampleid 81034_B05_OPXv8_KB0211.PureCN --vcf 81034_B05_OPXv8_KB0211.freebayes.filtered.vcf.gz.freebayes.gnomad.vcf.gz --fun-segmentation PSCBS --normaldb normalDB_freebayes.OPXv8.2025-07-09_hg38.rds --mapping-bias-file mapping_bias_freebayes.OPXv8.2025-07-09_hg38.rds --intervals OPXv8.purecn.intervals.txt --snp-blacklist hg38_simpleRepeats.bed --genome hg38 --model betabin --cores 8 --cosmic-vcf-file COSMICv101.GRCh38.Variants.normalized.dedup.vcf.gz --force --post-optimize --seed 123 --popaf-info-field AF
Log file INFO [2025-07-10 13:14:11] ------------------------------------------------------------ INFO [2025-07-10 13:14:11] PureCN 2.10.0 INFO [2025-07-10 13:14:11] ------------------------------------------------------------ INFO [2025-07-10 13:14:11] Arguments: -tumor.coverage.file /mnt/div/genetics/testing/analyses/TGC2/purecn_pscbs/work/95/7b1cd1846a453a7051f5be185faab1/81034_B05_OPXv8_KB0211/81034_B05_OPXv8_KB0211.hg38.final_coverage_loess.txt.gz -log.ratio -seg.file -vcf.file 81034_B05_OPXv8_KB0211.freebayes.filtered.vcf.gz.freebayes.gnomad.vcf.gz -genome hg38 -sex ? -args.setPriorVcf 6 -args.setMappingBiasVcf mapping_bias_freebayes.OPXv8.2025-07-09_hg38.rds -args.filterIntervals 100,0.05 -args.segmentation 0.005,NULL, -sampleid 81034_B05_OPXv8_KB0211.PureCN -min.ploidy 1.4 -max.ploidy 6 -max.non.clonal 0.2 -max.homozygous.loss 0.05,1e+07 -log.ratio.calibration 0.1 -model.homozygous FALSE -error 0.001 -interval.file OPXv8.purecn.intervals.txt -min.logr.sdev 0.15 -max.segments 300 -plot.cnv TRUE -vcf.field.prefix PureCN. -cosmic.vcf.file COSMICv101.GRCh38.Variants.normalized.dedup.vcf.gz -DB.info.flag DB -POPAF.info.field AF -Cosmic.CNT.info.field Cosmic.CNT -model betabin -post.optimize TRUE -log.file ./81034_B05_OPXv8_KB0211.PureCN.log -normal.coverage.file -normalDB -args.filterVcf -fun.segmentation -test.num.copy -test.purity -speedup.heuristics -BPPARAM INFO [2025-07-10 13:14:11] Using BiocParallel for parallel optimization. INFO [2025-07-10 13:14:11] Loading coverage files... INFO [2025-07-10 13:14:12] Mean target coverages: 250X (tumor) 243X (normal). INFO [2025-07-10 13:14:12] Mean coverages: chrX: 140.99, chrY: 73.84, chr1-22: 231.68. INFO [2025-07-10 13:14:12] Mean coverages: chrX: 142.42, chrY: 73.84, chr1-22: 232.57. INFO [2025-07-10 13:14:15] Removing 92 intervals with missing log.ratio. INFO [2025-07-10 13:14:15] Removing 18 low/high GC targets. INFO [2025-07-10 13:14:15] Removing 529 intervals excluded in normalDB. INFO [2025-07-10 13:14:15] normalDB provided. Setting minimum coverage for segmentation to 0.0015X. INFO [2025-07-10 13:14:15] Removing 1086 low count (< 100 total reads) intervals. INFO [2025-07-10 13:14:15] Removing 1185 low coverage (< 0.0015X) intervals. INFO [2025-07-10 13:14:15] Using 26577 intervals (12115 on-target, 14462 off-target). INFO [2025-07-10 13:14:15] Ratio of mean on-target vs. off-target read counts: 3.31 INFO [2025-07-10 13:14:15] Mean off-target bin size: 173409 INFO [2025-07-10 13:14:15] AT/GC dropout: 1.04 (tumor), 1.04 (normal), 0.99 (coverage log-ratio). INFO [2025-07-10 13:14:15] Loading VCF... INFO [2025-07-10 13:14:17] Found 13217 variants in VCF file. WARN [2025-07-10 13:14:17] vcf.file has no DB info field for membership in germline databases. Found and used valid population allele frequency > 0.001000 instead. INFO [2025-07-10 13:14:17] 7689 (58.2%) variants annotated as likely germline (DB INFO flag). INFO [2025-07-10 13:14:17] 81034_B05_OPXv8_KB0211 is tumor in VCF file. INFO [2025-07-10 13:14:18] 94 homozygous and 33 heterozygous variants on chrX. INFO [2025-07-10 13:14:18] Sex from VCF: M (Fisher's p-value: < 0.0001, odds-ratio: 6.52). INFO [2025-07-10 13:14:18] Removing 6264 low quality variants with non-offset BQ < 25. INFO [2025-07-10 13:14:18] Base quality scores range from 24 to 49 (offset by 1) INFO [2025-07-10 13:14:18] High median base quality score (49). UMI-barcoded data? INFO [2025-07-10 13:14:18] Minimum number of supporting reads ranges from 2 to 21, depending on coverage and BQS. INFO [2025-07-10 13:14:20] Initial testing for significant sample cross-contamination: maybe INFO [2025-07-10 13:14:20] Removing 2191 variants with AF < 0.030 or AF >= 0.970 or insufficient supporting reads or depth < 15. INFO [2025-07-10 13:14:29] Removing 175 blacklisted variants. INFO [2025-07-10 13:14:29] Total size of targeted genomic region: 2.67Mb (3.65Mb with 50bp padding). INFO [2025-07-10 13:14:30] 29.3% of targets contain variants. INFO [2025-07-10 13:14:30] Removing 222 variants outside intervals. INFO [2025-07-10 13:14:30] Reading COSMIC VCF... WARN [2025-07-10 13:15:15] Cosmic VCF has no CNT info field. Giving up COSMIC annotation. INFO [2025-07-10 13:15:15] Setting somatic prior probabilities for likely germline hits to 0.000500 or to 0.500000 otherwise. INFO [2025-07-10 13:15:15] Loading mapping bias file mapping_bias_freebayes.OPXv8.2025-07-09_hg38.rds... INFO [2025-07-10 13:15:16] Found 81311 variants in mapping bias file. INFO [2025-07-10 13:15:21] Imputing mapping bias for 90 variants... INFO [2025-07-10 13:15:24] Excluding 519 novel or poor quality variants from segmentation. INFO [2025-07-10 13:15:24] Excluding 90 variants not in pool of normals from segmentation. INFO [2025-07-10 13:15:24] Sample sex: M INFO [2025-07-10 13:15:24] Segmenting data... FATAL [2025-07-10 13:15:27] segmentationPSCBS requires the PSCBS package.
FATAL [2025-07-10 13:15:27]
FATAL [2025-07-10 13:15:27] This is most likely a user error due to invalid input data or
FATAL [2025-07-10 13:15:27] parameters (PureCN 2.10.0).
Session Info
sessionInfo() R version 4.4.0 (2024-04-24) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 22.04.4 LTS
Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Etc/UTC tzcode source: system (glibc)
attached base packages:
[1] stats4 stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] PureCN_2.10.0 VariantAnnotation_1.50.0
[3] Rsamtools_2.20.0 Biostrings_2.72.0
[5] XVector_0.44.0 SummarizedExperiment_1.34.0
[7] Biobase_2.64.0 GenomicRanges_1.56.0
[9] GenomeInfoDb_1.40.1 IRanges_2.38.0
[11] S4Vectors_0.42.0 MatrixGenerics_1.16.0
[13] matrixStats_1.3.0 BiocGenerics_0.50.0
[15] DNAcopy_1.78.0
loaded via a namespace (and not attached):
[1] KEGGREST_1.44.0 gtable_0.3.5 rjson_0.2.21
[4] ggplot2_3.5.1 rhdf5_2.48.0 lattice_0.22-6
[7] rhdf5filters_1.16.0 vctrs_0.6.5 tools_4.4.0
[10] bitops_1.0-7 curl_5.2.1 parallel_4.4.0
[13] fansi_1.0.6 tibble_3.2.1 AnnotationDbi_1.66.0
[16] RSQLite_2.3.7 blob_1.2.4 pkgconfig_2.0.3
[19] Matrix_1.7-0 data.table_1.15.4 BSgenome_1.72.0
[22] RColorBrewer_1.1-3 lifecycle_1.0.4 GenomeInfoDbData_1.2.12
[25] compiler_4.4.0 munsell_0.5.1 codetools_0.2-20
[28] RCurl_1.98-1.14 yaml_2.3.8 pillar_1.9.0
[31] crayon_1.5.2 BiocParallel_1.38.0 DelayedArray_0.30.1
[34] cachem_1.0.8 mclust_6.1.1 abind_1.4-5
[37] restfulr_0.0.15 splines_4.4.0 fastmap_1.1.1
[40] grid_4.4.0 colorspace_2.1-0 cli_3.6.2
[43] SparseArray_1.4.8 magrittr_2.0.3 S4Arrays_1.4.1
[46] GenomicFeatures_1.56.0 utf8_1.2.4 XML_3.99-0.16.1
[49] scales_1.3.0 UCSC.utils_1.0.0 bit64_4.0.5
[52] lambda.r_1.2.4 httr_1.4.7 bit_4.0.5
[55] gridExtra_2.3 futile.logger_1.4.3 png_0.1-8
[58] VGAM_1.1-11 memoise_2.0.1 BiocIO_1.14.0
[61] rtracklayer_1.64.0 rlang_1.1.3 futile.options_1.0.1
[64] glue_1.7.0 DBI_1.2.2 formatR_1.14
[67] jsonlite_1.8.8 Rhdf5lib_1.26.0 R6_2.5.1
[70] GenomicAlignments_1.40.0 zlibbioc_1.50.0