Changeset 2109


Ignore:
Timestamp:
Oct 29, 2013, 12:56:07 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #502 and #481.

Added PooledLibraryAliquot subtype which must be used by the intermediary aliquots connecting flow cells with pooled libraries. This is required so that we can maintain an unbroken link of related subtypes. The previous version linked FlowCell directly to PooledLibrary which was incorrect.

The registration wizard now also sets the creation date for the aliquots to the ClusterDate.

Existing aliquot items should be updated manually or by a batch importer to set subtype=PooledLibraryAliquot and creation date=ClusterDate (taken from the flow cell the aliquot is used on).

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/Subtype.java

    r2107 r2109  
    177177
    178178  /**
     179    The definition of the "PooledLibraryAliquot" extract subtype.
     180    @since 2.12
     181  */
     182  public static final Subtype POOLED_LIBRARY_ALIQUOT = new Subtype("PooledLibraryAliquot", Item.EXTRACT, false);
     183
     184 
     185  /**
    179186    The definition of the "FlowCell" physical bioassay subtype.
    180187    @since 2.12
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java

    r2107 r2109  
    271271        dc = sc.newDbControl();
    272272        ItemSubtype flowCellType = Subtype.FLOW_CELL.load(dc);
     273        ItemSubtype poolAliquotType = Subtype.POOLED_LIBRARY_ALIQUOT.load(dc);
    273274       
    274275        Map<Number, Integer> numChildren = new HashMap<Number, Integer>();
     
    325326            numChildren.put(poolId, num);
    326327            poolA.setName(pool.getName()+".a" + num);
     328            poolA.setItemSubtype(poolAliquotType);
    327329            BioMaterialEventSource srcA = poolA.getCreationEvent().setSource(pool);
    328330
     
    417419          Annotationtype.FLOWCELL_ID.setAnnotationValue(dc, flowCell, jsonFlowCell.get("externalId"));
    418420         
     421          // Load pool aliquots for all lanes
     422          ItemQuery<Extract> aliquotQuery = flowCell.getExtracts(0);
     423          aliquotQuery.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
     424          List<Extract> aliquots = aliquotQuery.list(dc);
     425         
     426          // Set creation date on aliquots
     427          for (Extract poolA : aliquots)
     428          {
     429            poolA.getCreationEvent().setEventDate(clusterDate);
     430          }
     431         
    419432          if (failed)
    420433          {
     
    422435            // Typically, most pools have enough material to try clustering again but that
    423436            // the responsibility of another wizard
    424             ItemQuery<Extract> query = flowCell.getExtracts(0);
    425             for (Extract poolA : query.list(dc))
     437            for (Extract poolA : aliquots)
    426438            {
    427439              Extract pool = (Extract)poolA.getParent();
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r2107 r2109  
    160160        jsonChecks.add(checkSubtype(dc, Subtype.POOLING_PROTOCOL, createIfMissing));
    161161        jsonChecks.add(checkSubtype(dc, Subtype.POOLED_LIBRARY, createIfMissing, Subtype.LIBRARY, Subtype.POOLING_PROTOCOL));
     162        jsonChecks.add(checkSubtype(dc, Subtype.POOLED_LIBRARY_ALIQUOT, createIfMissing, Subtype.POOLED_LIBRARY));
    162163        jsonChecks.add(checkSubtype(dc, Subtype.CLUSTER_PROTOCOL, createIfMissing));
    163164        jsonChecks.add(checkSubtype(dc, Subtype.CLUSTER_GENERATOR, createIfMissing));
    164         jsonChecks.add(checkSubtype(dc, Subtype.FLOW_CELL, createIfMissing, Subtype.POOLED_LIBRARY, Subtype.CLUSTER_GENERATOR, Subtype.CLUSTER_PROTOCOL));
     165        jsonChecks.add(checkSubtype(dc, Subtype.FLOW_CELL, createIfMissing, Subtype.POOLED_LIBRARY_ALIQUOT, Subtype.CLUSTER_GENERATOR, Subtype.CLUSTER_PROTOCOL));
    165166        jsonChecks.add(checkSubtype(dc, Subtype.BIOANALYZER_PDF, createIfMissing));
    166167        jsonChecks.add(checkSubtype(dc, Subtype.CALIPER_PDF, createIfMissing));
     
    856857          else if (!r.getName().equals(related.getName()))
    857858          {
    858             json.put("status", "error");
    859             jsonMessages.add("Should be related to: '" +
    860                 related.getName() + "' not '" + r.getName() + "'");
     859            if (createIfMissing)
     860            {
     861              s.setRelatedSubtype(related.get(dc));
     862              jsonMessages.add("Fixed");
     863            }
     864            else
     865            {
     866              json.put("status", "incomplete");
     867              jsonMessages.add("Should be related to: '" +
     868                  related.getName() + "' not '" + r.getName() + "'");
     869            }
    861870          }
    862871        }
Note: See TracChangeset for help on using the changeset viewer.