Package org.broad.igv.feature

Examples of org.broad.igv.feature.Locus


    private List<LocusScore> scores;
    int zoom;

    public LoadedDataInterval(String chr, int start, int end, int zoom, List<LocusScore> scores) {

        range = new Locus(chr, start, end);
        this.zoom = zoom;
        this.scores = scores;
    }
View Full Code Here


        }
        if (tokens.length >= sigColumn) {
            String locusString = tokens[locusColumn];
            if (locusString == null) return null;

            Locus locus = Locus.fromString(locusString);
            if (locus == null || locus.getChr() == null) return null;

            String logRatioStr = tokens[logRatioColumn];
            float logRatio = Float.parseFloat(logRatioStr);

            if (Float.isInfinite(logRatio) || Float.isNaN(logRatio)) {
                log.info("LogRatio " + logRatioStr + " cannot be parsed as a float");
                logRatio = Float.NaN;
            }

            float fpkmX = Float.parseFloat(tokens[xColumn]);
            float fpkmY = Float.parseFloat(tokens[yColumn]);
            String gene = tokens[geneColumn];
            String significant = tokens[sigColumn];
            return new ExpDiffValue(locus.getChr(), locus.getStart() - 1, locus.getEnd(), gene,
                    logRatio, fpkmX, fpkmY, significant);
        } else {
            log.info("Unexpected # of columns.  Expected at least 12,  found " + tokens.length);
            return null;
        }
View Full Code Here

        }
        if (tokens.length >= (startfpkmCol + numSamples*colsPerSample)) {
            String locusString = tokens[locusColumn];
            if (locusString == null) return null;

            Locus locus = Locus.fromString(locusString);
            if(locus == null || locus.getChr() == null) return null;

            String gene = tokens[geneColumn];
            float[] fpkm = new float[numSamples];
            float[] confLo = new float[numSamples];
            float[] confHi = new float[numSamples];

            for(int sampNum = 0; sampNum < numSamples; sampNum++){
                int startCol = startfpkmCol + sampNum*colsPerSample;
                fpkm[sampNum] = Float.parseFloat(tokens[startCol]);
                confLo[sampNum] = Float.parseFloat(tokens[startCol+1]);
                confHi[sampNum] = Float.parseFloat(tokens[startCol+2]);
            }

            return new FPKMValue(locus.getChr(), locus.getStart() - 1, locus.getEnd(), gene,
                    fpkm, confLo, confHi);
        } else {
            log.info("Unexpected # of columns.  Expected at least 12,  found " + tokens.length);
            return null;
        }
View Full Code Here

    @BeforeClass
    public static void setup() throws IOException {
        Map<String, List<Feature>> allFeatures = loadTestFeatures();

        frame = new ExomeReferenceFrame(new ReferenceFrame("test"), allFeatures);
        frame.jumpTo(new Locus("chr6", 1, 100));
    }
View Full Code Here

        assertConsistent();
    }

    @Test
    public void testJumpTo_00() throws Exception{
        Locus locus = new Locus("chr1", 1000, 2000);
        frame.jumpTo(locus);

        assertEquals(locus.getChr(), frame.getChrName());
        assertEquals(locus.getStart(), frame.getOrigin(), 1.0);
        assertEquals(locus.getEnd(), frame.getEnd(), 1.0);
        assertConsistent();
    }
View Full Code Here

        assertConsistent();
    }

    @Test
    public void testJumpTo_01() throws Exception{
        Locus locus = new Locus("chr1", 1000, 2000);
        frame.jumpTo(locus);
        double oldLocScale = frame.getScale();
        int oldZoom = frame.getZoom();
        int oldMidPoint = frame.getMidpoint();
        double oldCenter = frame.getCenter();

        int delta = 12344;
        frame.jumpTo(locus.getChr(), locus.getStart() + delta, locus.getEnd() + delta);

        assertEquals(oldLocScale, frame.getScale());
        assertEquals(oldZoom, frame.getZoom());
        assertEquals(oldMidPoint, frame.getMidpoint());
View Full Code Here

        for(int ii=0; ii < loci.size(); ii++){
            ReferenceFrame frame = frameList.get(ii);
            ReferenceFrameTest.assertConsistent(frame);

            Locus locus = Locus.fromString(loci.get(ii));

            assertEquals(locus.getChr(), frame.getChrName());
            assertEquals(locus.getStart() - 1, frame.getOrigin(), 0.5);
            assertEquals(locus.getEnd(), frame.getEnd(), 0.5);
        }
    }
View Full Code Here


        IGV.getInstance().goToLocus("EGFR");
        FeatureTrack posTrack = (FeatureTrack) PosNegFeatureTracks.get(0);
        FeatureTrack negTrack = (FeatureTrack) PosNegFeatureTracks.get(1);
        Feature expFeature = new Locus("chr7", 55054248, 55054301);

        ReferenceFrame frame = FrameManager.getDefaultFrame();
        List<Feature> posFeats = posTrack.getFeatures(frame.getChrName(), (int) frame.getOrigin(), (int) frame.getEnd());

        assertEquals(1, posFeats.size());
View Full Code Here

        int lastStart = genome.getChromosome(chr).getLength() - 4 * halfwidth;
        int[] starts = new int[]{500, 5000, 15000, start, 500000, lastStart};
        int[] ends = new int[]{600, 10000, 20000, end, 600000, lastStart + 2 * halfwidth};
        for (int ii = 0; ii < starts.length; ii++) {
            frame.jumpTo(new Locus(chr, starts[ii], ends[ii]));
            int actEnd = (int) frame.getEnd();

            manager.load(context, renderOptions, false);

            assertManagerHasInterval(manager, chr, starts[ii], actEnd);
View Full Code Here

        frame.setBounds(0, end - start);
        RenderContextImpl context = new RenderContextImpl(null, null, frame, null);

        for (int pp = 0; pp < numPans; pp++) {
            shift = pp * panInterval;
            Locus locus = new Locus(chr, start + shift, end + shift);
            frame.jumpTo(locus);

            manager.load(context, renderOptions, false);

            assertManagerHasInterval(manager, chr, locus.getStart(), locus.getEnd());
        }

        return manager.getLoadedInterval(frame.getCurrentRange());

    }
View Full Code Here

TOP

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

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.