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

Code
Comments
Other
Rev Date Author Line
6369 07 Sep 21 nicklas 1 package net.sf.basedb.reggie.autoconfirm;
6369 07 Sep 21 nicklas 2
6369 07 Sep 21 nicklas 3 import net.sf.basedb.core.DbControl;
6369 07 Sep 21 nicklas 4 import net.sf.basedb.core.Job;
6369 07 Sep 21 nicklas 5 import net.sf.basedb.core.RawBioAssay;
6369 07 Sep 21 nicklas 6 import net.sf.basedb.core.SessionControl;
6369 07 Sep 21 nicklas 7 import net.sf.basedb.reggie.dao.Annotationtype;
6369 07 Sep 21 nicklas 8 import net.sf.basedb.reggie.dao.BiomaterialList;
6369 07 Sep 21 nicklas 9
6369 07 Sep 21 nicklas 10 /**
6369 07 Sep 21 nicklas 11   Auto-confirm implementation for raw bioassays after running targeted genotyping.
6369 07 Sep 21 nicklas 12   If the genotyping succeeded the rawbioassays are added to the variant search 
6369 07 Sep 21 nicklas 13   index list. In case of a failure, the raw bioassays are marked for re-processing 
6369 07 Sep 21 nicklas 14   and added to the targeted genotyping list.
6369 07 Sep 21 nicklas 15   
6369 07 Sep 21 nicklas 16   @author nicklas
6389 15 Sep 21 nicklas 17   @since 4.32
6369 07 Sep 21 nicklas 18 */
6369 07 Sep 21 nicklas 19 public class TargetedGenotypeAutoConfirmer 
6369 07 Sep 21 nicklas 20   extends AutoConfirmer<Job> 
6369 07 Sep 21 nicklas 21 {
6369 07 Sep 21 nicklas 22   public TargetedGenotypeAutoConfirmer(Job job)
6369 07 Sep 21 nicklas 23   {
6369 07 Sep 21 nicklas 24     super(job, job);
6369 07 Sep 21 nicklas 25   }
6369 07 Sep 21 nicklas 26
6369 07 Sep 21 nicklas 27   /**
6369 07 Sep 21 nicklas 28     Always TRUE.
6369 07 Sep 21 nicklas 29   */
6369 07 Sep 21 nicklas 30   @Override
6369 07 Sep 21 nicklas 31   public boolean checkRules(DbControl dc, AutoConfirmManager manager) 
6369 07 Sep 21 nicklas 32   {
6369 07 Sep 21 nicklas 33     return true;
6369 07 Sep 21 nicklas 34   }
6369 07 Sep 21 nicklas 35   
6369 07 Sep 21 nicklas 36   /**
6369 07 Sep 21 nicklas 37     Set AutoProcessing to ReProcess on the raw bioassays and add 
6369 07 Sep 21 nicklas 38     them to the correct item list for reporting.
6369 07 Sep 21 nicklas 39   */
6369 07 Sep 21 nicklas 40   @Override
6369 07 Sep 21 nicklas 41   public boolean autoConfirm(DbControl dc, AutoConfirmManager manager) 
6369 07 Sep 21 nicklas 42   {
6369 07 Sep 21 nicklas 43     Job job = job(dc);
6369 07 Sep 21 nicklas 44     RawBioAssay variantCall = job.getParameterValue("variantCall");
6369 07 Sep 21 nicklas 45     
6369 07 Sep 21 nicklas 46     if (job.getStatus() == Job.Status.ERROR)
6369 07 Sep 21 nicklas 47     {
6369 07 Sep 21 nicklas 48       Annotationtype.AUTO_PROCESSING.setAnnotationValue(dc, variantCall, "ReProcess");
6369 07 Sep 21 nicklas 49       BiomaterialList.TARGETED_GENOTYPE_PIPELINE.get(dc).add(variantCall);
6369 07 Sep 21 nicklas 50     }
6369 07 Sep 21 nicklas 51     else
6369 07 Sep 21 nicklas 52     {
6369 07 Sep 21 nicklas 53       BiomaterialList.VARIANT_INDEX_TARGETED.get(dc).add(variantCall);
6369 07 Sep 21 nicklas 54     }
6369 07 Sep 21 nicklas 55     return false; // No next step
6369 07 Sep 21 nicklas 56   }
6369 07 Sep 21 nicklas 57
6369 07 Sep 21 nicklas 58   /**
6369 07 Sep 21 nicklas 59     Nothing to do.
6369 07 Sep 21 nicklas 60   */
6369 07 Sep 21 nicklas 61   @Override
6369 07 Sep 21 nicklas 62   public boolean startNextStep(SessionControl sc, AutoConfirmManager manager) 
6369 07 Sep 21 nicklas 63   {
6369 07 Sep 21 nicklas 64     return false;
6369 07 Sep 21 nicklas 65   }
6369 07 Sep 21 nicklas 66
6369 07 Sep 21 nicklas 67 }