Package org.broad.igv.track

Examples of org.broad.igv.track.Track


        String text = null;
        for (MouseableRegion mouseableRegion : mouseableRegions) {
            if (mouseableRegion.containsPoint(x, y)) {
                Collection<Track> tracks = mouseableRegion.getTracks();
                if (tracks != null && tracks.size() == 1) {
                    Track track = tracks.iterator().next();
                    text = track.getNameValueString(y);
                } else {
                    text = mouseableRegion.getText();
                }
                break;
            }
View Full Code Here


    protected void shiftSelectTracks(MouseEvent e) {
        for (MouseableRegion mouseRegion : mouseRegions) {
            if (mouseRegion.containsPoint(e.getX(), e.getY())) {
                Collection<Track> clickedTracks = mouseRegion.getTracks();
                if (clickedTracks != null && clickedTracks.size() > 0) {
                    Track t = clickedTracks.iterator().next();
                    IGV.getInstance().shiftSelectTracks(t);
                }
                return;
            }
        }
View Full Code Here

                        break;
                    }
                }


                Track dropTrack = null;
                if (dropRegion != null) {
                    Iterator<Track> tmp = dropRegion.getTracks().iterator();
                    if (tmp.hasNext()) {
                        dropTrack = tmp.next();
                    }
View Full Code Here

    @Test
    public void testLoadMultiAlleleFreqs() throws Exception {
        String filePath = TestUtils.DATA_DIR + "vcf/multi_allele_freqs.vcf";
        TestUtils.createIndex(filePath);

        Track newTrack = (new TrackLoader()).load(new ResourceLocator(filePath), genome).get(0);
        VariantTrack variantTrack = (VariantTrack) newTrack;

        List<Feature> featuresList = variantTrack.getFeatures("chr1", 542939 - 10, 543702 + 10);
        assertEquals(6, featuresList.size());
View Full Code Here

        String chr = roi.getChr();
        int start = roi.getStart();
        int end = roi.getEnd();
        String frameName = frame != null ? frame.getName() : null;

        Track lastTrack = null;
        int count = 0;
        for (int ii = 0; ii < tracks.size(); ii++) {
            Track track = tracks.get(ii);
            if (track.isRegionScoreType(type)) {
                String name = track.getName().toLowerCase();
                if (name.contains("reference")
                        || name.contains("refseq")) {
                    continue;
                }
                count++;
                if (lastTrack == null) {
                    lastTrack = track;
                    continue;
                }

                // Test sort order -- by default tracks should be sorted in descending value
                float s2 = track.getRegionScore(chr, start, end, zoom, type, frameName);
                float s1 = lastTrack.getRegionScore(chr, start, end, zoom, type, frameName);
                assertTrue("Track named " + track.getName() + ", " + s2 + " and " + lastTrack.getName() + ", " + s1 + " out of order type " + type, s2 <= s1);

                lastTrack = track;
            }
        }
View Full Code Here

    protected List<MouseableRegion> getMouseRegions() {
        return mouseRegions;
    }

    public boolean scrollTo(String trackName) {
        Track t = findNextTrackMatching(trackName);
        if (t != null) {
            IGV.getInstance().clearSelections();
            t.setSelected(true);
            if (trackPanel.getScrollPane().getVerticalScrollBar().isShowing()) {
                trackPanel.getScrollPane().getVerticalScrollBar().setValue(t.getY());
            }
            return true;
        }

        return false;
View Full Code Here

    private synchronized Track findNextTrackMatching(String trackName) {
        List<Track> tracks = getAllTracks();
        searchIdx = Math.min(searchIdx, tracks.size());
        for (int i = searchIdx; i < tracks.size(); i++) {
            Track t = tracks.get(i);
            if (t.getName().toUpperCase().contains(trackName.toUpperCase())) {
                searchIdx = i + 1;
                return t;
            }
        }
        for (int i = 0; i < searchIdx; i++) {
            Track t = tracks.get(i);
            if (t.getName().toUpperCase().contains(trackName.toUpperCase())) {
                searchIdx = i + 1;
                return t;
            }
        }
        return null;
View Full Code Here

        IGVPopupMenu menu = null;

        // If a single track is selected, give it an opportunity to provide the popup menu
        if (selectedTracks.size() == 1) {
            Track track = selectedTracks.iterator().next();
            menu = track.getPopupMenu(te);
        }

        // If still no menu, create a generic one with common items
        if (menu == null) {
            String title = getPopupMenuTitle(e.getX(), e.getY());
View Full Code Here

        for (PluginSpecReader.Output outputAttr : outputAttrs) {
            //TODO Hacky, only works for output components being TextArgument, which they are as of this comment writing
            String name = (String) outputComponents.get(outputAttr).getValue();

            Track newTrack = null;
            switch (outputAttr.type) {
                case FEATURE_TRACK:
                    PluginFeatureSource featSource1 = new PluginFeatureSource(cmdList, argumentValues, outputAttr, specPath, this.forbidEmptyOutput);
                    //featSource1.setQueryTracker(queryTracker);
                    FeatureSource featSource = new CachingFeatureSource(featSource1);
View Full Code Here

    public static class TrackComboBoxRenderer extends DefaultListCellRenderer {

        @Override
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            Track track = (Track) value;
            String toShow = "No Tracks Found";
            if(track != null){
                toShow = track.getName();
            }
            return super.getListCellRendererComponent(list, toShow, index, isSelected, cellHasFocus);
        }
View Full Code Here

TOP

Related Classes of org.broad.igv.track.Track

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.