Examples of Genome


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

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

        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

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

    }

    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

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

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

Examples of com.heatonresearch.aifh.evolutionary.genome.Genome

    @Override
    public double calculateScore(final MLMethod algo) {
        ErrorCalculation ec = this.errorCalc.create();

        final RegressionAlgorithm ralgo = (RegressionAlgorithm) algo;
        final Genome genome = (Genome)ralgo;

        if( genome.size()>this.maxLength ) {
            return Double.POSITIVE_INFINITY;
        }

        // evaulate
        ec.clear();
View Full Code Here

Examples of de.mh4j.solver.genetic.Genome

            pointer2 = 1 - pointer1;
        }

        long fitnessSum = genePool.getFitnessSum();
        double probabilitySum = 0;
        Genome parent1 = null;
        for (Genome genome : genePool) {
            double selectionProbability = (fitnessSum == 0) ? 1 : genome.getFitness() / (double) fitnessSum;
            probabilitySum += selectionProbability;

            if (parent1 == null && probabilitySum >= pointer1) {
View Full Code Here

Examples of de.mh4j.solver.genetic.Genome

        return parents;
    }

    private Couple getCouple(GenePool<GenericGenomeType> genePool) {
        Genome parent1 = selectMate(genePool);
        Genome parent2 = selectMate(genePool);
        return new Couple(parent1, parent2);
    }
View Full Code Here

Examples of de.mh4j.solver.genetic.Genome

    public Collection<Couple> select(int numberOfPairs, GenePool<GenericGenomeType> genePool) {
        Collection<Couple> couples = new ArrayList<Couple>(numberOfPairs);

        Genome[] genomes = genePool.toArray();
        for (int i = 0; i < numberOfPairs; i++) {
            Genome parent1 = selectMate(genomes);
            Genome parent2 = selectMate(genomes);
            couples.add(new Couple(parent1, parent2));
        }
        return couples;
    }
View Full Code Here

Examples of de.mh4j.solver.genetic.Genome

    /**
     * TODO write javadoc
     */
    protected Genome selectMate(Genome[] genomes) {
        Genome bestIndividual = null;
        int numberOfIndividualsToDrawForTournament = 1 + random.nextInt(genomes.length - 1);
        for (int i = 0; i < numberOfIndividualsToDrawForTournament; i++) {
            int indexOfIndividual = random.nextInt(genomes.length);
            Genome tmpIndividual = genomes[indexOfIndividual];
            if (bestIndividual == null) {
                bestIndividual = tmpIndividual;
            }
            else {
                if (bestIndividual.getFitness() < tmpIndividual.getFitness()) {
                    bestIndividual = tmpIndividual;
                }
            }
        }
        return bestIndividual;
View Full Code Here

Examples of de.mh4j.solver.genetic.Genome

        selector.select(population, 5);

        assert population.getSize() == 5;

        for (int i = 1; i <= 5; i++) {
            Genome genome = allGenomes.get(i - 1);
            assert population.contains(genome) == false : "Genomes 1-5 should not have survived";
        }

        for (int i = 6; i <= 10; i++) {
            Genome genome = allGenomes.get(i - 1);
            assert population.contains(genome) == true : "Genomes 6-10 should have survived";
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.