use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class GeoConverterTest method testWithImages.
/*
* Has image clones.
*/
@Test
public final void testWithImages() throws Exception {
GeoFamilyParser parser = new GeoFamilyParser();
parser.setProcessPlatformsOnly(true);
try (InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GPL890_family.soft.gz"))) {
parser.parse(is);
}
GeoPlatform platform = ((GeoParseResult) parser.getResults().iterator().next()).getPlatformMap().get("GPL890");
Object result = this.gc.convert(platform);
ArrayDesign ad = (ArrayDesign) result;
for (CompositeSequence cs : ad.getCompositeSequences()) {
BioSequence bs = cs.getBiologicalCharacteristic();
if (bs != null && bs.getSequence() != null) {
return;
}
}
fail("No sequences!");
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class GeoConverterTest method testMultipleTaxaIdentifiedBYAbbreviationsOnArrayWithOrganismColumn.
/*
* Method to test that an array design can have multiple taxa stored against it and that if abbreviations used as
* probe names mapped to the scientific names correctly if the abbreviation is stored in DB.
*/
@Test
public void testMultipleTaxaIdentifiedBYAbbreviationsOnArrayWithOrganismColumn() throws Exception {
Taxon rainbowTroat = taxonService.findByAbbreviation("omyk");
Taxon whiteFish = taxonService.findByAbbreviation("cclu");
Taxon rainbowSmelt = taxonService.findByAbbreviation("omor");
Taxon atlanticSalm = taxonService.findByAbbreviation("ssal");
assertNotNull(atlanticSalm);
// prototype bean.
gc = this.getBean(GeoConverter.class);
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GPL2899_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
// parse only the plaform
parser.setProcessPlatformsOnly(true);
parser.parse(is);
GeoPlatform platform = ((GeoParseResult) parser.getResults().iterator().next()).getPlatformMap().get("GPL2899");
Object result = gc.convert(platform);
ArrayDesign ad = (ArrayDesign) result;
assertNotNull(ad);
Set<Taxon> taxa = new HashSet<>();
BioSequence bs;
for (CompositeSequence cs : ad.getCompositeSequences()) {
bs = cs.getBiologicalCharacteristic();
if (bs != null) {
assertNotNull(bs.getTaxon());
taxa.add(bs.getTaxon());
}
}
assertEquals(4, taxa.size());
// original file has five taxa, test file just kept four.
assertTrue(taxa.contains(atlanticSalm));
assertTrue(taxa.contains(rainbowTroat));
assertTrue(taxa.contains(whiteFish));
assertTrue(taxa.contains(rainbowSmelt));
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class GeoConverterTest method testConvertGSE4229IMAGE.
/*
* See bug 3328 - we don't want to use IMAGE clone IDs
*/
@Test
public void testConvertGSE4229IMAGE() throws Exception {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse4229Short/GSE4229.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE4229");
DatasetCombiner datasetCombiner = new DatasetCombiner();
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
Object result = this.gc.convert(series);
assertNotNull(result);
@SuppressWarnings("unchecked") Collection<ExpressionExperiment> ees = (Collection<ExpressionExperiment>) result;
ExpressionExperiment ee = ees.iterator().next();
ArrayDesign platform = ee.getBioAssays().iterator().next().getArrayDesignUsed();
BioSequence seq = platform.getCompositeSequences().iterator().next().getBiologicalCharacteristic();
assertNotNull(seq.getSequenceDatabaseEntry());
String acc = seq.getSequenceDatabaseEntry().getAccession();
assertEquals("Genbank", seq.getSequenceDatabaseEntry().getExternalDatabase().getName());
assertTrue(!acc.startsWith("IMAGE"));
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class RNASeqDataAddCli method locateArrayDesign.
private ArrayDesign locateArrayDesign(String name) {
ArrayDesign arrayDesign = null;
ArrayDesignService arrayDesignService = this.getBean(ArrayDesignService.class);
Collection<ArrayDesign> byname = arrayDesignService.findByName(name.trim().toUpperCase());
if (byname.size() > 1) {
throw new IllegalArgumentException("Ambiguous name: " + name);
} else if (byname.size() == 1) {
arrayDesign = byname.iterator().next();
}
if (arrayDesign == null) {
arrayDesign = arrayDesignService.findByShortName(name);
}
if (arrayDesign == null) {
AbstractCLI.log.error("No arrayDesign " + name + " found");
this.bail(ErrorCode.INVALID_OPTION);
}
return arrayDesign;
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class TwoChannelMissingValueCLI method processForMissingValues.
private void processForMissingValues(ExpressionExperiment ee) {
Collection<ArrayDesign> arrayDesignsUsed = eeService.getArrayDesignsUsed(ee);
boolean wasProcessed = false;
for (ArrayDesign design : arrayDesignsUsed) {
TechnologyType tt = design.getTechnologyType();
if (tt == TechnologyType.TWOCOLOR || tt == TechnologyType.DUALMODE) {
AbstractCLI.log.info(ee + " uses a two-color array design, processing...");
if (arrayDesignsUsed.size() == 1) {
// save the slower query.
wasProcessed = this.processExperiment(ee);
} else {
wasProcessed = this.processExperiment(ee);
}
}
}
if (!wasProcessed) {
errorObjects.add(ee.getShortName());
} else {
successObjects.add(ee.toString());
}
}
Aggregations