Search in sources :

Example 81 with BioSequence

use of ubic.gemma.model.genome.biosequence.BioSequence in project Gemma by PavlidisLab.

the class FastaParserTest method testParseInputStreamAffyTarget.

public void testParseInputStreamAffyTarget() throws Exception {
    FastaParser p = new FastaParser();
    p.parse(g);
    Collection<BioSequence> actualResult = p.getResults();
    TestCase.assertNotNull(actualResult);
    TestCase.assertEquals(172, actualResult.size());
    for (Object object : actualResult) {
        BioSequence b = (BioSequence) object;
        TestCase.assertTrue(b.getSequenceDatabaseEntry() != null && b.getSequenceDatabaseEntry().getExternalDatabase() != null && b.getSequenceDatabaseEntry().getExternalDatabase().getName().equalsIgnoreCase("genbank"));
        if (FastaParserTest.log.isDebugEnabled())
            FastaParserTest.log.debug("NAME=" + b.getName() + " DESC=" + b.getDescription() + " SEQ=" + b.getSequence() + " GB=" + b.getSequenceDatabaseEntry().getAccession());
    }
}
Also used : BioSequence(ubic.gemma.model.genome.biosequence.BioSequence)

Example 82 with BioSequence

use of ubic.gemma.model.genome.biosequence.BioSequence in project Gemma by PavlidisLab.

the class FastaParserTest method testParser.

private void testParser(InputStream n) throws java.io.IOException {
    FastaParser p = new FastaParser();
    p.parse(n);
    Collection<BioSequence> actualResult = p.getResults();
    TestCase.assertNotNull(actualResult);
    TestCase.assertEquals(2, actualResult.size());
    for (Object object : actualResult) {
        BioSequence b = (BioSequence) object;
        FastaParserTest.log.debug("NAME=" + b.getName() + " DESC=" + b.getDescription() + " SEQ=" + b.getSequence());
    }
}
Also used : BioSequence(ubic.gemma.model.genome.biosequence.BioSequence)

Example 83 with BioSequence

use of ubic.gemma.model.genome.biosequence.BioSequence in project Gemma by PavlidisLab.

the class FastaParserTest method testParseMasked.

public void testParseMasked() throws Exception {
    try (InputStream n = FastaParserTest.class.getResourceAsStream("/data/loader/genome/maskedSeq.fa")) {
        FastaParser p = new FastaParser();
        p.parse(n);
        Collection<BioSequence> actualResult = p.getResults();
        TestCase.assertNotNull(actualResult);
        TestCase.assertEquals(7, actualResult.size());
        for (Object object : actualResult) {
            BioSequence b = (BioSequence) object;
            FastaParserTest.log.debug("NAME=" + b.getName() + " DESC=" + b.getDescription() + " SEQ=" + b.getSequence());
        }
    }
}
Also used : BioSequence(ubic.gemma.model.genome.biosequence.BioSequence) InputStream(java.io.InputStream)

Example 84 with BioSequence

use of ubic.gemma.model.genome.biosequence.BioSequence in project Gemma by PavlidisLab.

the class SimpleFastaCmdTest method testGetSingleAccNotFound.

@Test
public void testGetSingleAccNotFound() {
    if (this.fastaCmdExecutableNotExists()) {
        return;
    }
    SimpleFastaCmd fastaCmd = new SimpleFastaCmd();
    BioSequence bs = fastaCmd.getByAccession("FAKE.1", SimpleFastaCmdTest.TESTBLASTDB, testBlastDbPath);
    assertNull(bs);
}
Also used : BioSequence(ubic.gemma.model.genome.biosequence.BioSequence) Test(org.junit.Test)

Example 85 with BioSequence

use of ubic.gemma.model.genome.biosequence.BioSequence in project Gemma by PavlidisLab.

the class BlatAssociationScorerTest method createBlatResult.

private BlatResult createBlatResult(String name) {
    BlatResult blatResult = BlatResult.Factory.newInstance();
    blatResult.setRepMatches(0);
    blatResult.setMatches(49);
    blatResult.setQueryGapCount(0);
    blatResult.setTargetGapCount(2);
    blatResult.setMismatches(1);
    BioSequence sequence = BioSequence.Factory.newInstance();
    blatResult.setQuerySequence(sequence);
    blatResult.getQuerySequence().setLength(50L);
    Taxon taxon = Taxon.Factory.newInstance();
    taxon.setCommonName("human");
    Chromosome chr = new Chromosome(name, taxon);
    blatResult.setTargetChromosome(chr);
    return blatResult;
}
Also used : BioSequence(ubic.gemma.model.genome.biosequence.BioSequence) Taxon(ubic.gemma.model.genome.Taxon) Chromosome(ubic.gemma.model.genome.Chromosome) BlatResult(ubic.gemma.model.genome.sequenceAnalysis.BlatResult)

Aggregations

BioSequence (ubic.gemma.model.genome.biosequence.BioSequence)105 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)40 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)24 Test (org.junit.Test)18 HashSet (java.util.HashSet)17 Taxon (ubic.gemma.model.genome.Taxon)15 BlatResult (ubic.gemma.model.genome.sequenceAnalysis.BlatResult)12 InputStream (java.io.InputStream)11 Collection (java.util.Collection)11 HashMap (java.util.HashMap)10 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)10 GZIPInputStream (java.util.zip.GZIPInputStream)7 Gene (ubic.gemma.model.genome.Gene)7 GeoPlatform (ubic.gemma.core.loader.expression.geo.model.GeoPlatform)6 DatabaseEntry (ubic.gemma.model.common.description.DatabaseEntry)6 StopWatch (org.apache.commons.lang3.time.StopWatch)5 GeneProduct (ubic.gemma.model.genome.gene.GeneProduct)5 BioSequenceValueObject (ubic.gemma.model.genome.sequenceAnalysis.BioSequenceValueObject)5 BlatAssociation (ubic.gemma.model.genome.sequenceAnalysis.BlatAssociation)5 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)4