Package org.broad.igv.track

Examples of org.broad.igv.track.TrackType



    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


            //The sample names in a GCT file start at column 2,
            int sampleStart = 2;


            String nextLine = null;
            TrackType dataType = TrackType.GENE_EXPRESSION;
            while ((nextLine = reader.readLine()) != null) {

                // A gct row can map to multiple loci, normally this indicates a problem with the probe
                DataRow row = new DataRow(nextLine);
                String probe = row.getProbe();
                if (probe.startsWith("cg")) {
                    dataType = TrackType.DNA_METHYLATION;
                }

                List<Locus> loci = locusHelper.getLoci(probe, row.getDescription(), genome.getId());
                if (loci == null || loci.isEmpty()) {
                    System.out.println("No locus found for: " + probe + "  " + row.getDescription());
                } else {
                    for (Locus locus : loci) {
                        String igvLine = locus.getChr() + "\t" + locus.getStart() + "\t" + locus.getEnd() + "\t" + probe +
                                row.getData();
                        cltn.add(new SortableRecord(locus.getChr(), locus.getStart(), igvLine));
                    }
                }
            }

            writer.println("#type=" + dataType.toString());
            writer.print("Chr\tStart\tEnd\tProbe");
            for (int i = sampleStart; i < tokens.length; i++) {
                writer.print("\t" + tokens[i]);
            }
            writer.println();
View Full Code Here

                        if (nextLine.startsWith("#type")) {
                            String[] tokens = Globals.equalPattern.split(nextLine);
                            if (tokens.length > 1) {
                                try {
                                    // TODO: type is not currently used, is there any reason to keep this?
                                    TrackType type = TrackType.valueOf(tokens[1]);
                                } catch (Exception e) {
                                    log.error("Error converting track type: " + tokens[1]);
                                }
                            }
                        } else if (nextLine.startsWith("#track") || nextLine.startsWith("track")) {
View Full Code Here

TOP

Related Classes of org.broad.igv.track.TrackType

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.