Skip to content

Added per-sample denoised coverage output to gCNV - #5584

Merged
asmirnov239 merged 2 commits into
masterfrom
as_gcnv_denoised_cov
Jan 25, 2019
Merged

asmirnov239 merged 2 commits into
masterfrom
as_gcnv_denoised_cov

Conversation

@asmirnov239

Copy link
Copy Markdown
Contributor

This PR adds two new files into the gCNV output directory - mean and the standard deviation of the denoised coverage, that is computed by drawing posterior samples from the computed model.

@codecov-io

codecov-io commented Jan 17, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #5584 into master will increase coverage by 0.014%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##              master     #5584       +/-   ##
===============================================
+ Coverage     87.035%   87.048%   +0.014%     
+ Complexity     31535     31527        -8     
===============================================
  Files           1930      1928        -2     
  Lines         145443    145340      -103     
  Branches       16090     16089        -1     
===============================================
- Hits          126586    126516       -70     
+ Misses         12997     12963       -34     
- Partials        5860      5861        +1
Impacted Files Coverage Δ Complexity Δ
...gine/spark/datasources/ReadsSparkSinkUnitTest.java 69.072% <0%> (-3.15%) 18% <0%> (-3%)
...e/hellbender/engine/spark/SparkContextFactory.java 71.233% <0%> (-2.74%) 11% <0%> (ø)
.../broadinstitute/hellbender/utils/QualityUtils.java 82.927% <0%> (-2.439%) 15% <0%> (+1%)
...ender/engine/spark/datasources/ReadsSparkSink.java 57.353% <0%> (-2.369%) 16% <0%> (-1%)
...rg/broadinstitute/hellbender/utils/ClassUtils.java 85.714% <0%> (-1.128%) 19% <0%> (-2%)
...dinstitute/hellbender/engine/GATKToolUnitTest.java 90.544% <0%> (-0.473%) 71% <0%> (ø)
...cotator/dataSources/vcf/VcfFuncotationFactory.java 87.582% <0%> (-0.469%) 48% <0%> (ø)
...stitute/hellbender/engine/spark/GATKSparkTool.java 81.921% <0%> (-0.4%) 78% <0%> (ø)
...er/tools/funcotator/FuncotatorIntegrationTest.java 84.882% <0%> (-0.372%) 112% <0%> (-1%)
...ine/GATKPlugin/GATKAnnotationPluginDescriptor.java 76.582% <0%> (-0.293%) 57% <0%> (ø)
... and 13 more

@samuelklee samuelklee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor things, and a couple that might require a bit more consideration. Otherwise, looks good!

from . import io_consts
from .._version import __version__ as gcnvkernel_version
from ..models.fancy_model import GeneralizedContinuousModel
from ..models.model_denoising_calling import DenoisingModel

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import required?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Strangely, PyCharm does not let me know that..

# column name for baseline copy-number file
baseline_copy_number_column_name = "BASELINE_COPY_NUMBER"

# column name for denoised copy-number files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We refer to the analogous quantities (i.e., counts which have been denoised by DenoiseReadCounts) as "denoised copy ratios" in the somatic pipeline. Any chance we could change throughout? Otherwise, it's slightly confusing to refer to non-integer quantities as "counts".

So these column headers would be DENOISED_COPY_RATIO_*, the files below would be denoised_copy_ratios_*.tsv, etc. Be sure to change variable names and comments as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to change the comment above.

Returns:
A new and normalized probability vector if it deviates from unity more than `prob_sum_tol`
Otherwise, `prov_vector` is return unchanged.
Otherwise, `prob_vector` is return unchanged.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return -> returned

enable_explicit_gc_bias_modeling: bool = False,
disable_bias_factors_in_active_class: bool = False):
disable_bias_factors_in_active_class: bool = False,
denoised_counts_sampling_rounds: int = 250):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this parameter is going to be part of the config, should it be exposed (up through the python script, Java CLI, and WDL)? It also feels a bit different from the other DenoisingModelConfig model parameters, in that it parameterizes the inference. However, it doesn't really qualify as a HybridInferenceParameter, either.

Does output of the denoised coverage significantly affect runtime or memory? If so, we should probably expose, and we can keep it here in the config. If not, I'd be fine with setting an unexposed default, but I'd put it somewhere else besides the config.

@samuelklee samuelklee assigned asmirnov239 and unassigned samuelklee Jan 18, 2019
@asmirnov239
asmirnov239 force-pushed the as_gcnv_denoised_cov branch 3 times, most recently from 2aa4d93 to e8459e1 Compare January 22, 2019 20:24
self.denoising_model_approx)

# compute approximate denoised copy number ratios
denoising_copy_ratios_approx_generator = commons.get_sampling_generator_for_model_approximation(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

denoising -> denoised? if not, disregard.

approx_var_set, approx_mu_map, approx_std_map = io_commons.extract_meanfield_posterior_parameters(
self.denoising_model_approx)

# compute approximate denoised copy number ratios

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy number ratios -> copy ratios

@samuelklee

samuelklee commented Jan 23, 2019 •

Copy link
Copy Markdown
Contributor

Oops, one more thing. Let's add these outputs to the relevant WDLs.

EDIT: Scratch that, I guess they're included in the tar.

@asmirnov239
asmirnov239 merged commit 02dda7a into master Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants