Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fail to draw main result figure: C stack usage error #79

Closed
kokonech opened this issue Dec 15, 2022 · 1 comment
Closed

Fail to draw main result figure: C stack usage error #79

kokonech opened this issue Dec 15, 2022 · 1 comment

Comments

@kokonech
Copy link

The error occurs when trying to draw the main figure, it happened to several cases I was working on:

MB272 : cannot draw the result
Error: C stack usage  11953872 is too close to the limit
In addition: Warning messages:
1: Problem while computing `seq = bfs_rank(root = node)`.
i Argument `neimode' is deprecated; use `mode' instead
2: Problem while computing `seq = bfs_rank(root = tumor_root)`.
i Argument `neimode' is deprecated; use `mode' instead

Numbat version: 1.0.2, R version: 4.1.1. Attached are also "bulk_subtrees" images, below is my code to run analysis:

sId = "ICGC_MB272"
phasePath = paste0(dataDir,sId,"/",sId,"_with_intron/outs/",sId,"_allele_counts.tsv.gz")
countsPath = paste0(dataDir,"perSampleAnalysisSV4/",sId,"_S4_res/",sId,"_raw_counts.txt.gz")

## analysis
resDir = paste0(dataDir,"cnvProfiling/numbatRes/",sId,"_res")

require(Matrix)
countMtx <- as.matrix(read.delim(countsPath,check.names = FALSE))
phaseMtx <- read.delim(phasePath)


# run
out = run_numbat(
    countMtx, # gene x cell integer UMI count matrix
    ref_hca, # reference expression profile, a gene x cell type normalized expression level matrix
    phaseMtx, # allele dataframe generated by pileup_and_phase script
    genome = "hg38",
    t = 1e-5,
    ncores = 4,
    plot = TRUE,
    out_dir = resDir
)

nb = Numbat$new(out_dir = resDir)

# here's the error occurs
nb$plot_phylo_heatmap(
  clone_bar = TRUE,
  p_min = 0.9,
)

bulk_subtrees_1
bulk_subtrees_2

@teng-gao
Copy link
Collaborator

teng-gao commented Dec 19, 2022

Hi @kokonech ,

Thanks for the issue. The C stack problem is actually a bug in ape and ggtree. We discussed this in #30. This only happens when there's only 1 event that passes filter and used to reconstruct the tree.

For your analysis, I see that there are 3 events detected. I would suggest raising max_entropy threshold (e.g. 0.8). In addition the expression profile looks noisy, so you using a custom reference may help. For more details on this you can check the user guide.

Thanks,
Teng

Edit: this is now fixed in the devel branch, although you also need to install the newest version of scistreer (v1.1.0):

devtools::install_github('https://github.com/kharchenkolab/scistreer')
devtools::install_github('https://github.com/kharchenkolab/numbat/tree/devel')

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants