EvidenceService { boolean cellLineAsSampleCharacteristicButNoDiseaseAsFactor(ExperimentDesign experimentDesign) { return (experimentDesign.getSampleHeaders().contains("cell line") || experimentDesign.getFactorHeaders().contains("cell line")) && !experimentDesign.getFactorHeaders().contains("disease"); } EvidenceService(
            ProfileStreamFactory<Contrast, X, E, O, P> differentialProfileStreamFactory,
            DataFileHub dataFileHub, String expressionAtlasVersion); void evidenceForExperiment(E experiment,
                                      Function<Contrast, O> queryForOneContrast,
                                      Consumer<JsonObject> yield);  }
@Test public void cellLineAsSampleCharacteristicButNoDiseaseAsFactorExcludeTypicalExperimentUsingDiseaseCellLinesForSomething() { ExperimentDesign experimentDesign = new ExperimentDesign(); experimentDesign.putSampleCharacteristic("g1", "cell line", "A1"); experimentDesign.putSampleCharacteristic("g2", "cell line", "A1"); experimentDesign.putSampleCharacteristic("g1", "disease", "cancer"); experimentDesign.putSampleCharacteristic("g2", "disease", "cancer"); experimentDesign.putSampleCharacteristic("g1", "lighting conditions", "light"); experimentDesign.putSampleCharacteristic("g2", "lighting conditions", "dark"); experimentDesign.putFactor("g1", "lighting conditions", "light"); experimentDesign.putFactor("g2", "lighting conditions", "dark"); assertThat(subject.cellLineAsSampleCharacteristicButNoDiseaseAsFactor(experimentDesign), is(true)); }
@Test public void cellLineAsSampleCharacteristicButNoDiseaseAsFactorDoNotExcludeExperimentStudyingDiseases() { ExperimentDesign experimentDesign = new ExperimentDesign(); experimentDesign.putSampleCharacteristic("g1", "cell line", "A1"); experimentDesign.putSampleCharacteristic("g2", "cell line", "A2"); experimentDesign.putSampleCharacteristic("g1", "disease", "cancer"); experimentDesign.putFactor("g1", "disease", "cancer"); experimentDesign.putSampleCharacteristic("g2", "disease", "normal"); experimentDesign.putSampleCharacteristic("g2", "disease", "normal"); assertThat(subject.cellLineAsSampleCharacteristicButNoDiseaseAsFactor(experimentDesign), is(false)); }
@Test public void cellLineAsSampleCharacteristicButNoDiseaseAsFactorDoNotExcludeTypicalExperiment() { ExperimentDesign experimentDesign = new ExperimentDesign(); experimentDesign.putSampleCharacteristic("g1", "disease", "cancer"); experimentDesign.putSampleCharacteristic("g2", "disease", "normal"); experimentDesign.putSampleCharacteristic("g1", "age", "32"); experimentDesign.putSampleCharacteristic("g2", "age", "25"); experimentDesign.putFactor("g1", "disease", "cancer"); experimentDesign.putFactor("g2", "disease", "normal"); assertThat(subject.cellLineAsSampleCharacteristicButNoDiseaseAsFactor(experimentDesign), is(false)); }