Examples of GisticTrack


Examples of org.broad.igv.track.GisticTrack

            reader.readLine();
            rowCounter++;

            // Parse data
            // parameters to track chromosome breaks. Used in wholeGenome case.
            GisticTrack track = new GisticTrack(locator);
            track.setName(locator.getTrackName());
            List<GisticScore> scores = new ArrayList();

            nextLine = reader.readLine();
            rowCounter++;

            while ((nextLine != null) && (nextLine.length() > 0)) {
                String[] tokens = nextLine.split("\t");

                GisticScore.Type type = getType(tokens[0].trim());
                String chr = genome.getChromosomeAlias(tokens[1].trim());

                int start = -1;
                try {
                    start = Integer.parseInt(tokens[2]);
                }
                catch (NumberFormatException ne) {
                    throw new ParserException("Column 3 must be a numeric value.", rowCounter, nextLine);
                }

                int end = -1;
                try {
                    end = Integer.parseInt(tokens[3]);
                }
                catch (NumberFormatException ne) {
                    throw new ParserException("Column 4 must be a numeric value.", rowCounter, nextLine);
                }

                float qValue = 0;
                try {
                    qValue = Float.parseFloat(tokens[4]);
                } catch (NumberFormatException numberFormatException) {
                    if (tokens[4].toLowerCase().equals("inf")) {
                        qValue = Float.POSITIVE_INFINITY;
                    } else {
                        qValue = Float.NaN;
                    }
                }

                try {
                    float gScore = Float.parseFloat(tokens[5]);
                    scores.add(new GisticScore(chr, start, end, qValue, gScore, type));

                }
                catch (Exception ex) {
                    log.error("Skipping line: " + nextLine, ex);
                }

                nextLine = reader.readLine();
                rowCounter++;
            }

            if (scores.isEmpty()) {
                throw new RuntimeException("No gistic scores were found.");
            } else {
                track.setScores(scores);
                computeWholeGenome(track, genome);
                return track;
            }

        } catch (FileNotFoundException e) {
View Full Code Here

Examples of org.broad.igv.track.GisticTrack

    // TODO -- need to combine the amp and del regions with a parameter.  Remove
    // duplicated code.
    private void plotScores(Track track, RenderContext context, Rectangle rect) {

        GisticTrack gisticTrack = (GisticTrack) track;
        String chr = context.getChr();

        float maxQValue = transform(track.getDataRange().getMaximum());
        if (maxQValue > 0) {
            double scale = (rect.getHeight() - 5) / maxQValue;

            // TODO use offset
            int xStart = (int) rect.getX();
            int yStart = (int) rect.getMaxY();

            //long chromosomeEnd = offset + Genome.getInstance().getChromosomeLength(chr);
            int xEnd = (int) rect.getWidth(); //vc.getPy(chromosomeEnd) - 1;

            List<GisticScore> scores = gisticTrack.getAmpScores(chr);
            if (scores != null) {
                Graphics2D g2D = context.getGraphic2DForColor(Color.RED);
                plotScoresOn(scores, g2D, rect, xEnd, scale, context, xStart, yStart);
            }

            scores = gisticTrack.getDelScores(chr);
            if (scores != null) {
                Graphics2D g2D = context.getGraphic2DForColor(Color.BLUE);
                plotScoresOn(scores, g2D, rect, xEnd, scale, context, xStart, yStart);
            }
        }
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.