2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.model
.molecular
;
11 import javax
.persistence
.Entity
;
12 import javax
.persistence
.FetchType
;
13 import javax
.persistence
.JoinColumn
;
14 import javax
.persistence
.ManyToOne
;
15 import javax
.validation
.constraints
.Size
;
16 import javax
.xml
.bind
.annotation
.XmlAccessType
;
17 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
18 import javax
.xml
.bind
.annotation
.XmlElement
;
19 import javax
.xml
.bind
.annotation
.XmlIDREF
;
20 import javax
.xml
.bind
.annotation
.XmlRootElement
;
21 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
22 import javax
.xml
.bind
.annotation
.XmlType
;
24 import org
.apache
.log4j
.Logger
;
25 import org
.hibernate
.annotations
.Cascade
;
26 import org
.hibernate
.annotations
.CascadeType
;
27 import org
.hibernate
.envers
.Audited
;
28 import org
.hibernate
.search
.annotations
.Analyze
;
29 import org
.hibernate
.search
.annotations
.Field
;
30 import org
.hibernate
.search
.annotations
.IndexedEmbedded
;
31 import org
.hibernate
.search
.annotations
.NumericField
;
33 import eu
.etaxonomy
.cdm
.model
.agent
.Institution
;
34 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
35 import eu
.etaxonomy
.cdm
.model
.common
.EventBase
;
36 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
37 import eu
.etaxonomy
.cdm
.model
.occurrence
.MaterialOrMethodEvent
;
40 * The physical process of amplification (also called PCR) extracts and replicates parts of the DNA of
41 * a given {@link #getDnaSample() DNA Sample} . The part of the DNA being replicated is defined by the
42 * {@link #getDnaMarker() marker} (also called locus) - implemented in CDM as a {@link DefinedTerm}
43 * of term type {@link TermType#DnaMarker}.
44 * <BR>To execute the replication {@link Primer primers} (short DNA fractions) are
45 * used. They may work in both directions of the DNA part therefore we do have a
46 * {@link #getForwardPrimer() forward primer} and a {@link #getReversePrimer() reverse primer}.
47 * Most (or all?) amplifications require a {@link #getPurification() purification process}. Additionally
48 * some use {@link #getCloning()} for replication.
49 * <H3>Quality control</H3>
50 * <BR>For quality control the resulting product (PCR) is tested using a chromatographic method called
51 * electrophoresis. The parameters (voltage, ladder used, running time, and gel concentration) used
52 * for this electrophoresis as well as the resulting
53 * {@link #getGelPhoto() photo} can also be stored in the amplification instance.
54 * <BR>The resulting PCR will later be used in a {@link SingleRead DNA sequence reading process}.
55 * The PCR itself is not persistent and therefore will not be stored in the CDM.
56 * This may change in future: http://dev.e-taxonomy.eu/trac/ticket/3717.
63 @XmlAccessorType(XmlAccessType
.FIELD
)
64 @XmlType(name
= "Amplification", propOrder
= {
71 "electrophoresisVoltage",
75 @XmlRootElement(name
= "Amplification")
78 public class Amplification
extends EventBase
implements Cloneable
{
79 private static final long serialVersionUID
= -6382383300974316261L;
81 private static final Logger logger
= Logger
.getLogger(Amplification
.class);
83 /** @see #getDnaMarker()*/
84 @XmlElement(name
= "DnaMarker")
86 @XmlSchemaType(name
= "IDREF")
87 //TODO why is this eager?
88 @ManyToOne(fetch
=FetchType
.EAGER
)
89 private DefinedTerm dnaMarker
;
91 /** @see #getForwardPrimer() */
92 @XmlElement(name
= "ForwardPrimer")
94 @XmlSchemaType(name
= "IDREF")
95 @ManyToOne(fetch
=FetchType
.LAZY
)
96 @Cascade({CascadeType
.SAVE_UPDATE
})
97 private Primer forwardPrimer
;
99 /** @see #getReversePrimer()*/
100 @XmlElement(name
= "ReversePrimer")
102 @XmlSchemaType(name
= "IDREF")
103 @ManyToOne(fetch
=FetchType
.LAZY
)
104 @Cascade({CascadeType
.SAVE_UPDATE
})
105 private Primer reversePrimer
;
108 @XmlElement(name
= "Purification")
110 @XmlSchemaType(name
= "IDREF")
111 @ManyToOne(fetch
=FetchType
.LAZY
)
112 @Cascade({CascadeType
.SAVE_UPDATE
})
113 private MaterialOrMethodEvent purification
;
115 @XmlElement(name
= "Institution")
117 @XmlSchemaType(name
= "IDREF")
118 @ManyToOne(fetch
= FetchType
.LAZY
)
120 @Cascade(CascadeType
.SAVE_UPDATE
)
121 @JoinColumn(name
="institution_id")
122 private Institution institution
;
124 /** @see #getLadderUsed() */
125 @XmlElement(name
= "ladderUsed")
128 private String ladderUsed
;
130 /** @see #getElectrophoresisVoltage()*/
131 @XmlElement(name
= "electrophoresisVoltage")
132 @Field(analyze
= Analyze
.NO
)
134 private Double electrophoresisVoltage
;
136 /** @see #getGelRunningTime() */
137 @XmlElement(name
= "gelRunningTime")
138 @Field(analyze
= Analyze
.NO
)
140 private Double gelRunningTime
;
142 /** @see #getGelConcentration() */
143 @XmlElement(name
= "gelConcentration")
144 @Field(analyze
= Analyze
.NO
)
146 private Double gelConcentration
;
149 // ********************* FACTORY METHODS ************************/
151 public static Amplification
NewInstance(){
152 return new Amplification();
156 // ******************* CONSTRUCTOR *******************************/
158 protected Amplification(){}
161 //********************* GETTER / SETTER ************/
165 * The {@link TermType#DnaMarker DNA marker} used for this amplification.
166 * The DNA marker also defines the part (locality) of the DNA/RNA examined.
167 * It may also be called <i>locus</i>
169 public DefinedTerm
getDnaMarker() {
172 /** @see #getDnaMarker()*/
173 public void setDnaMarker(DefinedTerm marker
) {
174 this.dnaMarker
= marker
;
178 * The primer used for forward amplification.
179 * @see #getReversePrimer()
181 public Primer
getForwardPrimer() {
182 return forwardPrimer
;
185 * @see #getForwardPrimer()
186 * @see #getReversePrimer()
188 public void setForwardPrimer(Primer forwardPrimer
) {
189 this.forwardPrimer
= forwardPrimer
;
193 * The primer used for reverse amplification.
194 * @see #getForwardPrimer()
196 public Primer
getReversePrimer() {
197 return reversePrimer
;
200 * @see #getReversePrimer()
201 * @see #getForwardPrimer()
203 public void setReversePrimer(Primer reversePrimer
) {
204 this.reversePrimer
= reversePrimer
;
209 * The material and/or method used for purification.
211 public MaterialOrMethodEvent
getPurification() {
215 * @see #getPurification()
217 public void setPurification(MaterialOrMethodEvent purification
) {
218 this.purification
= purification
;
222 * The institution in which the amplification event took place.
223 * Usually the {@link Amplification#getActor()} should be a person
224 * or team that works for this institution at the given time
225 * @return the institution
228 public Institution
getInstitution() {
232 * @see #getInstitution()
234 public void setInstitution(Institution institution
) {
235 this.institution
= institution
;
239 * The voltage used for running the electrophoresis quality check.
240 * Base unit is voltage [V].
241 * @see #getGelRunningTime()
242 * @see #getGelPhoto()
243 * @see #getLadderUsed()
244 * @see #getGelConcentration()
247 public Double
getElectrophoresisVoltage() {
248 return electrophoresisVoltage
;
251 * @see #getElectrophoresisVoltage()
253 public void setElectrophoresisVoltage(Double electrophoresisVoltage
) {
254 this.electrophoresisVoltage
= electrophoresisVoltage
;
258 * The time for running the electrophoresis quality check.
259 * Base unit is minutes [min].
261 public Double
getGelRunningTime() {
262 return gelRunningTime
;
265 * @see #getGelRunningTime()
267 public void setGelRunningTime(Double gelRunningTime
) {
268 this.gelRunningTime
= gelRunningTime
;
273 * The gel concentration used for the electrophoresis.
275 * @see #getElectrophoresisVoltage()
276 * @see #getGelRunningTime()
277 * @see #getGelPhoto()
278 * @see #getLadderUsed()
280 public Double
getGelConcentration() {
281 return gelConcentration
;
284 * @see #getGelConcentration()
286 public void setGelConcentration(Double gelConcentration
) {
287 this.gelConcentration
= gelConcentration
;
291 * Material and method used for testing quality of this amplification.
292 * @see #getElectrophoresisVoltage()
293 * @see #getGelPhoto()
294 * @see #getGelConcentration()
295 * @see #getGelRunningTime()
297 public String
getLadderUsed() {
301 * @see #getLadderUsed()
303 public void setLadderUsed(String ladderUsed
) {
304 this.ladderUsed
= ladderUsed
;
308 // ********************** CLONE ***********************************/
310 * Clones <i>this</i> amplification. This is a shortcut that enables to create
311 * a new instance that differs only slightly from <i>this</i> amplification by
312 * modifying only some of the attributes.<BR><BR>
315 * @see EventBase#clone()
316 * @see java.lang.Object#clone()
319 public Object
clone() {
321 Amplification result
= (Amplification
)super.clone();
323 //don't change marker, forwardPrimer, reversePrimer,
324 //purifiaction, ladderUsed, electrophoresisVoltage,
325 //gelRunningTime, gelConcentration
327 }catch (CloneNotSupportedException e
) {
328 logger
.warn("Object does not implement cloneable");