Changeset 5786


Ignore:
Timestamp:
Dec 13, 2019, 9:22:38 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1214: Add support for external specimen

Fixes an issue with generating the secondary analysis top-level folder for external specimen. The old code stopped at the lysate level since it was only considering EXTRACT items. It now moves all the way up to the specimen item and the name of the specimen now becomes the name of the top-level folder.

It seems like all other wizards are working as expected.

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/dao/Library.java

    r5523 r5786  
    77import org.json.simple.JSONObject;
    88
     9import net.sf.basedb.core.BioMaterial;
    910import net.sf.basedb.core.BioWell;
    1011import net.sf.basedb.core.DbControl;
     
    1516import net.sf.basedb.core.ItemQuery;
    1617import net.sf.basedb.core.ItemSubtype;
     18import net.sf.basedb.core.Sample;
    1719import net.sf.basedb.core.Tag;
    1820import net.sf.basedb.core.Type;
     
    193195
    194196  /**
    195     Load the top-most parent item that is an extract. This method is primarily
    196     intended to find the root item (RNA or DNA) for an external library.
    197     @since 4.23
    198   */
    199   public Extract getTopExtract(DbControl dc)
     197    Load the top-most parent item that is an extract or sample. This method is primarily
     198    intended to find the root item (RNA, DNA or Specimen) for an external library.
     199    @since 4.23, 4.25
     200  */
     201  public BioMaterial getTopExtractOrSample(DbControl dc)
    200202  {
    201203    Extract e = getItem();
     204    Sample s = null;
    202205    while (e.getParentType() == Item.EXTRACT)
    203206    {
    204207      e = (Extract)e.getParent();
    205208    }
    206     return e;
     209    if (e.getParentType() == Item.SAMPLE)
     210    {
     211      s = (Sample)e.getParent();
     212      while (s.getParentType() == Item.SAMPLE)
     213      {
     214        s = (Sample)s.getParent();
     215      }
     216    }
     217    return s == null ? e : s;
    207218  }
    208219 
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/DemuxJobCreator.java

    r5592 r5786  
    269269   
    270270    boolean isExternal = Reggie.isExternalItem(mergeName);
    271     String rootName = isExternal ? lib.getTopExtract(dc).getName() : null;
     271    String rootName = isExternal ? lib.getTopExtractOrSample(dc).getName() : null;
    272272   
    273273    String dataFilesFolder = ScriptUtil.checkValidPath(MergedSequences.generateDataFilesFolderForProjectArchive(mergeName, rootName, debug), true, true);
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/MipsDemuxJobCreator.java

    r5619 r5786  
    328328
    329329        String LB = isExternal ? Reggie.removePrefix(lib.getName()) : lib.getName();
    330         String SM = isExternal ? Reggie.removePrefix(lib.getTopExtract(dc).getName()) : LB.replaceFirst("\\.(?!\\d).*", "");
     330        String SM = isExternal ? Reggie.removePrefix(lib.getTopExtractOrSample(dc).getName()) : LB.replaceFirst("\\.(?!\\d).*", "");
    331331       
    332332        // Progress between 25-95%
Note: See TracChangeset for help on using the changeset viewer.