Package org.broad.igv.renderer

Examples of org.broad.igv.renderer.ContinuousColorScale


    Map<TrackType, ContinuousColorScale> colorScales = new HashMap<TrackType, ContinuousColorScale>();

    private Color getDataColor(String categoryName, double categoryValue) {
        TrackType tt = TrackType.valueOf(categoryName);
        ContinuousColorScale scale = colorScales.get(tt);
        if (scale == null) {
            scale = PreferenceManager.getInstance().getColorScale(tt);// IGV.getInstance().getSession().getColorScale(tt);
        }
        return scale.getColor((float) categoryValue);

    }
View Full Code Here


                    colorScales.put(attKey, scale);
                } else {
                    Color color1 = ColorUtilities.stringToColor(tokens[2]);
                    Color color2 = ColorUtilities.stringToColor(tokens[3]);
                    if (min < 0) {
                        scale = new ContinuousColorScale(min, 0, max, color1, Color.white, color2);
                    } else {
                        scale = new ContinuousColorScale(min, max, color1, color2);
                    }
                }
                colorScales.put(attKey, scale);

            } else {
View Full Code Here

                    if (metaData.isDiverging()) {
                        // reg-blue diverging
                        Color minColor = new Color(198, 219, 239);
                        Color midColor = Color.white;
                        Color maxColor = new Color(33, 102, 172);
                        cs = new ContinuousColorScale(metaData.getMin(), 0, metaData.getMax(), minColor, midColor, maxColor);
                        colorScales.put(attKey, cs);

                    } else {
                        // Blues scale
                        Color minColor = new Color(198, 219, 239);
                        Color maxColor = new Color(8, 69, 148);
                        cs = new ContinuousColorScale(metaData.getMin(), metaData.getMax(), minColor, maxColor);
                        colorScales.put(attKey, cs);
                    }
                }
                try {
                    float x = Float.parseFloat(attValue);
View Full Code Here

    /**
     * Creates new form DataScaleDialog2
     */
    public HeatmapScaleDialog(java.awt.Frame parent, ContinuousColorScale colorScale) {
        super(parent, true);
        this.colorScale = new ContinuousColorScale(colorScale);
        initComponents();

        minField.setText(String.valueOf(colorScale.getMinimum()));
        maxField.setText(String.valueOf(colorScale.getMaximum()));
        neutralFromField.setText(String.valueOf(colorScale.getNegStart()));
View Full Code Here

            // Make +/- scale symmetic
            float range = Math.min(5, Math.abs(Math.max(inputTrack.getDataRange().getMinimum(), inputTrack.getDataRange().getMaximum())));
            inputTrack.setDataRange(new DataRange(-range, 0, range));
            inputTrack.setColor(Color.RED);
            inputTrack.setAltColor(Color.BLUE);
            inputTrack.setColorScale(new ContinuousColorScale(-range, 0, range, Color.RED, Color.WHITE, Color.BLUE));
        }

        else {
            inputTrack.setDataRange(new DataRange(inputTrack.getDataRange().getMinimum(), 0, inputTrack.getDataRange().getMaximum()));
        }
View Full Code Here

    public ContinuousColorScale getColorScale(TrackType type) {
        if (type == null) {
            return null;
        }

        ContinuousColorScale scale = colorScaleCache.get(type);

        if (scale == null && scaledTypes.contains(type)) {
            String colorScaleString = get(COLOR_SCALE_KEY + type.toString(), null);
            if (colorScaleString != null) {
                scale = (ContinuousColorScale) ColorScaleFactory.getScaleFromString(colorScaleString);
            } else {
                scale = getDefaultColorScale(type);
            }
            if (scale != null) {
                scale.setDefault(true);
                colorScaleCache.put(type, scale);
            }
        }
        return scale;
    }
View Full Code Here

     * @return
     */
    public ContinuousColorScale getDefaultColorScale(TrackType type) {
        switch (type) {
            case LOH:
                return new ContinuousColorScale(0, -1, 0, 1, Color.red, UIConstants.LIGHT_YELLOW, Color.blue);
            case RNAI:
            case POOLED_RNAI:
                ContinuousColorScale cs = new ContinuousColorScale(0, -3, 0, 3, Color.red, Color.white, Color.blue);
                cs.setNoDataColor(new Color(225, 225, 225));
                return cs;

            case DNA_METHYLATION:
                cs = new ContinuousColorScale(0, 1, Color.BLUE, Color.RED);
                cs.setNoDataColor(Color.WHITE);
                return cs;

            case GENE_EXPRESSION:
                cs = new ContinuousColorScale(-0.1, -1.5, 0.1, 1.5, Color.BLUE, Color.WHITE, Color.RED);
                cs.setNoDataColor(new Color(225, 225, 225));
                return cs;

            case COPY_NUMBER:
            case ALLELE_SPECIFIC_COPY_NUMBER:
            case CNV:
                return new ContinuousColorScale(-0.1, -1.5, 0.1, 1.5, Color.BLUE, Color.WHITE, Color.RED);

            default:
                return null;
        }
    }
View Full Code Here

        int dist = Math.abs(pair.getInferredInsertSize());
        double logDist = Math.log(dist);
        Color minColor = smallISizeColor;
        Color maxColor = largeISizeColor;
        ContinuousColorScale colorScale = new ContinuousColorScale(0, 20, minColor, maxColor);
        return colorScale.getColor((float) logDist);
    }
View Full Code Here

            double posEnd = Double.parseDouble(posRangeEnd.getText());
            negStart = Double.parseDouble(negRangeStart.getText());
            negEnd = Double.parseDouble(negRangeEnd.getText());


            colorScheme = new ContinuousColorScale(
                    Math.max(negStart, negEnd),
                    Math.min(negStart, negEnd),
                    Math.min(posStart, posEnd),
                    Math.max(posStart, posEnd),
                    minColor.getSelectedColor(),
View Full Code Here

TOP

Related Classes of org.broad.igv.renderer.ContinuousColorScale

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.