Package org.broad.igv.sam

Examples of org.broad.igv.sam.AlignmentTrack$Deselector


     * @return
     */
    private AlignmentTrack getAlignmentTrack(String sessionPath) throws Exception{
        rewriteRestoreSession(sessionPath);

        AlignmentTrack alTrack = null;
        for(Track tk: IGV.getInstance().getAllTracks()){
            if(tk instanceof AlignmentTrack){
                alTrack = (AlignmentTrack) tk;
            }
        }
View Full Code Here


    }

    @Test
    public void testLoadAlignmentTrackSession() throws Exception{
        String path = TestUtils.DATA_DIR + "sessions/HG00171_wlocus_v5.xml";
        AlignmentTrack alTrack = getAlignmentTrack(path);

        CoverageTrack covTrack = alTrack.getCoverageTrack();
        assertTrue(alTrack.isShowSpliceJunctions());

        assertEquals(CoverageTrack.DEFAULT_SHOW_REFERENCE, covTrack.isShowReference());
        assertEquals(CoverageTrack.DEFAULT_AUTOSCALE, covTrack.getAutoScale());
        assertEquals(0.1337f, covTrack.getSnpThreshold(), 1e-5);
    }
View Full Code Here

        String path = TestUtils.DATA_DIR + "sessions/HG00171_wlocus_v5.xml";
        tstLoadRenderOptions(path);
    }

    private void tstLoadRenderOptions(String path) throws Exception{
        AlignmentTrack alTrack = getAlignmentTrack(path);

        AlignmentTrack.RenderOptions ro = getRenderOptions(alTrack);

        assertEquals(AlignmentTrack.GroupOption.FIRST_OF_PAIR_STRAND, ro.getGroupByOption());
        assertEquals(AlignmentTrack.ColorOption.INSERT_SIZE, ro.getColorOption());
View Full Code Here

        //Load a data file which has a soft clipped block
        String path = TestUtils.DATA_DIR + "sam/hardSoftClip.sam";
        TestUtils.createIndex(path);
        List<Track> tracks = IGV.getInstance().load(new ResourceLocator(path));
        AlignmentTrack alTrack = (AlignmentTrack) tracks.get(1);

        //NPE happens when event is broadcast, clutters up stacktrace
        alTrack.getDataManager().getEventBus().unregister(tracks.get(0));

        AlignmentBlock[] blocks0 = getBlocks(alTrack, "chr1", 59300, 59400);
        assertEquals(1, blocks0.length);
        assertFalse(blocks0[0].isSoftClipped());
View Full Code Here

    private List<Object> basicRunCufflinks(String chr, int start, int end, File inFile) throws Exception{

        //Load some alignment data
        ResourceLocator locator = new ResourceLocator(inFile.getAbsolutePath());
        AlignmentDataManager dataManager = new AlignmentDataManager(locator, genome);
        AlignmentTrack alignmentTrack = new AlignmentTrack(locator, dataManager, genome);
        dataManager.loadAlignments(chr, start, end, null, null);

        PluginSpecReader.Command command = tool.commandList.get(0);

        List<Argument> argumentList = command.argumentList;
View Full Code Here

        return exportData;
    }

    static int exportVisibleAlignments(String outPath, Collection<Track> tracks, ReferenceFrame frame){
        AlignmentTrack alignmentTrack = null;
        for(Track track: tracks){
            if(track instanceof AlignmentTrack){
                alignmentTrack = (AlignmentTrack) track;
                break;
            }
        }

        if(alignmentTrack == null) return -1;


        File outFile = new File(outPath);
        try {
            AlignmentDataManager dataManager = alignmentTrack.getDataManager();
            ResourceLocator inlocator = dataManager.getLocator();
            Range range = frame.getCurrentRange();

            //Read directly from file
            //return SAMWriter.writeAlignmentFilePicard(inlocator, outPath, range.getChr(), range.getStart(), range.getEnd());
View Full Code Here

        List<Track> tracks = igv.getAllTracks();
        boolean vAP = "false".equalsIgnoreCase(vAPString) ? false : true;
        for (Track track : tracks) {
            if (track instanceof AlignmentTrack) {
                if (trackName == null || trackName.equalsIgnoreCase(track.getName())) {
                    AlignmentTrack atrack = (AlignmentTrack) track;
                    atrack.setViewAsPairs(vAP);
                }
            }
        }
        return "OK";
    }
View Full Code Here

                    }
                    //Thought we were done waiting, huh? Guess again
                    //Alignment tracks load alignment data asynchronously from the track

                    //Since sorting applies to all tracks, we only need to have 1 handler
                    AlignmentTrack track = null;
                    try {
                        track = Iterables.filter(igv.getAllTracks(), AlignmentTrack.class).iterator().next();
                        EventBus bus = track.getDataManager().getEventBus();
                        bus.register(new SortAlignmentsHandler(igv, bus, sortOption, sortTag));
                    } catch (NoSuchElementException e) {
                        //No alignment tracks found.
                        log.warn("Sort argument provided but no alignment tracks found");
                    }
View Full Code Here

TOP

Related Classes of org.broad.igv.sam.AlignmentTrack$Deselector

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.