Search in sources :

Example 1 with Blat

use of ubic.gemma.core.apps.Blat in project Gemma by PavlidisLab.

the class ProbeMapperImpl method processSequences.

@Override
public Map<String, Collection<BlatAssociation>> processSequences(GoldenPathSequenceAnalysis goldenpath, Collection<BioSequence> sequences, ProbeMapperConfig config) {
    Blat b = new ShellDelegatingBlat();
    b.setBlatScoreThreshold(config.getBlatScoreThreshold());
    try {
        Map<BioSequence, Collection<BlatResult>> results = b.blatQuery(sequences, goldenpath.getTaxon());
        Collection<BlatResult> blatRes = new HashSet<>();
        for (Collection<BlatResult> coll : results.values()) {
            blatRes.addAll(coll);
        }
        return this.processBlatResults(goldenpath, blatRes);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : Blat(ubic.gemma.core.apps.Blat) ShellDelegatingBlat(ubic.gemma.core.apps.ShellDelegatingBlat) BioSequence(ubic.gemma.model.genome.biosequence.BioSequence) ShellDelegatingBlat(ubic.gemma.core.apps.ShellDelegatingBlat) Collection(java.util.Collection) IOException(java.io.IOException) BlatResult(ubic.gemma.model.genome.sequenceAnalysis.BlatResult) HashSet(java.util.HashSet)

Example 2 with Blat

use of ubic.gemma.core.apps.Blat in project Gemma by PavlidisLab.

the class ProbeMapperImpl method processSequence.

@Override
public Collection<BlatAssociation> processSequence(GoldenPathSequenceAnalysis goldenPath, BioSequence sequence) {
    Blat b = new ShellDelegatingBlat();
    b.setBlatScoreThreshold((new ProbeMapperConfig()).getBlatScoreThreshold());
    Collection<BlatResult> results;
    try {
        results = b.blatQuery(sequence, goldenPath.getTaxon(), false);
    } catch (IOException e) {
        throw new RuntimeException("Error running blat", e);
    }
    Map<String, Collection<BlatAssociation>> allRes = this.processBlatResults(goldenPath, results);
    assert allRes.keySet().size() == 1;
    return allRes.values().iterator().next();
}
Also used : Blat(ubic.gemma.core.apps.Blat) ShellDelegatingBlat(ubic.gemma.core.apps.ShellDelegatingBlat) ShellDelegatingBlat(ubic.gemma.core.apps.ShellDelegatingBlat) Collection(java.util.Collection) IOException(java.io.IOException) BlatResult(ubic.gemma.model.genome.sequenceAnalysis.BlatResult)

Example 3 with Blat

use of ubic.gemma.core.apps.Blat 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)

Aggregations

Blat (ubic.gemma.core.apps.Blat)3 BlatResult (ubic.gemma.model.genome.sequenceAnalysis.BlatResult)3 IOException (java.io.IOException)2 Collection (java.util.Collection)2 ShellDelegatingBlat (ubic.gemma.core.apps.ShellDelegatingBlat)2 BioSequence (ubic.gemma.model.genome.biosequence.BioSequence)2 HashSet (java.util.HashSet)1 Test (org.junit.Test)1