Changeset 5942


Ignore:
Timestamp:
May 18, 2020, 8:33:07 AM (3 weeks ago)
Author:
Nicklas Nordborg
Message:

References #1239: Include Single Sample Predictor models in the StringTie? pipeline

Added checks before using configured models also in the auto-confirmation path.

Location:
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/autoconfirm/StringTieAutoConfirmer.java

    r5922 r5942  
    11package net.sf.basedb.reggie.autoconfirm;
    22
     3import java.util.ArrayList;
    34import java.util.Collections;
    45import java.util.List;
     
    8990      if (sspDisabled) return false;
    9091     
    91       List<String> models = SspModel.getModelNames();
    92       if (models == null || models.isEmpty()) return false;
     92      List<String> models = new ArrayList<String>();
     93      for (SspModel m : SspModel.getValidModels(dc))
     94      {
     95        models.add(m.getName());
     96      }
     97      if (models.isEmpty()) return false;
    9398     
    9499      SspPlugin.createAnalysisJob(dc, Collections.singletonList(raw), models);
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/ssp/SspModel.java

    r5941 r5942  
    5151    }
    5252   
     53    return models;
     54  }
     55 
     56  /**
     57    Get a list with all SSP models that has a valid annotation type and
     58    .Rdata file. Eg. this method returns models where {@link #getAnnotationType(DbControl)}
     59    returns an existing annotation type and {@link #modelDataExists()} returns true.
     60  */
     61  public static List<SspModel> getValidModels(DbControl dc)
     62  {
     63    List<SspModel> models = new ArrayList<SspModel>();
     64    for (SspModel m : getConfiguredModels())
     65    {
     66      if (m.modelDataExists() && m.getAnnotationType(dc) != null)
     67      {
     68        models.add(m);
     69      }
     70    }
    5371    return models;
    5472  }
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/ssp/SspPlugin.java

    r5941 r5942  
    513513  {
    514514    Enumeration<String, String> reportOptions = new Enumeration<String, String>();
    515     List<SspModel> models = SspModel.getConfiguredModels();
     515    List<SspModel> models = SspModel.getValidModels(dc);
    516516    //Collections.sort(models);
    517517    for (SspModel model : models)
    518518    {
    519       if (model.getAnnotationType(dc) != null && model.modelDataExists())
    520       {
    521         String name = model.getName();
    522         reportOptions.add(name, name);
    523       }
     519      String name = model.getName();
     520      reportOptions.add(name, name);
    524521    }
    525522
Note: See TracChangeset for help on using the changeset viewer.