Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Number of intervals edge case gCNV fix #8180

Merged
merged 1 commit into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,10 @@ def _get_update_log_class_emission_tk_theano_func(self) -> th.compile.function_m
self.calling_config.num_copy_number_classes),
dtype=types.floatX)

# this converts TensorType from row to matrix when number in the edge case when number of intervals is equal to 2
# (to avoid type mismatch later on)
log_class_emission_cum_sum_tk = tt.unbroadcast(log_class_emission_cum_sum_tk, 0)

def inc_log_class_emission_tk_except_for_first_interval(pi_jkc, q_c_tc, cum_sum_tk):
"""Adds the contribution of a given sample to the log class emission (symbolically).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ public void testCohortWithoutIntervalAnnotations() {
runCommandLine(argsBuilder);
}

/**
* Run the tool in the COHORT mode for a case when number of provided intervals is two (minimum number allowed).
*/
@Test(groups = {"python"})
public void testCohortWithTwoIntervals() {
final ArgumentsBuilder argsBuilder = new ArgumentsBuilder();
Arrays.stream(TEST_COUNT_FILES, 0, 5).forEach(argsBuilder::addInput);
argsBuilder.add(GermlineCNVCaller.RUN_MODE_LONG_NAME, GermlineCNVCaller.RunMode.COHORT.name())
.add("L", "1:620998-622131")
.add("L", "1:877712-877902")
.add(GermlineCNVCaller.CONTIG_PLOIDY_CALLS_DIRECTORY_LONG_NAME,
CONTIG_PLOIDY_CALLS_OUTPUT_DIR.getAbsolutePath())
.add(StandardArgumentDefinitions.OUTPUT_LONG_NAME, OUTPUT_DIR.getAbsolutePath())
.add(CopyNumberStandardArgument.OUTPUT_PREFIX_LONG_NAME, "test-germline-cnv-cohort-two-targets")
.add(IntervalArgumentCollection.INTERVAL_MERGING_RULE_LONG_NAME, IntervalMergingRule.OVERLAPPING_ONLY.toString());
runCommandLine(argsBuilder);
}

/**
* Run the tool in CASE mode for the first 5 samples using the model generated by
* {@link #testCohortWithoutIntervalAnnotations()}
Expand Down