use of ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData in project Gemma by PavlidisLab.
the class LoadSimpleExpressionDataCli method loadExperiment.
private void loadExperiment(String configurationLine) throws Exception {
int i;
String[] fields = configurationLine.split(LoadSimpleExpressionDataCli.SPLIT_CHAR);
if (fields.length != LoadSimpleExpressionDataCli.TOTAL_FIELDS) {
throw new IllegalArgumentException("Field Missing Got[" + fields.length + "]: " + configurationLine);
}
for (i = 0; i < fields.length; i++) fields[i] = StringUtils.trim(fields[i]);
SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
String shortName = fields[LoadSimpleExpressionDataCli.SHORT_NAME_I];
ExpressionExperiment existing = eeService.findByShortName(shortName);
if (existing != null) {
throw new IllegalArgumentException("There is already an experiment with short name " + shortName + "; please choose something unique.");
}
metaData.setName(fields[LoadSimpleExpressionDataCli.NAME_I]);
metaData.setShortName(shortName);
metaData.setDescription(fields[LoadSimpleExpressionDataCli.DESCRIPTION_I]);
this.configureTaxon(fields, metaData);
this.configureArrayDesigns(fields, metaData);
try (InputStream data = new FileInputStream(new File(this.dirName, fields[LoadSimpleExpressionDataCli.DATA_FILE_I]))) {
metaData.setSourceUrl(fields[LoadSimpleExpressionDataCli.SOURCE_I]);
String pubMedId = fields[LoadSimpleExpressionDataCli.PUBMED_I];
if (StringUtils.isNotBlank(pubMedId)) {
metaData.setPubMedId(Integer.parseInt(pubMedId));
}
this.configureQuantitationType(fields, metaData);
ExpressionExperiment ee = eeLoaderService.create(metaData, data);
this.eeService.thawLite(ee);
}
}
Aggregations