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());
}
}
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());
}
}
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());
}
}
}
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);
}
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;
}
Aggregations