extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/autoconfirm/MBafAutoConfirmer.java

Code
Comments
Other
Rev Date Author Line
5035 17 Oct 18 nicklas 1 package net.sf.basedb.reggie.autoconfirm;
5035 17 Oct 18 nicklas 2
5035 17 Oct 18 nicklas 3 import net.sf.basedb.core.DbControl;
5035 17 Oct 18 nicklas 4 import net.sf.basedb.core.DerivedBioAssay;
5035 17 Oct 18 nicklas 5 import net.sf.basedb.core.Job;
5035 17 Oct 18 nicklas 6 import net.sf.basedb.core.SessionControl;
5035 17 Oct 18 nicklas 7 import net.sf.basedb.reggie.dao.Annotationtype;
5035 17 Oct 18 nicklas 8 import net.sf.basedb.reggie.dao.BiomaterialList;
5035 17 Oct 18 nicklas 9
5035 17 Oct 18 nicklas 10 /**
5035 17 Oct 18 nicklas 11   Auto-confirm implementation for alignments after running mBAF analysis.
5035 17 Oct 18 nicklas 12   This auto-confirmer is needed to handle the case when the analysis fails.
5035 17 Oct 18 nicklas 13   
6021 23 Oct 20 nicklas 14   If the auto-confirmer finds a failed job, it will add the alignment to 
6021 23 Oct 20 nicklas 15   the {@link BiomaterialList#MBAF_PIPELINE} list and set the 
6021 23 Oct 20 nicklas 16   {@link Annotationtype#AUTO_PROCESSING} to ReProcess.
5035 17 Oct 18 nicklas 17   
5035 17 Oct 18 nicklas 18   @author nicklas
5035 17 Oct 18 nicklas 19   @since 4.20
5035 17 Oct 18 nicklas 20 */
5035 17 Oct 18 nicklas 21 public class MBafAutoConfirmer 
5035 17 Oct 18 nicklas 22   extends AutoConfirmer<DerivedBioAssay> 
5035 17 Oct 18 nicklas 23 {
5035 17 Oct 18 nicklas 24   
6021 23 Oct 20 nicklas 25   public MBafAutoConfirmer(Job job)
5035 17 Oct 18 nicklas 26   {
6021 23 Oct 20 nicklas 27     super(job.getParameterValue("alignment"), job);
5035 17 Oct 18 nicklas 28   }
5035 17 Oct 18 nicklas 29
5035 17 Oct 18 nicklas 30   /**
5035 17 Oct 18 nicklas 31     Jobs that has failed passes so that we can re-schedule the alignment
5035 17 Oct 18 nicklas 32     in {@link #autoConfirm(DbControl, AutoConfirmManager)}
5035 17 Oct 18 nicklas 33   */
5035 17 Oct 18 nicklas 34   @Override
5035 17 Oct 18 nicklas 35   public boolean checkRules(DbControl dc, AutoConfirmManager manager) 
5035 17 Oct 18 nicklas 36   {
6021 23 Oct 20 nicklas 37     Job job = job(dc);
6021 23 Oct 20 nicklas 38
5035 17 Oct 18 nicklas 39     // We need to fix failed jobs and just don't care about the reset
5035 17 Oct 18 nicklas 40     return job.getStatus() == Job.Status.ERROR;
5035 17 Oct 18 nicklas 41   }
5035 17 Oct 18 nicklas 42   
5035 17 Oct 18 nicklas 43   /**
6021 23 Oct 20 nicklas 44     Set AutoProcessing to ReProcess on the bioassay and add it to the
6021 23 Oct 20 nicklas 45     mBAF pipeline list.
5035 17 Oct 18 nicklas 46   */
5035 17 Oct 18 nicklas 47   @Override
5035 17 Oct 18 nicklas 48   public boolean autoConfirm(DbControl dc, AutoConfirmManager manager) 
5035 17 Oct 18 nicklas 49   {
5035 17 Oct 18 nicklas 50     DerivedBioAssay alignment = item(dc);
5035 17 Oct 18 nicklas 51     Annotationtype.AUTO_PROCESSING.setAnnotationValue(dc, alignment, "ReProcess");
5035 17 Oct 18 nicklas 52     BiomaterialList.MBAF_PIPELINE.get(dc).add(alignment);
5035 17 Oct 18 nicklas 53     return false; // No next step
5035 17 Oct 18 nicklas 54   }
5035 17 Oct 18 nicklas 55
5035 17 Oct 18 nicklas 56   /**
5035 17 Oct 18 nicklas 57     Nothing to do.
5035 17 Oct 18 nicklas 58   */
5035 17 Oct 18 nicklas 59   @Override
5035 17 Oct 18 nicklas 60   public boolean startNextStep(SessionControl sc, AutoConfirmManager manager) 
5035 17 Oct 18 nicklas 61   {
5035 17 Oct 18 nicklas 62     return false;
5035 17 Oct 18 nicklas 63   }
5035 17 Oct 18 nicklas 64
5035 17 Oct 18 nicklas 65 }