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 |
Auto-confirm implementation for alignments after running mBAF analysis. |
5035 |
17 Oct 18 |
nicklas |
This auto-confirmer is needed to handle the case when the analysis fails. |
5035 |
17 Oct 18 |
nicklas |
13 |
|
6021 |
23 Oct 20 |
nicklas |
If the auto-confirmer finds a failed job, it will add the alignment to |
6021 |
23 Oct 20 |
nicklas |
the {@link BiomaterialList#MBAF_PIPELINE} list and set the |
6021 |
23 Oct 20 |
nicklas |
{@link Annotationtype#AUTO_PROCESSING} to ReProcess. |
5035 |
17 Oct 18 |
nicklas |
17 |
|
5035 |
17 Oct 18 |
nicklas |
@author nicklas |
5035 |
17 Oct 18 |
nicklas |
@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 |
Jobs that has failed passes so that we can re-schedule the alignment |
5035 |
17 Oct 18 |
nicklas |
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 |
// 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 |
Set AutoProcessing to ReProcess on the bioassay and add it to the |
6021 |
23 Oct 20 |
nicklas |
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 |
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 |
} |