private void loadFromDBProfile(ResourceLocator profileLocator, List<Track> newTracks) throws IOException { DBProfile dbProfile = DBProfile.parseProfile(profileLocator.getPath()); for (DBProfile.DBTable table : dbProfile.getTableList()) { SQLCodecSource source = SQLCodecSource.getFromTable(table); if (source != null) { CachingFeatureSource cachingReader = new CachingFeatureSource(source); FeatureTrack track = new FeatureTrack(profileLocator, cachingReader); track.setName(source.getTableName()); newTracks.add(track); } else if (table.getFormat().equals("seg")) { Genome genome = GenomeManager.getInstance().getCurrentGenome(); SegmentedAsciiDataSet ds = (new SegmentedReader(table.getDbLocator(), genome)).loadFromDB(table); loadSegTrack(table.getDbLocator(), newTracks, genome, ds); } else if (table.getFormat().equals("sample.info")) { // TODO sampleIdColumnLabel was previously hardcoded as "SAMPLE_ID_ARRAY" // TODO Basically I'm shoehorning this information into a field usually used for something // else. Only slightly better String sampleIdColumnLabel = table.getBinColName(); if (sampleIdColumnLabel == null) { throw new IllegalArgumentException( "Profile must have binColName specifying the sample id column label"); } (new SampleInfoSQLReader(table, sampleIdColumnLabel)).load(); } } }
private void loadSyntentyMapping(ResourceLocator locator, List<Track> newTracks) { List<BlastMapping> mappings = (new BlastParser()).parse(locator.getPath()); List<htsjdk.tribble.Feature> features = new ArrayList<htsjdk.tribble.Feature>(mappings.size()); features.addAll(mappings); Genome genome = GenomeManager.getInstance().getCurrentGenome(); FeatureTrack track = new FeatureTrack(locator, new FeatureCollectionSource(features, genome)); track.setName(locator.getTrackName()); // track.setRendererClass(AlignmentBlockRenderer.class); newTracks.add(track); }