Esempio n. 1
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);
    }
  }
Esempio n. 2
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);
      }
    }
  }