Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Updated analysis: Update CN consensus calls to use ControlFREEC CN as default? #964

Closed
jharenza opened this issue Mar 23, 2021 · 10 comments
Closed

Comments

@jharenza
Copy link
Collaborator

jharenza commented Mar 23, 2021

What analysis module should be updated and why?

copy_number_consensus_call

Early on, we had noticed many gains/losses in our oncoprint, but had since created a focal CN file module. Still, while the oncoprints look better, there are still a lot of gains/losses within the TMB plots listed above the oncoprints, and worth mentioning/trying the below.

What changes need to be made? Please provide enough detail for another participant to make the update.

@zhangb1 noticed that for PNOC003 samples, there were still many losses being called for samples which, in some cases, had known amplifications (from clinical sequencing). He has summarized his findings here. His rationale was that ploidy is based on ControlFREEC and thus, using its corresponding CN would probably result in a better estimate of overall CN.

This piece of code:

# Calculate summary stats from merged CNV calls. \
cnvs <- cnvs %>%
dplyr::mutate(cnvkit_df = purrr::map(cnvkit_CNVs, segstrings_to_df),
freec_df = purrr::map(freec_CNVs, segstrings_to_df),
segmean = purrr::map_dbl(cnvkit_df, segmean_function),
cnvkit_cn = purrr::map_dbl(cnvkit_df, copies_wmedian),
freec_cn = purrr::map_dbl(freec_df, copies_wmedian),
copynum = ifelse(is.finite(cnvkit_cn), # use cnvkit if available
cnvkit_cn, freec_cn), #otherwise use freec
num.mark = NA)

would change to:

copynum = ifelse(is.finite(freec_cn), # use cnvkit if available
                                 freec_cn, cnvkit_cn), #otherwise use freec

What input data should be used? Which data were used in the version being updated?

data being used and to be updated:
consensus_seg_annotated_cn_autosomes.tsv.gz
consensus_seg_annotated_cn_x_and_y.tsv.gz
pbta-cnv-consensus.seg.gz

other data to be updated:
pbta-cnv-consensus-gistic.zip

When do you expect the revised analysis will be completed?

one week, if QC needed

Who will complete the updated analysis?

@kgaonkar6 or @jashapiro or @jharenza ?

Thoughts, @jashapiro and @jaclyn-taroni ?

@jaclyn-taroni
Copy link
Member

I am not opposed to this change in principle and would welcome a pull request. The evaluation would need to be more systematic (e.g., examine more if not all samples) and should be captured in this repository in a notebook.

@jharenza
Copy link
Collaborator Author

I am not opposed to this change in principle and would welcome a pull request. The evaluation would need to be more systematic (e.g., examine more if not all samples) and should be captured in this repository in a notebook.

Agreed- we need to examine.

@kgaonkar6
Copy link
Collaborator

I'm getting an error at rule merge_all step running the code in docker as is from the master branch.

 (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

It seems like a simple command to cat all the files and seems to work fine when I run it on bash from docker exec so seems like a snakemake file specific bug?

@jharenza
Copy link
Collaborator Author

jharenza commented Apr 1, 2021

@jashapiro I know you are out this week, but when you are back, would you be able to help with the error above? Thanks!

@jashapiro
Copy link
Member

I can try to help out. Is there any more detail you can give about exactly how you ran it @kgaonkar6? As far as I am aware, the workflow runs in CI, so there would have to be a pretty specific bug... as a first step, I would check that scratch/copy_consensus is empty before running the run_consensus_call.sh script.

@kgaonkar6
Copy link
Collaborator

I ran the analysis with this command

docker exec -ti rerun-cn bash -c "cd /home/rstudio/OpenPBTA && analyses/copy_number_consensus_call/run_consensus_call.sh"

I did edit the script bed_tosegfile.R which is the last step rule make_segfile in the Snakemake file but the error occurs 2 steps before where all files are merged in step rule merge_all .

I will try a re-run with an empty scratch/copy_consensus, thanks for the input!

@kgaonkar6
Copy link
Collaborator

re-running with an empty scratch/copy_consensus worked! 🎉 Thank you, should have tried that before!

@jharenza
Copy link
Collaborator Author

jharenza commented Apr 2, 2021

thanks @jashapiro

@kgaonkar6
Copy link
Collaborator

kgaonkar6 commented Apr 2, 2021

Sorry for bringing this up again.. @jashapiro @jashapiro

The analysis ran successfully with testing data I had downloaded for another PR I'm working on, but it actually did error out in the same step when I ran it with v18 . I did empty scratch/copy_consensus before running the same command with docker exec above. The log file has the error:

Error in rule merge_all:

@jharenza
Copy link
Collaborator Author

Closed with #1066

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants