Search in sources :

Example 16 with BlatResult

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;
}
Also used : Gene(ubic.gemma.model.genome.Gene) BioSequence(ubic.gemma.model.genome.biosequence.BioSequence) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) Taxon(ubic.gemma.model.genome.Taxon) CompositeSequence(ubic.gemma.model.expression.designElement.CompositeSequence) BlatAssociation(ubic.gemma.model.genome.sequenceAnalysis.BlatAssociation) HashSet(java.util.HashSet) BlatResult(ubic.gemma.model.genome.sequenceAnalysis.BlatResult)

Example 17 with BlatResult

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);
}
Also used : GZIPInputStream(java.util.zip.GZIPInputStream) ArrayDesignSequenceAlignmentService(ubic.gemma.core.loader.expression.arrayDesign.ArrayDesignSequenceAlignmentService) GZIPInputStream(java.util.zip.GZIPInputStream) InputStream(java.io.InputStream) Taxon(ubic.gemma.model.genome.Taxon) ArrayDesignProbeMapperService(ubic.gemma.core.loader.expression.arrayDesign.ArrayDesignProbeMapperService) BlatResult(ubic.gemma.model.genome.sequenceAnalysis.BlatResult)

Example 18 with BlatResult

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);
}
Also used : Blat(ubic.gemma.core.apps.Blat) BioSequence(ubic.gemma.model.genome.biosequence.BioSequence) BlatResult(ubic.gemma.model.genome.sequenceAnalysis.BlatResult) Test(org.junit.Test)

Example 19 with BlatResult

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());
    }
}
Also used : InputStream(java.io.InputStream) BlatResult(ubic.gemma.model.genome.sequenceAnalysis.BlatResult)

Example 20 with BlatResult

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());
    }
}
Also used : InputStream(java.io.InputStream) BlatResult(ubic.gemma.model.genome.sequenceAnalysis.BlatResult)

Aggregations

BlatResult (ubic.gemma.model.genome.sequenceAnalysis.BlatResult)33 BioSequence (ubic.gemma.model.genome.biosequence.BioSequence)12 HashSet (java.util.HashSet)10 Collection (java.util.Collection)9 Taxon (ubic.gemma.model.genome.Taxon)6 Chromosome (ubic.gemma.model.genome.Chromosome)5 BlatAssociation (ubic.gemma.model.genome.sequenceAnalysis.BlatAssociation)5 HashMap (java.util.HashMap)4 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)4 PhysicalLocation (ubic.gemma.model.genome.PhysicalLocation)4 IOException (java.io.IOException)3 InputStream (java.io.InputStream)3 Blat (ubic.gemma.core.apps.Blat)3 ShellDelegatingBlat (ubic.gemma.core.apps.ShellDelegatingBlat)3 ExternalDatabase (ubic.gemma.model.common.description.ExternalDatabase)3 Test (org.junit.Test)2 BioSequence2GeneProduct (ubic.gemma.model.association.BioSequence2GeneProduct)2 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1