VanLoo-lab / ascat

ASCAT R package
https://www.mdanderson.org/research/departments-labs-institutes/labs/van-loo-laboratory/resources.html#ASCAT
162 stars 85 forks source link

Error in function make_segments #171

Closed psuarezana closed 5 months ago

psuarezana commented 6 months ago

Hello! I'am running the module ASCAT from nextflow and I have the following error:

Warning messages:
1: In !is.null(homsegs) && !is.na(homsegs) :
  'length(x) = 3 > 1' in coercion to 'logical(1)'
2: In !is.null(homsegs) && !is.na(homsegs) :
  'length(x) = 3 > 1' in coercion to 'logical(1)'
[1] Sample test_tumor_T1_vs_test_normal_T1.tumour (1/1)
Error in m[i, 2] : subscript out of bounds
Calls: ascat.runAscat -> runASCAT -> make_segments
Execution halted

So I checked the output of the function that segment the data:

#Segment the data
ascat.bc = ascat.aspcf(ascat.bc, seed=42)
print(ascat.bc$Tumor_LogR_segmented)

            test_tumor_T1_vs_test_normal_T1.tumour
21_14221174                              0.5881753
21_14582339                              0.5881753
21_25587877                             -0.1100367
...

print(ascat.bc$Tumor_BAF_segmented)

[[1]]
     [,1]

The length for the ascat.bc$Tumor_LogR_segmented is 59 (I don't know if this result is the expected one or not) and obviously something is wrong with the output ascat.bc$Tumor_BAF_segmented because it only has one value. Does anyone know what this could be due to?

Also, I add here the commands that have been used as input:

#build prefixes: <abspath_to_files/prefix_chr>
allele_path = normalizePath("G1000_alleles_hg38")
allele_prefix = paste0(allele_path, "/", "G1000_alleles_hg38", "_chr")

loci_path = normalizePath("G1000_loci_hg38_chr")
loci_prefix = paste0(loci_path, "/", "G1000_loci_hg38_chr", "_chr")

#prepare from BAM files
ascat.prepareHTS(
    tumourseqfile = "test_tumor_T1.sorted.bam",
    normalseqfile = "test_normal_T1.sorted.bam",
    tumourname = paste0("test_tumor_T1_vs_test_normal_T1", ".tumour"),
    normalname = paste0("test_tumor_T1_vs_test_normal_T1", ".normal"),
    allelecounter_exe = "alleleCounter",
    alleles.prefix = allele_prefix,
    loci.prefix = loci_prefix,
    gender = "XX",
    genomeVersion = "hg38",
    nthreads = 6

    ,chrom_names = c(1:22, 'X')

    ,
    seed = 42
)

Thank you in advance,

Ana

tlesluyes commented 6 months ago

Hi @psuarezana,

We do not provide any Nexftflow version of ASCAT so what you use is probably part of a pipeline we do not own/monitor. What version of ASCAT are you using?

This sounds like an older version of ASCAT (before April 2023) where !is.na(homsegs) was used and was fixer later with: https://github.com/VanLoo-lab/ascat/commit/c4c10f8bc5deecc0b0e18f46dd271934e554d73e. I recommend you have a fresh installation of ASCAT and try again. This will fix the warnings, maybe the error as well, but at least you will have the latest version of ASCAT. If the error still persists, please provide the full log and plots so I can understand where it crashes and what is going on.

Cheers,

Tom.