Package au.org.intersect.samifier.domain

Examples of au.org.intersect.samifier.domain.Genome


    }

    private Genome doParsing(File genomeFile) throws IOException,
            GenomeFileParsingException {
        Genome genome = new Genome();

        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new FileReader(genomeFile));

            while ((line = reader.readLine()) != null) {
                lineNumber++;
                if (line.startsWith("##")){
                    continue;
                }
                // chromosome, source, type, start, stop, score, strand, phase,
                // attributes
                String[] parts = line.split("\\t", 9);
                if (parts.length < 9) {
                    // throw new
                    // GenomeFileParsingException("Line "+lineNumber+": not in expected format");
                    LOG.warn("Line " + lineNumber + ": not in expected format");
                    continue;
                }
                String type = parts[2];
                if (type == null) {
                    continue;
                }
                if (GENE_RE.matcher(type).matches()) {
                    GeneInfo gene = parseGene(parts);
                    processGene(genome, gene);
                } else if (SEQUENCE_RE.matcher(type).find()) {
                    GeneSequence sequence = parseSequence(parts);
                    processSequence(genome, parts[CHROMOSOME_PART], sequence);
                }
            }
        } finally {
            if (reader != null) {
                reader.close();
            }
        }
        genome.verify();
        return genome;
    }
View Full Code Here


        hsqldb.generateTables();
    }

    public void run() throws Exception {
        GenomeParserImpl genomeParser = new GenomeParserImpl();
        Genome genome = genomeParser.parseGenomeFile(genomeFile);

        ProteinToOLNParser proteinToOLNParser = new ProteinToOLNParserImpl();
        ProteinToOLNMap proteinToOLNMap = proteinToOLNParser
                .parseMappingFile(proteinToOLNMapFile);
View Full Code Here

    }

    public void runWithQuery(String sqlQuery) throws Exception {
        GenomeParserImpl genomeParser = new GenomeParserImpl();
        Genome genome = genomeParser.parseGenomeFile(genomeFile);

        ProteinToOLNParser proteinToOLNParser = new ProteinToOLNParserImpl();
        ProteinToOLNMap proteinToOLNMap = proteinToOLNParser
                .parseMappingFile(proteinToOLNMapFile);
View Full Code Here

public class GenomeParserImplTest {

    @Test
    public void testParseGenomeFile() throws GenomeFileParsingException {
        GenomeParser parser = new GenomeParserImpl();
        Genome gene = parser.parseGenomeFile(new File("test/resources/test_genome.gff"));
        assertTrue("Gene YAL038W", gene.hasGene("YAL038W"));
        assertEquals("Gene YAL038W should have 1 location", 1, gene.getGene("YAL038W").getLocations().size());
        assertTrue("Gene YAR009C", gene.hasGene("YAR009C"));
        assertEquals("Gene YAR009C should have 1 location", 1, gene.getGene("YAR009C").getLocations().size());
        assertTrue("Gene YDL075W", gene.hasGene("YDL075W"));
        assertEquals("Gene YDL075W should have 3 location", 3, gene.getGene("YDL075W").getLocations().size());
        //new intron types
        assertTrue("Gene YPL249C-A", gene.hasGene("YPL249C-A"));
        assertEquals("Gene YPL249C-A should have 3 location", 3, gene.getGene("YPL249C-A").getLocations().size());
      
       
    }
View Full Code Here

TOP

Related Classes of au.org.intersect.samifier.domain.Genome

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.