/** * Add the provided SegmentedDataSet to the list of tracks, set other relevant properties * * @param locator * @param newTracks * @param genome * @param ds */ private void loadSegTrack( ResourceLocator locator, List<Track> newTracks, Genome genome, SegmentedDataSet ds) { String path = locator.getPath(); TrackProperties props = null; if (ds instanceof SegmentedAsciiDataSet) { props = ((SegmentedAsciiDataSet) ds).getTrackProperties(); } // The "freq" track. TODO - make this optional if ((ds.getType() == TrackType.COPY_NUMBER || ds.getType() == TrackType.CNV) && ds.getSampleNames().size() > 1) { FreqData fd = new FreqData(ds, genome); String freqTrackId = path; String freqTrackName = "CNV Summary"; CNFreqTrack freqTrack = new CNFreqTrack(locator, freqTrackId, freqTrackName, fd); newTracks.add(freqTrack); } for (String trackName : ds.getSampleNames()) { String trackId = path + "_" + trackName; SegmentedDataSource dataSource = new SegmentedDataSource(trackName, ds); DataSourceTrack track = new DataSourceTrack(locator, trackId, trackName, dataSource); track.setRendererClass(HeatmapRenderer.class); track.setTrackType(ds.getType()); if (props != null) { track.setProperties(props); } newTracks.add(track); } }