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

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