Examples of Locus


Examples of org.broad.igv.feature.Locus


    public static void setToDefaultFrame(String searchString) {
        frames.clear();
        if (searchString != null) {
            Locus locus = getLocus(searchString, 0);
            if (locus != null) {
                getDefaultFrame().jumpTo(locus);
            }
        }
        frames.add(getDefaultFrame());
View Full Code Here

Examples of org.broad.igv.feature.Locus

        getDefaultFrame().recordHistory();
    }

    private static boolean addNewFrame(String searchString){
        boolean locusAdded = false;
        Locus locus = getLocus(searchString);
        if (locus != null) {
            ReferenceFrame referenceFrame = new ReferenceFrame(searchString);
            referenceFrame.jumpTo(locus);
            locusAdded = frames.add(referenceFrame);
        }
View Full Code Here

Examples of org.broad.igv.feature.Locus

            frames.add(getDefaultFrame());
        } else {
            List<String> lociNotFound = new ArrayList();
            List<String> loci = gl.getLoci();
            if (loci.size() == 1) {
                Locus locus = getLocus(loci.get(0));
                if (locus == null) {
                    lociNotFound.add(loci.get(0));
                } else {
                    IGV.getInstance().getSession().setCurrentGeneList(null);
                    getDefaultFrame().jumpTo(locus.getChr(), locus.getStart(), locus.getEnd());
                }
            } else {
                for (String searchString : gl.getLoci()) {
                    if(!addNewFrame(searchString)){
                        lociNotFound.add(searchString);
View Full Code Here

Examples of org.broad.igv.feature.Locus

     * @return The found locus, null if not found
     */
    public static Locus getLocus(String searchString, int flankingRegion) {
        SearchCommand cmd = new SearchCommand(getDefaultFrame(), searchString);
        List<SearchCommand.SearchResult> results = cmd.runSearch(searchString);
        Locus locus = null;
        for (SearchCommand.SearchResult result : results) {
            if (result.getType() != SearchCommand.ResultType.ERROR) {
                int delta = 0;

                if (result.getType() != SearchCommand.ResultType.LOCUS) {
                    if (flankingRegion < 0) {
                        delta = (-flankingRegion * (result.getEnd() - result.getStart())) / 100;
                    } else {
                        delta = flankingRegion;
                    }
                }

                int start = result.getStart() - delta;
                //Don't allow flanking region to extend past origin
                //There are some circumstances in which we render before origin (e.g. soft-clips)
                //so we are conservative
                if (start < 0 && result.getStart() >= -1) {
                    start = 0;
                }
                locus = new Locus(
                        result.getChr(),
                        start,
                        result.getEnd() + delta);
                //We just take the first result
                break;
View Full Code Here

Examples of org.broad.igv.feature.Locus

        FeatureTrack fTrack = (FeatureTrack) track;
        List<Feature> features = fTrack.getFeatures(chr, start, end);
        //Workaround for BEDTools bug, github #88, it can't read an empty file
        if(features.size() == 0 && forbidEmptyOutput){
            features = Arrays.<Feature>asList(new Locus("XXXchr0XXX", 0, 1));
        }
        return super.createTempFile(features, argument);
    }
View Full Code Here

Examples of org.broad.igv.feature.Locus

            if (locusStrings != null) {

                List<Locus> loci = new ArrayList(locusStrings.length);
                for (String ls : locusStrings) {
                    ls = ls.trim();
                    Locus locus = getLocus(ls);
                    if ((locus != null) && locus.isValid()) {
                        loci.add(locus);
                    }
                }
                return loci;
            }
        }

        // Search for locus from the probe name itself.
        Locus locus = getLocus(probeId);
        if ((locus != null) && locus.isValid()) {
            return Arrays.asList(locus);
        }


        // See if the probes can be mapped to genes
View Full Code Here

Examples of org.broad.igv.feature.Locus

    /**
     * Return a locus from the gene (e.g. EGFR) or locus (e.g. chr1:1-100) string
     */
    Locus getLocus(String geneOrLocusString) {
        Locus locus = Locus.fromString(geneOrLocusString);
        if (locus != null && locus.isValid()) {
            return locus;
        } else {
            // Maybe its a gene or feature
            Feature gene = FeatureDB.getFeature(geneOrLocusString);
            if (gene != null) {
                return new Locus(gene.getChr(), gene.getStart(), gene.getEnd());
            }
        }
        return null;
    }
View Full Code Here

Examples of org.broad.igv.feature.Locus

                    try {
                        String chr = tokens[0];
                        int start = (int) Double.parseDouble(tokens[1]);
                        int end = (int) Double.parseDouble(tokens[2]);
                        String probe = tokens[3];
                        Locus locus = new Locus(chr, start, end);
                        probeLocusMap.put(probe, Arrays.asList(locus));
                    } catch (NumberFormatException e) {
                        log.info("Skipping line: " + nextLine);
                        errorCount++;
                        if (errorCount > maxErrors) {
View Full Code Here

Examples of org.broad.igv.feature.Locus

        Collection<Track> trackList = IGV.getInstance().getAllTracks();
        int flankingRegion = 1; //PreferenceManager.getInstance().getAsInt(PreferenceManager.FLANKING_REGION) + 1;
        String genomeId = GenomeManager.getInstance().getGenomeId();
        for (ReferenceFrame frame : FrameManager.getFrames()) {
            Locus locus = frame.getInitialLocus();
            if (locus != null) {
                for (Track track : trackList) {
                    if (track == null) continue;
                    if (track.isVisible()) {
                        if (track instanceof DataTrack) {
View Full Code Here

Examples of org.broad.igv.feature.Locus

                                    getAttribute((Element) childNode, SessionAttribute.START.getText()).replace(",", "");
                            final String endString =
                                    getAttribute((Element) childNode, SessionAttribute.END.getText()).replace(",", "");
                            int start = ParsingUtils.parseInt(startString);
                            int end = ParsingUtils.parseInt(endString);
                            org.broad.igv.feature.Locus locus = new Locus(chr, start, end);
                            f.jumpTo(locus);
                        } catch (NumberFormatException e) {
                            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                        }
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.