Examples of Genome


Examples of de.mh4j.solver.genetic.Genome

    private List<Genome> createPopulation() {
        int totalNumberOfGenomes = 10;
        List<Genome> allGenomes = new ArrayList<>(totalNumberOfGenomes);

        Genome genome1 = mock(Genome.class);
        when(genome1.getFitness()).thenReturn(1000);
        allGenomes.add(genome1);

        Genome genome2 = mock(Genome.class);
        when(genome2.getFitness()).thenReturn(2000);
        allGenomes.add(genome2);

        Genome genome3 = mock(Genome.class);
        when(genome3.getFitness()).thenReturn(3000);
        allGenomes.add(genome3);

        Genome genome4 = mock(Genome.class);
        when(genome4.getFitness()).thenReturn(4000);
        allGenomes.add(genome4);

        Genome genome5 = mock(Genome.class);
        when(genome5.getFitness()).thenReturn(5000);
        allGenomes.add(genome5);

        Genome genome6 = mock(Genome.class);
        when(genome6.getFitness()).thenReturn(6000);
        allGenomes.add(genome6);

        Genome genome7 = mock(Genome.class);
        when(genome7.getFitness()).thenReturn(7000);
        allGenomes.add(genome7);

        Genome genome8 = mock(Genome.class);
        when(genome8.getFitness()).thenReturn(8000);
        allGenomes.add(genome8);

        Genome genome9 = mock(Genome.class);
        when(genome9.getFitness()).thenReturn(9000);
        allGenomes.add(genome9);

        Genome genome10 = mock(Genome.class);
        when(genome10.getFitness()).thenReturn(10000);
        allGenomes.add(genome10);

        for (int i = 0; i < totalNumberOfGenomes; i++) {
            for (int j = 0; j < totalNumberOfGenomes; j++) {
                makeGenomeMockComparable(allGenomes.get(i), allGenomes.get(j));
View Full Code Here

Examples of de.mh4j.solver.genetic.Genome

        int totalNumberOfGenomes = 10;
        int tooOld = currentGeneration - maxAge - 1;
        oldGenomes = new ArrayList<>(totalNumberOfGenomes / 2);
        newGenomes = new ArrayList<>(totalNumberOfGenomes / 2);

        Genome genome1 = mock(Genome.class);
        when(genome1.getFitness()).thenReturn(1000);
        when(genome1.getBirthGeneration()).thenReturn(tooOld);
        oldGenomes.add(genome1);

        Genome genome2 = mock(Genome.class);
        when(genome2.getFitness()).thenReturn(2000);
        when(genome2.getBirthGeneration()).thenReturn(tooOld);
        oldGenomes.add(genome2);

        Genome genome3 = mock(Genome.class);
        when(genome3.getFitness()).thenReturn(3000);
        when(genome3.getBirthGeneration()).thenReturn(tooOld);
        oldGenomes.add(genome3);

        Genome genome4 = mock(Genome.class);
        when(genome4.getFitness()).thenReturn(4000);
        when(genome4.getBirthGeneration()).thenReturn(tooOld);
        oldGenomes.add(genome4);

        Genome genome5 = mock(Genome.class);
        when(genome5.getFitness()).thenReturn(5000);
        when(genome5.getBirthGeneration()).thenReturn(tooOld);
        oldGenomes.add(genome5);

        Genome genome6 = mock(Genome.class);
        when(genome6.getFitness()).thenReturn(6000);
        when(genome6.getBirthGeneration()).thenReturn(currentGeneration);
        newGenomes.add(genome6);

        Genome genome7 = mock(Genome.class);
        when(genome7.getFitness()).thenReturn(7000);
        when(genome7.getBirthGeneration()).thenReturn(currentGeneration);
        newGenomes.add(genome7);

        Genome genome8 = mock(Genome.class);
        when(genome8.getFitness()).thenReturn(8000);
        when(genome8.getBirthGeneration()).thenReturn(currentGeneration);
        newGenomes.add(genome8);

        Genome genome9 = mock(Genome.class);
        when(genome9.getFitness()).thenReturn(9000);
        when(genome9.getBirthGeneration()).thenReturn(currentGeneration);
        newGenomes.add(genome9);

        Genome genome10 = mock(Genome.class);
        when(genome10.getFitness()).thenReturn(10000);
        when(genome10.getBirthGeneration()).thenReturn(currentGeneration);
        newGenomes.add(genome10);

        List<Genome> allGenomes = new ArrayList<>(totalNumberOfGenomes);
        allGenomes.addAll(oldGenomes);
        allGenomes.addAll(newGenomes);
View Full Code Here

Examples of org.broad.igv.feature.genome.Genome

    @Override
    public void actionPerformed(ActionEvent event) {

        String [] visibleAttributes = { "dataType", "cell","antibody", "lab"};
        try {
            Genome genome = igv.getGenomeManager().getCurrentGenome();
            EncodeFileBrowser browser = EncodeFileBrowser.getInstance(genome.getId());

            if (browser == null) {
                MessageUtils.showMessage("Encode data is not available for " + genome.getDisplayName() + " through IGV.");
                return;
            }

            browser.setVisible(true);
            if (browser.isCanceled()) return;
View Full Code Here

Examples of org.broad.igv.feature.genome.Genome

        // TODO -- remove hardcoded value
        int locationUnit = 1000;

        g.setFont(chrFont);

        Genome genome = GenomeManager.getInstance().getCurrentGenome();
        if (genome == null) {
            log.warn("No genome found");
            PreferenceManager.getInstance().remove(PreferenceManager.DEFAULT_GENOME_KEY);
            return;
        }

        boolean even = true;
        long offset = 0;
        chromosomeRects.clear();
        List<String> chrNames = genome.getLongChromosomeNames();
        if (chrNames == null) {
            log.info("No chromosomes found for genome: " + PreferenceManager.getInstance().getDefaultGenome());
            PreferenceManager.getInstance().remove(PreferenceManager.DEFAULT_GENOME_KEY);
        }
        if (chrNames.size() > 500) {
            return;
        }

        final FontMetrics fontMetrics = g.getFontMetrics();
        for (String chrName : chrNames) {
            Chromosome c = genome.getChromosome(chrName);
            if (c == null) {
                log.info("Chromosome '" + chrName + "' not found");
                continue;
            }
            int chrLength = c.getLength();

            double scale = frame.getScale();
            int gStart = genome.getGenomeCoordinate(chrName, 0);
            int x = (int) (gStart / scale);
            int dw = (int) (chrLength / (locationUnit * scale));


            g.drawLine(x, getHeight() - 10, x, getHeight() - 2);
View Full Code Here

Examples of org.broad.igv.feature.genome.Genome

                }

                s = Math.max(0.0, s);
                String chr = null;
                if (isWholeGenomeView()) {
                    Genome genome = GenomeManager.getInstance().getCurrentGenome();
                    ChromosomeCoordinate start = genome.getChromosomeCoordinate((int) s);
                    ChromosomeCoordinate end = genome.getChromosomeCoordinate((int) e);

                    chr = start.getChr();
                    s = start.getCoordinate();
                    e = end.getCoordinate();
                    if (end.getChr() != start.getChr()) {
                        e = genome.getChromosome(start.getChr()).getLength();
                    }
                } else {
                    chr = frame.getChrName();
                }
View Full Code Here

Examples of org.broad.igv.feature.genome.Genome

     * @return true if successfully added, false if not
     */
    static boolean put(String name, NamedFeature feature, Genome genome) {
        String key = name.toUpperCase();
        if (!Globals.isHeadless()) {
            Genome currentGenome = genome != null ? genome : GenomeManager.getInstance().getCurrentGenome();
            if (currentGenome != null && currentGenome.getChromosome(feature.getChr()) == null) {
                return false;
            }
        }

        synchronized (featureMap) {
View Full Code Here

Examples of org.broad.igv.feature.genome.Genome

            int regionStart = regionOfInterest.getStart();
            int regionEnd = regionOfInterest.getEnd();

            // This is ugly, but neccessary the way the "whole genome" is treated as another chromosome
            if (frame.getChrName().equals(Globals.CHR_ALL)) {
                Genome genome = GenomeManager.getInstance().getCurrentGenome();
                regionStart = genome.getGenomeCoordinate(regionOfInterest.getChr(), regionStart);
                regionEnd = genome.getGenomeCoordinate(regionOfInterest.getChr(), regionEnd);
            }

            int start = frame.getScreenPosition(regionStart);
            int end = frame.getScreenPosition(regionEnd);
            int regionWidth = Math.max(1, end - start);
View Full Code Here

Examples of org.broad.igv.feature.genome.Genome

                    public String getName() {
                        return "Copy sequence";
                    }

                    public void run() {
                        Genome genome = GenomeManager.getInstance().getCurrentGenome();
                        IGV.copySequenceToClipboard(genome, roi.getChr(), roi.getStart(), roi.getEnd());
                    }
                });
            }
        });
View Full Code Here

Examples of org.broad.igv.feature.genome.Genome

                        if (start >= 0) {
                            expandedStart = Math.max(0, expandedStart);
                        }


                        Genome genome = GenomeManager.getInstance().getCurrentGenome();
                        if (genome != null) {
                            Chromosome c = genome.getChromosome(chr);
                            if (c != null && end < c.getLength()) expandedEnd = Math.min(c.getLength(), expandedEnd);
                        }

                        Iterator<Feature> iter = source.getFeatures(chr, expandedStart, expandedEnd);
                        if (iter == null) {
View Full Code Here

Examples of org.broad.igv.feature.genome.Genome

        for (AlignmentReader reader : readers) {
            names.addAll(reader.getSequenceNames());
        }
        sequenceNames = new ArrayList<String>(names);

        Genome genome = GenomeManager.getInstance().getCurrentGenome();
        chrNameIndex = new HashMap<String, Integer>(sequenceNames.size());
        for (int i = 0; i < sequenceNames.size(); i++) {
            final String seqName = sequenceNames.get(i);
            String chr = genome == null ? seqName : genome.getChromosomeAlias(seqName);
            chrNameIndex.put(chr, i);
        }
    }
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.