Package org.broad.igv.session

Examples of org.broad.igv.session.Session


     * @param igv
     * @param targetFile
     * @throws IOException
     */
    public static void saveSession(IGV igv, File targetFile) throws IOException{
        Session currentSession = igv.getSession();
        currentSession.setPath(targetFile.getAbsolutePath());
        (new SessionWriter()).saveSession(currentSession, targetFile);
    }
View Full Code Here


            }
        });


        session = new Session(null);

        // Create cursors
        createHandCursor();
        createZoomCursors();
        createDragAndDropCursor();
View Full Code Here

        menuBar.resetSessionActions();

        AttributeManager.getInstance().clearAllAttributes();

        if (session == null) {
            session = new Session(sessionPath);
        } else {
            session.reset(sessionPath);
        }

        alignmentTrackListeners.clear();
View Full Code Here

                int e2 = s2 + length;
                String startStr = NumberFormat.getInstance().format(s2);
                String endStr = NumberFormat.getInstance().format(e2);
                String mateLocus = mateChr + ":" + startStr + "-" + endStr;

                Session currentSession = IGV.getInstance().getSession();

                List<String> loci = null;
                if (FrameManager.isGeneListMode()) {
                    loci = new ArrayList<String>(FrameManager.getFrames().size());
                    for (ReferenceFrame ref : FrameManager.getFrames()) {
                        //If the frame-name is a locus, we use it unaltered
                        //Don't want to reprocess, easy to get off-by-one
                        String name = ref.getName();
                        if (Locus.fromString(name) != null) {
                            loci.add(name);
                        } else {
                            loci.add(ref.getFormattedLocusString());
                        }

                    }
                    loci.add(mateLocus);
                } else {
                    loci = Arrays.asList(locus1, mateLocus);
                }

                StringBuffer listName = new StringBuffer();
                for (String s : loci) {
                    listName.append(s + "   ");
                }

                GeneList geneList = new GeneList(listName.toString(), loci, false);
                currentSession.setCurrentGeneList(geneList);

                Comparator<String> geneListComparator = new Comparator<String>() {
                    @Override
                    public int compare(String n0, String n1) {
                        ReferenceFrame f0 = FrameManager.getFrame(n0);
                        ReferenceFrame f1 = FrameManager.getFrame(n1);
                        int chrComp = ChromosomeNameComparator.get().compare(f0.getChrName(), f1.getChrName());
                        if (chrComp != 0) return chrComp;
                        return f0.getCurrentRange().getStart() - f1.getCurrentRange().getStart();
                    }
                };

                //Need to sort the frames by position
                currentSession.sortGeneList(geneListComparator);
                IGV.getInstance().resetFrames();
            } else {
                MessageUtils.showMessage("Alignment does not have mate, or it is not mapped.");
            }
        }
View Full Code Here

        // If a probe file is supplied,  see if there is a user default.  Only do this if the custom file option
        // is set and a probe mapping file has been supplied.
        boolean use_probe_mf;
        String userMappingFile;
        if (!Globals.isHeadless()){
            Session session = IGV.getInstance().getSession();
            use_probe_mf = session.getPreferenceAsBoolean(PreferenceManager.USE_PROBE_MAPPING_FILE);
            userMappingFile = session.getPreference(PreferenceManager.PROBE_MAPPING_FILE);
        }else{
            use_probe_mf = PreferenceManager.getInstance().getAsBoolean(PreferenceManager.USE_PROBE_MAPPING_FILE);
            userMappingFile = PreferenceManager.getInstance().get(PreferenceManager.PROBE_MAPPING_FILE);
        }
       
View Full Code Here


            FileOutputStream out = null;
            token = WaitCursorManager.showWaitCursor();

            Session currentSession = mainFrame.getSession();
            currentSession.setPath(sessionFile.getAbsolutePath());
            (new SessionWriter()).saveSession(currentSession, sessionFile);

            DMUtils.uploadFile(sessionFile, gsPath);

            sessionFile.delete();
View Full Code Here

TOP

Related Classes of org.broad.igv.session.Session

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.