Last update: 2011-06-23

org.proteios.io.mzdata
Class MzDataImpCommonAnnotation

java.lang.Object
  extended by org.proteios.io.mzdata.MzDataImpCommon
      extended by org.proteios.io.mzdata.MzDataImpCommonDc
          extended by org.proteios.io.mzdata.MzDataImpCommonAnnotation
Direct Known Subclasses:
MzDataImpCommonPeakList, MzDataImpCommonPeakListSet

public class MzDataImpCommonAnnotation
extends MzDataImpCommonDc

This class supports import of mzData files into Proteios. It contains common attributes and methods, and is intended to be the parent class for other classes that process an XML block in an mzData file. An mzData file contains information on a mass spectrometry experiment. The mzData file is first vaildated against the XML Schema Definition file mzdata.xsd. If the file is valid, its content is parsed and selected information stored in Proteios. The mzData file is parsed using cursor-based XML stream parsing. The StAX (Stream API for XML) parser finds start and stop (end) tags, which are then processed. Element attributes are located in the start tag, and elements of simple types are stored directly after the start tag is read. For more complex elements, values of attributes and sub-elements are collected in temporary variables, until the end tag is reached, and the colelcted contents are stored. Example: XML tag tagData At start tag: Method thisTagElementStart() stores attribute values. Between tags: tagData is stored in temporary StringBuffer. At end tag: Method thisTagItem() processes collected data. Tag data may be exchanged for a start/end tag pair, etc.

Version:
2.0
Author:
Olle
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Field Summary
 
Fields inherited from class org.proteios.io.mzdata.MzDataImpCommonDc
anna, dc, factory
 
Fields inherited from class org.proteios.io.mzdata.MzDataImpCommon
log
 
Constructor Summary
MzDataImpCommonAnnotation(SessionControl sc)
          Default constructor.
 
Method Summary
 CvLookup fetchCvLookupAnnotation(AnnotationSet as, String atName, Type atType, DbControl argDc)
          Fetches annotation value from annotation for given cvLookup annotation type.
 List<CvLookup> fetchCvLookupAnnotationList(AnnotationSet as, Type atType, DbControl argDc)
          Fetches list of cvLookup type annotations.
 CvParam fetchCvParamAnnotation(AnnotationSet as, String atName, Type atType, DbControl argDc)
          Fetches annotation value from annotation for given cvParam annotation type.
 List<CvParam> fetchCvParamAnnotationList(AnnotationSet as, Type atType, DbControl argDc)
          Fetches list of cvParam type annotations.
 UserParam fetchUserParamAnnotation(AnnotationSet as, String atName, Type atType, DbControl argDc)
          Fetches annotation value from annotation for given userParam annotation type.
 List<UserParam> fetchUserParamAnnotationList(AnnotationSet as, Type atType, DbControl argDc)
          Fetches list of userParam type annotations.
 void storeAnnotation(AnnotationSet as, String atName, Type atType, Item atItem, String value)
          Stores standard annotation.
 void storeCvLookupAnnotation(AnnotationSet as, String lookupCvLabel, Type atType, Item atItem, String lookupFullName, String lookupVersion, String lookupAddress)
          Stores variable values as cvLookup annotation.
 void storeCvParamAnnotation(AnnotationSet as, String atName, Type atType, Item atItem, String value, String cvLabel, String accession)
          Stores variable values as cvParam annotation.
 void storeUserParamAnnotation(AnnotationSet as, String atName, Type atType, Item atItem, String value)
          Stores variable values as userParam annotation.
 
Methods inherited from class org.proteios.io.mzdata.MzDataImpCommonDc
enableDbControl, enableDbControl, getDbControl, getSessionControl, setDbControl
 
Methods inherited from class org.proteios.io.mzdata.MzDataImpCommon
blockEnd, blockStart, getBlockTagName, getTempStrBuf, parse, processCData, processCharacters, processInternalEndElement, processInternalStartElement, setBlockTagName, setTempStrBuf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MzDataImpCommonAnnotation

public MzDataImpCommonAnnotation(SessionControl sc)
Default constructor.

Method Detail

storeAnnotation

public void storeAnnotation(AnnotationSet as,
                            String atName,
                            Type atType,
                            Item atItem,
                            String value)
Stores standard annotation.

Parameters:
as - AnnotationSet the AnnotationSet to use
atName - String the name of the AnnotationType
atType - Type the type of the AnnotationType
atItem - Item the Item the AnnotationType should be enabled for
value - The annotation value

storeUserParamAnnotation

public void storeUserParamAnnotation(AnnotationSet as,
                                     String atName,
                                     Type atType,
                                     Item atItem,
                                     String value)
Stores variable values as userParam annotation. A userParam annotation is an annotation, tagged by having annotationtype AddedParameterType set to "userParam", and where data for cvLabel and accession are stored as String attributes in the annotationType for the annotation.

Parameters:
as - AnnotationSet the AnnotationSet to use
atName - String the name of the AnnotationType
atType - Type the type of the AnnotationType
atItem - Item the Item the AnnotationType should be enabled for
value - The annotation value

storeCvParamAnnotation

public void storeCvParamAnnotation(AnnotationSet as,
                                   String atName,
                                   Type atType,
                                   Item atItem,
                                   String value,
                                   String cvLabel,
                                   String accession)
Stores variable values as cvParam annotation. A cvParam annotation is an annotation, tagged by having annotationtype AddedParameterType set to "cvParam", and where data for cvLabel and accession are stored as String attributes in the annotationType for the annotation.

Parameters:
as - AnnotationSet the AnnotationSet to use
atName - String the name of the AnnotationType
atType - Type the type of the AnnotationType
atItem - Item the Item the AnnotationType should be enabled for
value - String the annotation value as a String
cvLabel - String the annotation cvLabel as a String
accession - String the annotation accession as a String

storeCvLookupAnnotation

public void storeCvLookupAnnotation(AnnotationSet as,
                                    String lookupCvLabel,
                                    Type atType,
                                    Item atItem,
                                    String lookupFullName,
                                    String lookupVersion,
                                    String lookupAddress)
Stores variable values as cvLookup annotation. A cvLookup annotation is an annotation, tagged by having annotationtype AddedParameterType set to "cvLookup", and where data for fullName and version are stored as String attributes in the annotationType for the annotation. Data for cvLabel and address are used as name and value for the annotation, as this information is viewable by the user.

Parameters:
as - AnnotationSet the AnnotationSet to use
lookupCvLabel - String the name of the AnnotationType
atType - Type the type of the AnnotationType
atItem - Item the Item the AnnotationType should be enabled for
lookupFullName - String the annotation added parameter name as a String
lookupVersion - String the annotation added parameter value as a String
lookupAddress - String the annotation value as a String

fetchCvLookupAnnotation

public CvLookup fetchCvLookupAnnotation(AnnotationSet as,
                                        String atName,
                                        Type atType,
                                        DbControl argDc)
Fetches annotation value from annotation for given cvLookup annotation type. A cvLookup annotation is an annotation, tagged by having annotationtype AddedParameterType set to "cvLookup", and where data for fullName and version are stored as String attributes in the annotationType for the annotation. Data for cvLabel and address are used as name and value for the annotation, as this information is viewable by the user.

Parameters:
as - AnnotationSet the AnnotationSet to use
atName - String the name of annotationType
atType - Type the type of the annotationType
argDc - DbControl the DbControl object to use
Returns:
CvLookup A CvLookup object with annotation values, or null if not found

fetchCvLookupAnnotationList

public List<CvLookup> fetchCvLookupAnnotationList(AnnotationSet as,
                                                  Type atType,
                                                  DbControl argDc)
Fetches list of cvLookup type annotations. A cvLookup annotation is an annotation, tagged by having annotationtype AddedParameterType set to "cvLookup", and where data for fullName and version are stored as String attributes in the annotationType for the annotation. Data for cvLabel and address are used as name and value for the annotation, as this information is viewable by the user.

Parameters:
as - AnnotationSet the AnnotationSet to use
atType - Type the type of the annotationType
argDc - DbControl the DbControl object to use
Returns:
List A list of CvLookup objects with annotation values.

fetchCvParamAnnotation

public CvParam fetchCvParamAnnotation(AnnotationSet as,
                                      String atName,
                                      Type atType,
                                      DbControl argDc)
Fetches annotation value from annotation for given cvParam annotation type. A cvParam annotation is an annotation, tagged by having annotationtype AddedParameterType set to "cvParam", and where data for cvLabel and accession are stored as String attributes in the annotationType for the annotation.

Parameters:
as - AnnotationSet the AnnotationSet to use
atName - String the name of annotationType
atType - Type the type of the annotationType
argDc - DbControl the DbControl object to use
Returns:
CvParam A CvParam object with annotation values, or null if not found

fetchCvParamAnnotationList

public List<CvParam> fetchCvParamAnnotationList(AnnotationSet as,
                                                Type atType,
                                                DbControl argDc)
Fetches list of cvParam type annotations. A cvParam annotation is an annotation, tagged by having annotationtype AddedParameterType set to "cvParam", and where data for cvLabel and accession are stored as String attributes in the annotationType for the annotation.

Parameters:
as - AnnotationSet the AnnotationSet to use
atType - Type the type of the annotationType
argDc - DbControl the DbControl object to use
Returns:
List A list of CvParam objects with annotation values.

fetchUserParamAnnotation

public UserParam fetchUserParamAnnotation(AnnotationSet as,
                                          String atName,
                                          Type atType,
                                          DbControl argDc)
Fetches annotation value from annotation for given userParam annotation type. A userParam annotation is an annotation, tagged by having annotationtype AddedParameterType set to "userParam".

Parameters:
as - AnnotationSet the AnnotationSet to use
atName - String the name of annotationType
atType - Type the type of the annotationType
argDc - DbControl the DbControl object to use
Returns:
UserParam A UserParam object with annotation values, or null if not found

fetchUserParamAnnotationList

public List<UserParam> fetchUserParamAnnotationList(AnnotationSet as,
                                                    Type atType,
                                                    DbControl argDc)
Fetches list of userParam type annotations. A userParam annotation is an annotation, tagged by having annotationtype AddedParameterType set to "userParam".

Parameters:
as - AnnotationSet the AnnotationSet to use
atType - Type the type of the annotationType
argDc - DbControl the DbControl object to use
Returns:
List A list of UserParam objects with annotation values.

Last update: 2011-06-23