@Test(expected = IllegalArgumentException.class) public void createRnaSeqBaselineWithNoFpkmsOrTpmsThrows() throws Exception { subject.create(EXPERIMENT_ACCESSION_NO_TPMS_FPKMS, ExperimentType.RNASEQ_MRNA_BASELINE); }
public ObjectInputStream<BaselineAnalytics> create(String experimentAccession, ExperimentType experimentType) throws IOException { checkArgument(experimentType.isBaseline()); if (experimentType.isProteomicsBaseline()) { AtlasResource<?> resource = dataFileHub.getProteomicsBaselineExperimentFiles(experimentAccession).main; return new ProteomicsBaselineAnalyticsInputStream(resource.getReader(), resource.toString()); } else { AtlasResource<?> tpms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.TPM); AtlasResource<?> fpkms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.FPKM); checkArgument( tpms.exists() || fpkms.exists(), String.format("No FPKMs or TPMs found for %s", experimentAccession)); return new RnaSeqBaselineAnalyticsInputStream( tpms.exists() ? Optional.of(tpms.getReader()) : Optional.empty(), fpkms.exists() ? Optional.of(fpkms.getReader()) : Optional.empty()); } }
BaselineAnalyticsInputStreamFactory { public ObjectInputStream<BaselineAnalytics> create(String experimentAccession, ExperimentType experimentType) throws IOException { checkArgument(experimentType.isBaseline()); if (experimentType.isProteomicsBaseline()) { AtlasResource<?> resource = dataFileHub.getProteomicsBaselineExperimentFiles(experimentAccession).main; return new ProteomicsBaselineAnalyticsInputStream(resource.getReader(), resource.toString()); } else { AtlasResource<?> tpms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.TPM); AtlasResource<?> fpkms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.FPKM); checkArgument( tpms.exists() || fpkms.exists(), String.format("No FPKMs or TPMs found for %s", experimentAccession)); return new RnaSeqBaselineAnalyticsInputStream( tpms.exists() ? Optional.of(tpms.getReader()) : Optional.empty(), fpkms.exists() ? Optional.of(fpkms.getReader()) : Optional.empty()); } } }
BaselineAnalyticsInputStreamFactory { public ObjectInputStream<BaselineAnalytics> create(String experimentAccession, ExperimentType experimentType) throws IOException { checkArgument(experimentType.isBaseline()); if (experimentType.isProteomicsBaseline()) { AtlasResource<?> resource = dataFileHub.getProteomicsBaselineExperimentFiles(experimentAccession).main; return new ProteomicsBaselineAnalyticsInputStream(resource.getReader(), resource.toString()); } else { AtlasResource<?> tpms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.TPM); AtlasResource<?> fpkms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.FPKM); checkArgument( tpms.exists() || fpkms.exists(), String.format("No FPKMs or TPMs found for %s", experimentAccession)); return new RnaSeqBaselineAnalyticsInputStream( tpms.exists() ? Optional.of(tpms.getReader()) : Optional.empty(), fpkms.exists() ? Optional.of(fpkms.getReader()) : Optional.empty()); } } @Inject  BaselineAnalyticsInputStreamFactory(DataFileHub dataFileHub); }
BaselineAnalyticsInputStreamFactory { public ObjectInputStream<BaselineAnalytics> create(String experimentAccession, ExperimentType experimentType) throws IOException { checkArgument(experimentType.isBaseline()); if (experimentType.isProteomicsBaseline()) { AtlasResource<?> resource = dataFileHub.getProteomicsBaselineExperimentFiles(experimentAccession).main; return new ProteomicsBaselineAnalyticsInputStream(resource.getReader(), resource.toString()); } else { AtlasResource<?> tpms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.TPM); AtlasResource<?> fpkms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.FPKM); checkArgument( tpms.exists() || fpkms.exists(), String.format("No FPKMs or TPMs found for %s", experimentAccession)); return new RnaSeqBaselineAnalyticsInputStream( tpms.exists() ? Optional.of(tpms.getReader()) : Optional.empty(), fpkms.exists() ? Optional.of(fpkms.getReader()) : Optional.empty()); } } @Inject  BaselineAnalyticsInputStreamFactory(DataFileHub dataFileHub); ObjectInputStream<BaselineAnalytics> create(String experimentAccession, ExperimentType experimentType); }
BaselineAnalyticsInputStreamFactory { public ObjectInputStream<BaselineAnalytics> create(String experimentAccession, ExperimentType experimentType) throws IOException { checkArgument(experimentType.isBaseline()); if (experimentType.isProteomicsBaseline()) { AtlasResource<?> resource = dataFileHub.getProteomicsBaselineExperimentFiles(experimentAccession).main; return new ProteomicsBaselineAnalyticsInputStream(resource.getReader(), resource.toString()); } else { AtlasResource<?> tpms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.TPM); AtlasResource<?> fpkms = dataFileHub.getRnaSeqBaselineExperimentFiles(experimentAccession) .dataFile(ExpressionUnit.Absolute.Rna.FPKM); checkArgument( tpms.exists() || fpkms.exists(), String.format("No FPKMs or TPMs found for %s", experimentAccession)); return new RnaSeqBaselineAnalyticsInputStream( tpms.exists() ? Optional.of(tpms.getReader()) : Optional.empty(), fpkms.exists() ? Optional.of(fpkms.getReader()) : Optional.empty()); } } @Inject  BaselineAnalyticsInputStreamFactory(DataFileHub dataFileHub); ObjectInputStream<BaselineAnalytics> create(String experimentAccession, ExperimentType experimentType);  }