Package org.broad.igv.feature

Examples of org.broad.igv.feature.Chromosome


            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));
 
View Full Code Here


            Genome genome = GenomeManager.getInstance().getCurrentGenome();

            String queryChr = chr;
            if (genome != null) {
                queryChr = genome.getChromosomeAlias(chr);
                Chromosome c = genome.getChromosome(chr);
                if (c != null) maxEnd = Math.max(c.getLength(), end);
            }

            // Expand interval +/- 50%, unless in a multi-locus mode with "lots" of frames
            boolean multiLocus = FrameManager.isExomeMode() || (FrameManager.getFrames().size() > 4);
            int delta = multiLocus ? 1 : (end - start) / 2;
View Full Code Here

        List<Chromosome> chromosomes = ChromSizesParser.parse(testFile);
        assertEquals(expectedCount, chromosomes.size());

        // chr10  135534747  /gbdb/hg19/hg19.2bit
        Chromosome chr10 = chromosomes.get(9);
        assertEquals("chr10", chr10.getName());
        assertEquals(135534747, chr10.getLength());
    }
View Full Code Here

    @Test
    public void testCompareLargeNumbers() throws Exception {
        long num1 = 7000000037415152l;
        long num2 = 7000000037415153l;
        ChromosomeComparator comp = new ChromosomeComparator(0);
        Chromosome chr1 = new Chromosome(0, String.valueOf(num1), 1 );
        Chromosome chr2 = new Chromosome(0, String.valueOf(num2), 1 );
        int value = comp.compare(chr1, chr2);
        assertTrue(value < 0);
    }
View Full Code Here

        }

        int dataPanelWidth = frame.getWidthInPixels();
        Rectangle cytoRect = new Rectangle(0, 10, dataPanelWidth, bandHeight);

        Chromosome chromosome = getReferenceFrame().getChromosome();
        if (chromosome == null) {
            return;
        }
        currentCytobands = chromosome.getCytobands();
        if (currentCytobands == null) {
            return;
        }

        cytobandRenderer.draw(currentCytobands, g, cytoRect, frame);
View Full Code Here

    public static LinkedHashMap<String, Chromosome> sortChromosomeList(List<Chromosome> tmpChromos, int minBig,
                                                                       LinkedHashMap<String, Chromosome> chromosomeMap) {
        chromosomeMap.clear();
        Collections.sort(tmpChromos, new ChromosomeComparator(minBig));
        for (int ii = 0; ii < tmpChromos.size(); ii++) {
            Chromosome chromo = tmpChromos.get(ii);
            chromo.setIndex(ii);
            chromosomeMap.put(chromo.getName(), chromo);
        }
        return chromosomeMap;
    }
View Full Code Here

        for (int i = 0; i < chromosomeNames.size(); i++) {
            String chr = chromosomeNames.get(i);
            int length = sequence.getChromosomeLength(chr);
            maxLength = Math.max(maxLength, length);
            Chromosome chromo = new Chromosome(i, chr, length);
            tmpChromos.add(chromo);

            if (chromosOrdered) {
                chromosomeMap.put(chr, chromo);
            }
View Full Code Here

        if (sequence == null) {
            return null;
        }

        Chromosome c = getChromosome(chr);
        if (c == null) {
            return null;
        }
        end = Math.min(end, c.getLength());
        if (end <= start) {
            return null;
        }
        return sequence.getSequence(chr, start, end);
    }
View Full Code Here

        for (Map.Entry<String, List<Cytoband>> entry : chrCytoMap.entrySet()) {
            String chr = entry.getKey();
            List<Cytoband> cytobands = entry.getValue();

            Chromosome chromosome = chromosomeMap.get(chr);
            if (chromosome != null) {
                chromosome.setCytobands(cytobands);
            }
        }

    }
View Full Code Here

        if (longChromosomeNames == null) {
            longChromosomeNames = new ArrayList<String>(getAllChromosomeNames().size());
            long genomeLength = getTotalLength();
            int maxChromoLength = -1;
            for (String chrName : getAllChromosomeNames()) {
                Chromosome chr = getChromosome(chrName);
                int length = chr.getLength();
                maxChromoLength = Math.max(maxChromoLength, length);
                if (length > (genomeLength / 3000)) {
                    longChromosomeNames.add(chrName);
                }
            }

            /**
             * At this point, we should have some long chromosome names.
             * However, some genomes (draft ones perhaps) maybe have many small ones
             * which aren't big enough. We arbitrarily take those which are above
             * half the size of the max, only if the first method didn't work.
             */
            if (longChromosomeNames.size() == 0) {
                for (String chrName : getAllChromosomeNames()) {
                    Chromosome chr = getChromosome(chrName);
                    int length = chr.getLength();
                    if (length > maxChromoLength / 2) {
                        longChromosomeNames.add(chrName);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.broad.igv.feature.Chromosome

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.