Exemplo n.º 1
0
  private void loadIGVFile(ResourceLocator locator, List<Track> newTracks, Genome genome) {

    if (locator.isLocal()) {
      if (!checkSize(locator)) {
        return;
      }
    }

    String dsName = locator.getTrackName();
    IGVDataset ds = new IGVDataset(locator, genome);
    ds.setName(dsName);

    TrackProperties trackProperties = ds.getTrackProperties();
    String path = locator.getPath();
    TrackType type = ds.getType();
    for (String trackName : ds.getTrackNames()) {

      DatasetDataSource dataSource = new DatasetDataSource(trackName, ds, genome);
      String trackId = path + "_" + trackName;
      DataSourceTrack track = new DataSourceTrack(locator, trackId, trackName, dataSource);

      // track.setRendererClass(HeatmapRenderer.class);
      track.setTrackType(ds.getType());
      track.setProperties(trackProperties);

      if (type == TrackType.ALLELE_FREQUENCY) {
        track.setRendererClass(PointsRenderer.class);
        track.setHeight(40);
      }
      newTracks.add(track);
    }
  }
Exemplo n.º 2
0
  /**
   * Load a rnai gene score file and create a datasource and track.
   *
   * <p>
   *
   * @param locator
   * @param newTracks
   */
  private void loadRNAiGeneScoreFile(
      ResourceLocator locator,
      List<Track> newTracks,
      RNAIGeneScoreParser.Type type,
      Genome genome) {

    RNAIGeneScoreParser parser = new RNAIGeneScoreParser(locator.getPath(), type, genome);

    Collection<RNAIDataSource> dataSources = parser.parse();
    String path = locator.getPath();
    for (RNAIDataSource ds : dataSources) {
      String name = ds.getName();
      String trackId = path + "_" + name;
      DataSourceTrack track = new DataSourceTrack(locator, trackId, name, ds);

      // Set attributes.  This "hack" is neccessary to register these attributes with the
      // attribute manager to get displayed.
      track.setAttributeValue("SCREEN", ds.getScreen());
      if ((ds.getCondition() != null) && (ds.getCondition().length() > 0)) {
        track.setAttributeValue("CONDITION", ds.getCondition());
      }
      track.setHeight(80);
      // track.setDataRange(new DataRange(-3, 0, 3));
      newTracks.add(track);
    }
  }
Exemplo n.º 3
0
  private void loadRnaiGctFile(ResourceLocator locator, List<Track> newTracks, Genome genome) {

    RNAIGCTDatasetParser parser = new RNAIGCTDatasetParser(locator, genome);

    Collection<RNAIDataSource> dataSources = parser.parse();
    if (dataSources != null) {
      String path = locator.getPath();
      for (RNAIDataSource ds : dataSources) {
        String trackId = path + "_" + ds.getName();
        DataSourceTrack track = new DataSourceTrack(locator, trackId, ds.getName(), ds);

        // Set attributes.
        track.setAttributeValue("SCREEN", ds.getScreen());
        track.setHeight(80);
        newTracks.add(track);
      }
    }
  }