Package uk.ac.ebi.pride.jmztab2.model
Enum Section
- java.lang.Object
-
- java.lang.Enum<Section>
-
- uk.ac.ebi.pride.jmztab2.model.Section
-
- All Implemented Interfaces:
Serializable
,Comparable<Section>
public enum Section extends Enum<Section>
Every line in an mzTab file MUST start with a three letter code identifying the type of line delimited by a Tab character. The three letter codes are as follows : - MTD for metadata - PRH for the protein table header line (the column labels) - PRT for rows of the protein table - PEH for the peptide table header line (the column labels) - PEP for rows of the peptide table - PSH for the PSM table header (the column labels) - PSM for rows of the PSM table - SMH for small molecule table header line (the column labels) - SML for rows of the small molecule table - COM for comment lines- Since:
- 31/01/13
- Author:
- qingwei, jgriss, nilshoffmann
-
-
Enum Constant Summary
Enum Constants Enum Constant Description Comment
Metadata
Peptide
Peptide_Header
Protein
Protein_Header
PSM
PSM_Header
Small_Molecule
Small_Molecule_Evidence
Small_Molecule_Evidence_Header
Small_Molecule_Feature
Small_Molecule_Feature_Header
Small_Molecule_Header
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Section
findSection(int level)
findSection.static Section
findSection(String key)
Query section based on its name or prefix with case-insensitive.int
getLevel()
Getter for the fieldlevel
.String
getName()
Getter for the fieldname
.String
getPrefix()
Getter for the fieldprefix
.boolean
isComment()
Judge the section is comment section or not.boolean
isData()
Judge the section is protein, peptide, psm, small_molecule, small_molecule_feature or small_molecule_evidence section.boolean
isHeader()
Judge the section is protein_header, peptide_header, psm_header, small_molecule_header, small_molecule_feature_header or small_molecule_evidence_header section.boolean
isMetadata()
Judge the section is metadata section or not.static Section
toDataSection(Section section)
Translate the section to corresponding data section.static Section
toHeaderSection(Section section)
Translate the section to corresponding header section.static Section
valueOf(String name)
Returns the enum constant of this type with the specified name.static Section[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
Protein_Header
public static final Section Protein_Header
-
Peptide_Header
public static final Section Peptide_Header
-
PSM_Header
public static final Section PSM_Header
-
Small_Molecule_Header
public static final Section Small_Molecule_Header
-
Small_Molecule
public static final Section Small_Molecule
-
Small_Molecule_Feature_Header
public static final Section Small_Molecule_Feature_Header
-
Small_Molecule_Feature
public static final Section Small_Molecule_Feature
-
Small_Molecule_Evidence_Header
public static final Section Small_Molecule_Evidence_Header
-
Small_Molecule_Evidence
public static final Section Small_Molecule_Evidence
-
-
Method Detail
-
values
public static Section[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Section c : Section.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Section valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getLevel
public int getLevel()
Getter for the field
level
.- Returns:
- a int.
-
findSection
public static Section findSection(int level)
findSection.
- Parameters:
level
- a int.- Returns:
- a
Section
object.
-
isComment
public boolean isComment()
Judge the section is comment section or not.- Returns:
- a boolean.
-
isMetadata
public boolean isMetadata()
Judge the section is metadata section or not.- Returns:
- a boolean.
-
isHeader
public boolean isHeader()
Judge the section is protein_header, peptide_header, psm_header, small_molecule_header, small_molecule_feature_header or small_molecule_evidence_header section.- Returns:
- a boolean.
-
isData
public boolean isData()
Judge the section is protein, peptide, psm, small_molecule, small_molecule_feature or small_molecule_evidence section.- Returns:
- a boolean.
-
toHeaderSection
public static Section toHeaderSection(Section section)
Translate the section to corresponding header section. If can not mapping, return null. Metadata, Comment --> null Protein, Protein_Header --> ProteinHeader Peptide, Peptide_Header --> PeptideHeader PSM, PSM_Header --> PSMHeader SmallMolecule, SmallMolecule_Header --> SmallMoleculeHeader SmallMoleculeFeature, SmallMoleculeFeature_Header --> SmallMoleculeFeatureHeader SmallMoleculeEvidence, SmallMoleculeEvidence_Header --> SmallMoleculeEvidenceHeader- Parameters:
section
- aSection
object.- Returns:
- a
Section
object. - See Also:
toDataSection(Section)
-
toDataSection
public static Section toDataSection(Section section)
Translate the section to corresponding data section. If can not mapping, return null. Metadata, Comment --> null Protein, Protein_Header --> Protein Peptide, Peptide_Header --> Peptide PSM, PSM_Header --> PSMHeader SmallMolecule, SmallMolecule_Header --> SmallMolecule SmallMoleculeFeature, SmallMoleculeFeature_Header --> SmallMoleculeFeature SmallMoleculeEvidence, SmallMoleculeEvidence_Header --> SmallMoleculeEvidence- Parameters:
section
- aSection
object.- Returns:
- a
Section
object. - See Also:
toHeaderSection(Section)
-
findSection
public static Section findSection(String key)
Query section based on its name or prefix with case-insensitive. For example: findSection("protein") == findSection("PRT"); Both of them to locate theProtein
- Parameters:
key
- if empty, return null.- Returns:
- a
Section
object.
-
-