use of ubic.gemma.model.genome.sequenceAnalysis.BlatResult in project Gemma by PavlidisLab.
the class ProcessedExpressionDataVectorServiceTest method getGeneAssociatedWithEe.
private Collection<Gene> getGeneAssociatedWithEe(ExpressionExperiment ee) {
Collection<ArrayDesign> ads = this.expressionExperimentService.getArrayDesignsUsed(ee);
Collection<Gene> genes = new HashSet<>();
for (ArrayDesign ad : ads) {
Taxon taxon = this.getTaxon("mouse");
ad = this.arrayDesignService.thaw(ad);
for (CompositeSequence cs : ad.getCompositeSequences()) {
Gene g = this.getTestPersistentGene();
BlatAssociation blata = BlatAssociation.Factory.newInstance();
blata.setGeneProduct(g.getProducts().iterator().next());
BlatResult br = BlatResult.Factory.newInstance();
BioSequence bs = BioSequence.Factory.newInstance();
bs.setName(RandomStringUtils.random(10));
bs.setTaxon(taxon);
bs = (BioSequence) persisterHelper.persist(bs);
assertNotNull(bs);
cs.setBiologicalCharacteristic(bs);
compositeSequenceService.update(cs);
cs = compositeSequenceService.load(cs.getId());
assertNotNull(cs.getBiologicalCharacteristic());
br.setQuerySequence(bs);
blata.setBlatResult(br);
blata.setBioSequence(bs);
persisterHelper.persist(blata);
genes.add(g);
}
}
return genes;
}
use of ubic.gemma.model.genome.sequenceAnalysis.BlatResult in project Gemma by PavlidisLab.
the class CompositeSequenceGeneMapperServiceTest method blatCollapsedSequences.
private void blatCollapsedSequences() throws IOException {
Taxon taxon = taxonService.findByScientificName("Homo sapiens");
ArrayDesignSequenceAlignmentService aligner = this.getBean(ArrayDesignSequenceAlignmentService.class);
InputStream blatResultInputStream = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/genome/gpl96.blatresults.psl.gz"));
Collection<BlatResult> results = blat.processPsl(blatResultInputStream, taxon);
aligner.processArrayDesign(ad, taxon, results);
// real stuff.
ArrayDesignProbeMapperService arrayDesignProbeMapperService = this.getBean(ArrayDesignProbeMapperService.class);
arrayDesignProbeMapperService.processArrayDesign(ad);
}
use of ubic.gemma.model.genome.sequenceAnalysis.BlatResult in project Gemma by PavlidisLab.
the class ArrayDesignSequenceAlignmentandMappingTest method testProcessArrayDesign.
@Test
public final void testProcessArrayDesign() throws Exception {
ad = arrayDesignService.thaw(ad);
Collection<BioSequence> seqs = app.processArrayDesign(ad, new String[] { "testblastdb", "testblastdbPartTwo" }, FileTools.resourceToPath("/data/loader/genome/blast"), true, new MockFastaCmd(ad.getPrimaryTaxon()));
assertNotNull(seqs);
assertTrue(!seqs.isEmpty());
Blat mockBlat = new MockBlat(ad.getPrimaryTaxon());
ad = arrayDesignService.thaw(ad);
Collection<BlatResult> blatResults = aligner.processArrayDesign(ad, mockBlat);
assertTrue(blatResults.size() > 200);
}
use of ubic.gemma.model.genome.sequenceAnalysis.BlatResult in project Gemma by PavlidisLab.
the class BlatResultParserTest method testParseInputStreamNoheader.
public void testParseInputStreamNoheader() throws Exception {
try (InputStream is = this.getClass().getResourceAsStream("/data/loader/genome/blatResult.noheader.txt")) {
BlatResultParser bp = new BlatResultParser();
bp.parse(is);
Collection<BlatResult> res = bp.getResults();
TestCase.assertEquals(18, res.size());
}
}
use of ubic.gemma.model.genome.sequenceAnalysis.BlatResult in project Gemma by PavlidisLab.
the class BlatResultParserTest method testParseInputStreamWheader.
/*
* Test method for 'ubic.gemma.core.loader.loaderutils.BasicLineParser.parse(InputStream)'
*/
public void testParseInputStreamWheader() throws Exception {
try (InputStream is = this.getClass().getResourceAsStream("/data/loader/genome/blatResult.wheader.txt")) {
BlatResultParser bp = new BlatResultParser();
bp.parse(is);
Collection<BlatResult> res = bp.getResults();
TestCase.assertEquals(15, res.size());
}
}
Aggregations