Changeset 1560


Ignore:
Timestamp:
Mar 14, 2012, 2:57:45 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #364: Put RNA aliquots on bioplate to be used by the Caliper machine

  • Suffix '.qc' instead of '.qc1' for first RNAQC aliquot
  • Queries should be filtered to only return items shared to the current project
Location:
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie
Files:
4 edited

Legend:

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

    r1558 r1560  
    55import java.util.Collections;
    66import java.util.List;
     7import java.util.Set;
    78
    89import net.sf.basedb.core.Annotatable;
     
    267268  public static final StringToDateConverter CONVERTER_STRING_TO_DATETIME = new StringToDateConverter(new SimpleDateFormat("yyyyMMdd HHmm"));
    268269 
     270  /**
     271    Include options to make a query only return items in the currently active project.
     272    Use with {@link ItemQuery#setIncludes(java.util.Collection)}
     273    @since 2.4
     274  */
     275  public static final Set<Include> INCLUDE_IN_CURRENT_PROJECT = Collections.singleton(Include.IN_PROJECT);
    269276 
    270277  /**
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/ReactionPlate.java

    r1553 r1560  
    5555  {
    5656    ItemQuery<BioPlate> query = BioPlate.getQuery();
     57    query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
    5758    if (subtype != null || bioPlateType != null)
    5859    {
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Rna.java

    r1543 r1560  
    1212import net.sf.basedb.core.query.Orders;
    1313import net.sf.basedb.core.query.Restrictions;
     14import net.sf.basedb.reggie.Reggie;
    1415
    1516/**
     
    3536    // Create a query that load all RNA extracts that has at least one RNAQC child extract
    3637    ItemQuery<Extract> subquery = Extract.getQuery();
     38    subquery.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
    3739    // Filter on RNA subtype
    3840    Subtype.RNA.addFilter(dc, subquery);
     
    4547   
    4648    ItemQuery<Extract> query = Extract.getQuery();
     49    query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
    4750    // Filter on RNA subtype
    4851    Subtype.RNA.addFilter(dc, query);
     
    5053    query.restrict(Restrictions.neq(Hql.property("id"), Expressions.all(subquery)));
    5154   
    52     query.order(Orders.desc(Hql.property("id")));
    53     query.include(Include.ALL);
    54     query.exclude(Include.REMOVED);
     55    query.order(Orders.asc(Hql.property("id")));
    5556   
    5657    List<Extract> extracts = query.list(dc);
     
    8788  /**
    8889    Find the next name to give a RNAQC child item. This assumes that
    89     all child items are using the naming convention. foo.qc1, foo.qc2, and
    90     so on.
     90    all child items are using the naming convention. foo.qc, foo.qc2, and
     91    so on. NOTE! The first child item have no number!
    9192    @return The next unused name
    9293  */
     
    100101    query.include(Include.ALL);
    101102    long count = query.count(dc);
    102    
    103     return rna.getName() + ".qc" + (count+1);
     103    return rna.getName() + ".qc" + (count == 0 ? "" : count+1);
    104104  }
    105105 
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/RnaQcServlet.java

    r1552 r1560  
    109109        for (Rna r : rna)
    110110        {
    111           r.setAnnotation("nextRnaQcName", r.getName()+".qc1");
     111          r.setAnnotation("nextRnaQcName", r.getName()+".qc");
    112112          r.loadAnnotations(dc, "NDConc", Reggie.ANNOTATION_ND_CONC, null);
    113113          jsonRna.add(r.asJSONObject());
     
    138138        dc = sc.newDbControl();
    139139        ItemQuery<Protocol> query = Protocol.getQuery();
     140        query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
    140141        Subtype.QUALITY_CONTROL.addFilter(dc, query);
    141142       
Note: See TracChangeset for help on using the changeset viewer.