001/*
002 * mzTab-M reference implementation and validation API.
003 * This is the mzTab-M reference implementation and validation API service.
004 *
005 * OpenAPI spec version: 2.0.0
006 * Contact: nils.hoffmann@isas.de
007 *
008 * NOTE: This class is auto generated by the swagger code generator program.
009 * https://github.com/swagger-api/swagger-codegen.git
010 * Do not edit the class manually.
011 */
012
013
014package de.isas.mztab2.model;
015
016import java.util.Objects;
017import java.util.Arrays;
018import com.fasterxml.jackson.annotation.JsonProperty;
019import com.fasterxml.jackson.annotation.JsonCreator;
020import com.fasterxml.jackson.annotation.JsonValue;
021import de.isas.mztab2.model.Comment;
022import de.isas.mztab2.model.Metadata;
023import de.isas.mztab2.model.SmallMoleculeEvidence;
024import de.isas.mztab2.model.SmallMoleculeFeature;
025import de.isas.mztab2.model.SmallMoleculeSummary;
026import io.swagger.annotations.ApiModel;
027import io.swagger.annotations.ApiModelProperty;
028import java.util.ArrayList;
029import java.util.List;
030import com.fasterxml.jackson.dataformat.xml.annotation.*;
031import javax.xml.bind.annotation.*;
032import javax.validation.constraints.*;
033import javax.validation.Valid;
034import de.isas.lipidomics.mztab2.validation.constraints.*;
035/**
036 * 
037 * mzTab-M is intended as a reporting standard for quantitative results from metabolomics/lipodomics approaches.
038
039This format is further intended to provide local LIMS systems as well as MS metabolomics repositories a simple way to share and combine basic information.
040
041The mzTab-M format consists of four cross-referenced data tables:
042    
043    * Metadata (MTD), 
044    * Small Molecule (SML), 
045    * Small Molecule Feature (SMF) and the 
046    * Small Molecule Evidence (SME). 
047
048The MTD and SML tables are mandatory, and for a file to contain any evidence about how molecules were quantified or identified by software, then all four tables must be present. The tables must follow the order MTD, SML, SMF and SME, with a blank line separating each table. 
049
050The structure of each table, in terms of the rows and columns that must be present is tightly specified and formally defined and explained in the mzTab-M specification document.
051mzTab-M files MUST have one Metadata (MTD) section and one Small Molecule (SML) Section. In practice, we expect that most files SHOULD also include one Small Molecule Feature (SMF) section, and one Small Molecule Evidence (SME) Section. 
052Files lacking SMF and SME sections can only present summary data about quantified molecules, without any evidence trail for how those values were derived. It will be left to reading software to determine whether additional validation will be requested such that SMF and SME tables MUST be present.
053
054 * 
055 *
056 * 
057 *
058 */
059@ApiModel(description = "mzTab-M is intended as a reporting standard for quantitative results from metabolomics/lipodomics approaches.  This format is further intended to provide local LIMS systems as well as MS metabolomics repositories a simple way to share and combine basic information.  The mzTab-M format consists of four cross-referenced data tables:          * Metadata (MTD),      * Small Molecule (SML),      * Small Molecule Feature (SMF) and the      * Small Molecule Evidence (SME).   The MTD and SML tables are mandatory, and for a file to contain any evidence about how molecules were quantified or identified by software, then all four tables must be present. The tables must follow the order MTD, SML, SMF and SME, with a blank line separating each table.   The structure of each table, in terms of the rows and columns that must be present is tightly specified and formally defined and explained in the mzTab-M specification document. mzTab-M files MUST have one Metadata (MTD) section and one Small Molecule (SML) Section. In practice, we expect that most files SHOULD also include one Small Molecule Feature (SMF) section, and one Small Molecule Evidence (SME) Section.  Files lacking SMF and SME sections can only present summary data about quantified molecules, without any evidence trail for how those values were derived. It will be left to reading software to determine whether additional validation will be requested such that SMF and SME tables MUST be present. ")
060@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-08-07T11:09:24.487+02:00")
061@XmlRootElement(name = "MzTab")
062@XmlAccessorType(XmlAccessType.FIELD)
063@JacksonXmlRootElement(localName = "MzTab")
064public class MzTab {
065
066  /**
067   * Property enumeration for MzTab.
068   */
069  public static enum Properties {
070      metadata("metadata"), 
071      smallMoleculeSummary("smallMoleculeSummary"), 
072      smallMoleculeFeature("smallMoleculeFeature"), 
073      smallMoleculeEvidence("smallMoleculeEvidence"), 
074      comment("comment");
075
076    private final String propertyName;
077
078    private Properties(String propertyName) {
079      this.propertyName = propertyName;
080    }
081
082    public String getPropertyName() {
083      return propertyName;
084    }
085
086    public String toString() {
087      return propertyName;
088    }
089
090    public String toUpper() {
091      return propertyName.toUpperCase();
092    }
093
094    public static Properties of(String value) {
095      if(value==null) {
096        throw new NullPointerException("Argument value must not be null!");
097      }
098      return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new);
099    }
100  };
101  
102  @JsonProperty("metadata")
103  @JacksonXmlProperty(localName = "metadata")
104  @XmlElement(name = "metadata")
105  private Metadata metadata = null;
106  @JsonProperty("smallMoleculeSummary")
107  // Is a container wrapped=false
108  // items.name=smallMoleculeSummary items.baseName=smallMoleculeSummary items.xmlName= items.xmlNamespace=
109  // items.example= items.type=SmallMoleculeSummary
110  @XmlElement(name = "smallMoleculeSummary")
111  private List<SmallMoleculeSummary> smallMoleculeSummary = new ArrayList<>();
112  @JsonProperty("smallMoleculeFeature")
113  // Is a container wrapped=false
114  // items.name=smallMoleculeFeature items.baseName=smallMoleculeFeature items.xmlName= items.xmlNamespace=
115  // items.example= items.type=SmallMoleculeFeature
116  @XmlElement(name = "smallMoleculeFeature")
117  private List<SmallMoleculeFeature> smallMoleculeFeature = new ArrayList<>();
118  @JsonProperty("smallMoleculeEvidence")
119  // Is a container wrapped=false
120  // items.name=smallMoleculeEvidence items.baseName=smallMoleculeEvidence items.xmlName= items.xmlNamespace=
121  // items.example= items.type=SmallMoleculeEvidence
122  @XmlElement(name = "smallMoleculeEvidence")
123  private List<SmallMoleculeEvidence> smallMoleculeEvidence = new ArrayList<>();
124  @JsonProperty("comment")
125  // Is a container wrapped=false
126  // items.name=comment items.baseName=comment items.xmlName= items.xmlNamespace=
127  // items.example= items.type=Comment
128  @XmlElement(name = "comment")
129  private List<Comment> comment = null;
130
131 /**
132   * Builder method for metadata.
133   *
134   * @see MzTab#setMetadata MzTab#setMetadata for specification examples
135   * @see MzTab#getMetadata MzTab#getMetadata for validation constraints
136   * @param metadata a {@code Metadata} parameter.
137   * @return MzTab
138  **/
139  public MzTab metadata(Metadata metadata) {
140   this.metadata = metadata;
141   return this;
142  }
143
144   /**
145   * <p>Get metadata.</p>
146   *
147   * @return metadata
148  **/
149  @NotNull
150  @Valid
151  @ApiModelProperty(required = true, value = "")
152  public Metadata getMetadata() {
153    return metadata;
154  }
155
156 /**
157   * Set metadata.
158   *
159   * 
160   * 
161   * @see #getMetadata MzTab#getMetadata for validation constraints
162   * @param metadata a {@code Metadata} parameter.
163  **/
164  public void setMetadata(Metadata metadata) {
165    this.metadata = metadata;
166  }
167
168
169 /**
170   * Builder method for smallMoleculeSummary.
171   *
172   * @see MzTab#setSmallMoleculeSummary MzTab#setSmallMoleculeSummary for specification examples
173   * @see MzTab#getSmallMoleculeSummary MzTab#getSmallMoleculeSummary for validation constraints
174   * @param smallMoleculeSummary a {@code List<SmallMoleculeSummary>} parameter.
175   * @return MzTab
176  **/
177  public MzTab smallMoleculeSummary(List<SmallMoleculeSummary> smallMoleculeSummary) {
178   this.smallMoleculeSummary = smallMoleculeSummary;
179   return this;
180  }
181
182  /**
183   * Add a single smallMoleculeSummaryItem to the smallMoleculeSummary collection.
184   *
185   * @see MzTab#getSmallMoleculeSummary MzTab#getSmallMoleculeSummary for validation constraints
186   * @param smallMoleculeSummaryItem a {@code SmallMoleculeSummary} parameter.
187   * @return MzTab
188   */
189  public MzTab addSmallMoleculeSummaryItem(SmallMoleculeSummary smallMoleculeSummaryItem) {
190    this.smallMoleculeSummary.add(smallMoleculeSummaryItem);
191    return this;
192  }
193
194   /**
195   * The small molecule section is table-based. The small molecule section MUST always come after the metadata section. All table columns MUST be Tab separated. There MUST NOT be any empty cells; missing values MUST be reported using “null” for columns where Is Nullable &#x3D; “True”.
196
197Each row of the small molecule section is intended to report one final result to be communicated in terms of a molecule that has been quantified. In many cases, this may be the molecule of biological interest, although in some cases, the final result could be a derivatized form as appropriate – although it is desirable for the database identifier(s) to reference to the biological (non-derivatized) form. In general, different adduct forms would generally be reported in the Small Molecule Feature section.
198
199The order of columns MUST follow the order specified below.
200
201All columns are MANDATORY except for “opt_” columns.
202
203   *
204   * @return smallMoleculeSummary
205  **/
206  @NotNull
207  @Valid
208 @Size(min=1)  @ApiModelProperty(required = true, value = "The small molecule section is table-based. The small molecule section MUST always come after the metadata section. All table columns MUST be Tab separated. There MUST NOT be any empty cells; missing values MUST be reported using “null” for columns where Is Nullable = “True”.  Each row of the small molecule section is intended to report one final result to be communicated in terms of a molecule that has been quantified. In many cases, this may be the molecule of biological interest, although in some cases, the final result could be a derivatized form as appropriate – although it is desirable for the database identifier(s) to reference to the biological (non-derivatized) form. In general, different adduct forms would generally be reported in the Small Molecule Feature section.  The order of columns MUST follow the order specified below.  All columns are MANDATORY except for “opt_” columns. ")
209  public List<SmallMoleculeSummary> getSmallMoleculeSummary() {
210    return smallMoleculeSummary;
211  }
212
213 /**
214   * Set smallMoleculeSummary.
215   *
216   * 
217   * 
218   * @see #getSmallMoleculeSummary MzTab#getSmallMoleculeSummary for validation constraints
219   * @param smallMoleculeSummary a {@code List<SmallMoleculeSummary>} parameter.
220  **/
221  public void setSmallMoleculeSummary(List<SmallMoleculeSummary> smallMoleculeSummary) {
222    this.smallMoleculeSummary = smallMoleculeSummary;
223  }
224
225
226 /**
227   * Builder method for smallMoleculeFeature.
228   *
229   * @see MzTab#setSmallMoleculeFeature MzTab#setSmallMoleculeFeature for specification examples
230   * @see MzTab#getSmallMoleculeFeature MzTab#getSmallMoleculeFeature for validation constraints
231   * @param smallMoleculeFeature a {@code List<SmallMoleculeFeature>} parameter.
232   * @return MzTab
233  **/
234  public MzTab smallMoleculeFeature(List<SmallMoleculeFeature> smallMoleculeFeature) {
235   this.smallMoleculeFeature = smallMoleculeFeature;
236   return this;
237  }
238
239  /**
240   * Add a single smallMoleculeFeatureItem to the smallMoleculeFeature collection.
241   *
242   * @see MzTab#getSmallMoleculeFeature MzTab#getSmallMoleculeFeature for validation constraints
243   * @param smallMoleculeFeatureItem a {@code SmallMoleculeFeature} parameter.
244   * @return MzTab
245   */
246  public MzTab addSmallMoleculeFeatureItem(SmallMoleculeFeature smallMoleculeFeatureItem) {
247    this.smallMoleculeFeature.add(smallMoleculeFeatureItem);
248    return this;
249  }
250
251   /**
252   * The small molecule feature section is table-based, representing individual MS regions (generally considered to be the elution profile for all isotopomers formed from a single charge state of a molecule), that have been measured/quantified. However, for approaches that quantify individual isotopomers e.g. stable isotope labelling/flux studies, then each SMF row SHOULD represent a single isotopomer.
253
254Different adducts or derivatives and different charge states of individual molecules should be reported as separate SMF rows.
255
256The small molecule feature section MUST always come after the Small Molecule Table. All table columns MUST be Tab separated. There MUST NOT be any empty cells. Missing values MUST be reported using “null”.
257
258The order of columns MUST follow the order specified below.
259
260All columns are MANDATORY except for “opt_” columns.
261
262   *
263   * @return smallMoleculeFeature
264  **/
265  @NotNull
266  @Valid
267  @ApiModelProperty(required = true, value = "The small molecule feature section is table-based, representing individual MS regions (generally considered to be the elution profile for all isotopomers formed from a single charge state of a molecule), that have been measured/quantified. However, for approaches that quantify individual isotopomers e.g. stable isotope labelling/flux studies, then each SMF row SHOULD represent a single isotopomer.  Different adducts or derivatives and different charge states of individual molecules should be reported as separate SMF rows.  The small molecule feature section MUST always come after the Small Molecule Table. All table columns MUST be Tab separated. There MUST NOT be any empty cells. Missing values MUST be reported using “null”.  The order of columns MUST follow the order specified below.  All columns are MANDATORY except for “opt_” columns. ")
268  public List<SmallMoleculeFeature> getSmallMoleculeFeature() {
269    return smallMoleculeFeature;
270  }
271
272 /**
273   * Set smallMoleculeFeature.
274   *
275   * 
276   * 
277   * @see #getSmallMoleculeFeature MzTab#getSmallMoleculeFeature for validation constraints
278   * @param smallMoleculeFeature a {@code List<SmallMoleculeFeature>} parameter.
279  **/
280  public void setSmallMoleculeFeature(List<SmallMoleculeFeature> smallMoleculeFeature) {
281    this.smallMoleculeFeature = smallMoleculeFeature;
282  }
283
284
285 /**
286   * Builder method for smallMoleculeEvidence.
287   *
288   * @see MzTab#setSmallMoleculeEvidence MzTab#setSmallMoleculeEvidence for specification examples
289   * @see MzTab#getSmallMoleculeEvidence MzTab#getSmallMoleculeEvidence for validation constraints
290   * @param smallMoleculeEvidence a {@code List<SmallMoleculeEvidence>} parameter.
291   * @return MzTab
292  **/
293  public MzTab smallMoleculeEvidence(List<SmallMoleculeEvidence> smallMoleculeEvidence) {
294   this.smallMoleculeEvidence = smallMoleculeEvidence;
295   return this;
296  }
297
298  /**
299   * Add a single smallMoleculeEvidenceItem to the smallMoleculeEvidence collection.
300   *
301   * @see MzTab#getSmallMoleculeEvidence MzTab#getSmallMoleculeEvidence for validation constraints
302   * @param smallMoleculeEvidenceItem a {@code SmallMoleculeEvidence} parameter.
303   * @return MzTab
304   */
305  public MzTab addSmallMoleculeEvidenceItem(SmallMoleculeEvidence smallMoleculeEvidenceItem) {
306    this.smallMoleculeEvidence.add(smallMoleculeEvidenceItem);
307    return this;
308  }
309
310   /**
311   * The small molecule evidence section is table-based, representing evidence for identifications of small molecules/features, from database search or any other process used to give putative identifications to molecules. In a typical case, each row represents one result from a single search or intepretation of a piece of evidence e.g. a database search with a fragmentation spectrum. Multiple results from a given input data item (e.g. one fragment spectrum) SHOULD share the same value under evidence_input_id.
312
313The small molecule evidence section MUST always come after the Small Molecule Feature Table. All table columns MUST be Tab separated. There MUST NOT be any empty cells. Missing values MUST be reported using “null”.
314
315The order of columns MUST follow the order specified below.
316
317All columns are MANDATORY except for “opt_” columns.
318
319   *
320   * @return smallMoleculeEvidence
321  **/
322  @NotNull
323  @Valid
324  @ApiModelProperty(required = true, value = "The small molecule evidence section is table-based, representing evidence for identifications of small molecules/features, from database search or any other process used to give putative identifications to molecules. In a typical case, each row represents one result from a single search or intepretation of a piece of evidence e.g. a database search with a fragmentation spectrum. Multiple results from a given input data item (e.g. one fragment spectrum) SHOULD share the same value under evidence_input_id.  The small molecule evidence section MUST always come after the Small Molecule Feature Table. All table columns MUST be Tab separated. There MUST NOT be any empty cells. Missing values MUST be reported using “null”.  The order of columns MUST follow the order specified below.  All columns are MANDATORY except for “opt_” columns. ")
325  public List<SmallMoleculeEvidence> getSmallMoleculeEvidence() {
326    return smallMoleculeEvidence;
327  }
328
329 /**
330   * Set smallMoleculeEvidence.
331   *
332   * 
333   * 
334   * @see #getSmallMoleculeEvidence MzTab#getSmallMoleculeEvidence for validation constraints
335   * @param smallMoleculeEvidence a {@code List<SmallMoleculeEvidence>} parameter.
336  **/
337  public void setSmallMoleculeEvidence(List<SmallMoleculeEvidence> smallMoleculeEvidence) {
338    this.smallMoleculeEvidence = smallMoleculeEvidence;
339  }
340
341
342 /**
343   * Builder method for comment.
344   *
345   * @see MzTab#setComment MzTab#setComment for specification examples
346   * @see MzTab#getComment MzTab#getComment for validation constraints
347   * @param comment a {@code List<Comment>} parameter.
348   * @return MzTab
349  **/
350  public MzTab comment(List<Comment> comment) {
351   this.comment = comment;
352   return this;
353  }
354
355  /**
356   * Add a single commentItem to the comment collection.
357   *
358   * @see MzTab#getComment MzTab#getComment for validation constraints
359   * @param commentItem a {@code Comment} parameter.
360   * @return MzTab
361   */
362  public MzTab addCommentItem(Comment commentItem) {
363    if (this.comment == null) {
364      this.comment = new ArrayList<>();
365    }
366    this.comment.add(commentItem);
367    return this;
368  }
369
370   /**
371   * Comment lines can be placed anywhere in an mzTab file. These lines must start with the three-letter code COM and are ignored by most parsers. Empty lines can also occur anywhere in an mzTab file and are ignored.
372
373   *
374   * @return comment
375  **/
376  @Valid
377  @ApiModelProperty(value = "Comment lines can be placed anywhere in an mzTab file. These lines must start with the three-letter code COM and are ignored by most parsers. Empty lines can also occur anywhere in an mzTab file and are ignored. ")
378  public List<Comment> getComment() {
379    return comment;
380  }
381
382 /**
383   * Set comment.
384   *
385   * 
386   * 
387   * @see #getComment MzTab#getComment for validation constraints
388   * @param comment a {@code List<Comment>} parameter.
389  **/
390  public void setComment(List<Comment> comment) {
391    this.comment = comment;
392  }
393
394
395  @Override
396  public boolean equals(java.lang.Object o) {
397    if (this == o) {
398      return true;
399    }
400    if (o == null || getClass() != o.getClass()) {
401      return false;
402    }
403    MzTab mzTab = (MzTab) o;
404    return Objects.equals(this.metadata, mzTab.metadata) &&
405        Objects.equals(this.smallMoleculeSummary, mzTab.smallMoleculeSummary) &&
406        Objects.equals(this.smallMoleculeFeature, mzTab.smallMoleculeFeature) &&
407        Objects.equals(this.smallMoleculeEvidence, mzTab.smallMoleculeEvidence) &&
408        Objects.equals(this.comment, mzTab.comment);
409  }
410
411  @Override
412  public int hashCode() {
413    return Objects.hash(metadata, smallMoleculeSummary, smallMoleculeFeature, smallMoleculeEvidence, comment);
414  }
415
416
417  @Override
418  public String toString() {
419    StringBuilder sb = new StringBuilder();
420    sb.append("class MzTab {\n");
421    
422    sb.append("    metadata: ").append(toIndentedString(metadata)).append("\n");
423    sb.append("    smallMoleculeSummary: ").append(toIndentedString(smallMoleculeSummary)).append("\n");
424    sb.append("    smallMoleculeFeature: ").append(toIndentedString(smallMoleculeFeature)).append("\n");
425    sb.append("    smallMoleculeEvidence: ").append(toIndentedString(smallMoleculeEvidence)).append("\n");
426    sb.append("    comment: ").append(toIndentedString(comment)).append("\n");
427    sb.append("}");
428    return sb.toString();
429  }
430
431  /**
432   * Convert the given object to string with each line indented by 4 spaces
433   * (except the first line).
434   */
435  private String toIndentedString(java.lang.Object o) {
436    if (o == null) {
437      return "null";
438    }
439    return o.toString().replace("\n", "\n    ");
440  }
441
442}
443