示例#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));
 }
示例#2
0
  @Test
  public void sumOfUnknownExpressionAndKnownExpressionIsUnknownExpression() {

    BaselineProfile profileWithUnknownExpression = buildProfileWithUnknownExpression();

    assertThat(subject.getExpression(factor1).isKnown(), is(true));
    assertThat(subject.getExpression(factor2).isKnown(), is(true));
    subject.sumProfile(profileWithUnknownExpression);
    assertThat(subject.getExpression(factor1).isKnown(), is(false));
    assertThat(subject.getExpression(factor2).isKnown(), is(true));
  }
示例#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()));
  }