Example #1
0
 @Test
 public void testSumProfile() {
   subject.sumProfile(buildOtherProfile());
   assertThat(subject.getId(), is(subject.getId()));
   assertThat(subject.getKnownExpressionLevel(factor1), is(2.2D + 1D));
   assertThat(subject.getKnownExpressionLevel(factor2), is(3D + 2D));
   assertThat(subject.getKnownExpressionLevel(factor3), is(3.001D + 3D));
   assertThat(subject.getKnownExpressionLevel(factor4), is(300D));
 }
Example #2
0
 @Test
 public void testFold() {
   BaselineProfile sumProfile = subject.foldProfile(3);
   assertThat(sumProfile.getId(), is(subject.getId()));
   assertThat(sumProfile.getKnownExpressionLevel(factor1), is(0.7D));
   assertThat(sumProfile.getKnownExpressionLevel(factor2), is(1.0D));
   assertThat(sumProfile.getKnownExpressionLevel(factor3), is(1.0D));
   assertThat(sumProfile.getKnownExpressionLevel(factor4), is(nullValue()));
 }
Example #3
0
  @Test
  public void sumProfileShouldPreserveLevelsThatAreNotExpressedInOtherProfile() {
    BaselineProfile otherProfile =
        new BaselineProfile("other profile", "other name").add(QUERY_FACTOR_TYPE, expression_2);

    subject.sumProfile(otherProfile);
    assertThat(subject.getId(), is(GENE_ID));
    assertThat(
        subject.getKnownExpressionLevel(factor1), is(subject.getKnownExpressionLevel(factor1)));
    assertThat(subject.getKnownExpressionLevel(factor2), is(6D));
    assertThat(
        subject.getKnownExpressionLevel(factor3), is(subject.getKnownExpressionLevel(factor3)));
    assertThat(subject.getKnownExpressionLevel(factor4), is(nullValue()));
  }