Search in sources :

Example 1 with BlatResultParser

use of ubic.gemma.core.loader.genome.BlatResultParser in project Gemma by PavlidisLab.

the class ProbeMapperTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    tester = new ArrayList<>();
    tester.add(400d);
    tester.add(200d);
    tester.add(100d);
    tester.add(50d);
    try (InputStream is = this.getClass().getResourceAsStream("/data/loader/genome/col8a1.blatresults.txt")) {
        BlatResultParser brp = new BlatResultParser();
        Taxon m = Taxon.Factory.newInstance();
        m.setCommonName("mouse");
        brp.setTaxon(m);
        brp.parse(is);
        blatres = brp.getResults();
        assert blatres != null && blatres.size() > 0;
    }
    String databaseHost = Settings.getString("gemma.testdb.host");
    String databaseUser = Settings.getString("gemma.testdb.user");
    String databasePassword = Settings.getString("gemma.testdb.password");
    mousegp = new GoldenPathSequenceAnalysis(3306, Settings.getString("gemma.goldenpath.db.mouse"), databaseHost, databaseUser, databasePassword);
    humangp = new GoldenPathSequenceAnalysis(3306, Settings.getString("gemma.goldenpath.db.human"), databaseHost, databaseUser, databasePassword);
}
Also used : GoldenPathSequenceAnalysis(ubic.gemma.core.externalDb.GoldenPathSequenceAnalysis) BlatResultParser(ubic.gemma.core.loader.genome.BlatResultParser) InputStream(java.io.InputStream) Taxon(ubic.gemma.model.genome.Taxon)

Example 2 with BlatResultParser

use of ubic.gemma.core.loader.genome.BlatResultParser in project Gemma by PavlidisLab.

the class ShellDelegatingBlat method processPsl.

/**
 * @param filePath to the Blat output file in psl format
 * @param taxon    taxon (optional, can be null)
 * @return processed results.
 */
private Collection<BlatResult> processPsl(String filePath, Taxon taxon) throws IOException {
    ShellDelegatingBlat.log.debug("Processing " + filePath);
    BlatResultParser brp = new BlatResultParser();
    brp.setTaxon(taxon);
    brp.setScoreThreshold(this.blatScoreThreshold);
    brp.parse(filePath);
    return brp.getResults();
}
Also used : BlatResultParser(ubic.gemma.core.loader.genome.BlatResultParser)

Example 3 with BlatResultParser

use of ubic.gemma.core.loader.genome.BlatResultParser in project Gemma by PavlidisLab.

the class ArrayDesignBlatCli method getBlatResultsFromFile.

/**
 * Process blat file which must be for one taxon.
 */
private Collection<BlatResult> getBlatResultsFromFile(ArrayDesign arrayDesign) throws IOException {
    Taxon arrayDesignTaxon;
    File f = new File(blatResultFile);
    if (!f.canRead()) {
        AbstractCLI.log.error("Cannot read from " + blatResultFile);
        this.bail(ErrorCode.INVALID_OPTION);
    }
    // check being running for just one taxon
    arrayDesignTaxon = arrayDesignSequenceAlignmentService.validateTaxaForBlatFile(arrayDesign, taxon);
    AbstractCLI.log.info("Reading blat results in from " + f.getAbsolutePath());
    BlatResultParser parser = new BlatResultParser();
    parser.setScoreThreshold(this.blatScoreThreshold);
    parser.setTaxon(arrayDesignTaxon);
    parser.parse(f);
    return parser.getResults();
}
Also used : BlatResultParser(ubic.gemma.core.loader.genome.BlatResultParser) Taxon(ubic.gemma.model.genome.Taxon) File(java.io.File)

Example 4 with BlatResultParser

use of ubic.gemma.core.loader.genome.BlatResultParser in project Gemma by PavlidisLab.

the class ShellDelegatingBlat method processPsl.

@Override
public Collection<BlatResult> processPsl(InputStream inputStream, Taxon taxon) throws IOException {
    if (inputStream.available() == 0) {
        throw new IOException("No data from the blat output file. Make sure the gfServer is running");
    }
    ShellDelegatingBlat.log.debug("Processing " + inputStream);
    BlatResultParser brp = new BlatResultParser();
    brp.setTaxon(taxon);
    brp.setScoreThreshold(this.blatScoreThreshold);
    brp.parse(inputStream);
    ShellDelegatingBlat.log.info(brp.getNumSkipped() + " results were skipped as being below score= " + this.blatScoreThreshold + "; " + brp.getResults().size() + " results retained");
    return brp.getResults();
}
Also used : BlatResultParser(ubic.gemma.core.loader.genome.BlatResultParser)

Aggregations

BlatResultParser (ubic.gemma.core.loader.genome.BlatResultParser)4 Taxon (ubic.gemma.model.genome.Taxon)2 File (java.io.File)1 InputStream (java.io.InputStream)1 GoldenPathSequenceAnalysis (ubic.gemma.core.externalDb.GoldenPathSequenceAnalysis)1