uk.ac.ebi.intenz.tools.sib.writer
Class EnzymeFlatFileWriter

java.lang.Object
  extended by uk.ac.ebi.intenz.tools.sib.writer.EnzymeFlatFileWriter

public class EnzymeFlatFileWriter
extends Object

This utility class provides methods for exporting enzyme data into the ENZYME flat file format.

It adds the standard enzyme.dat header containing the current date (d-MMM-yyyy format). This header looks as follows:

CC -----------------------------------------------------------------------
CC
CC ENZYME nomenclature database
CC
CC -----------------------------------------------------------------------
CC Release 21-Mar-2007
CC
CC Amos Bairoch and Kristian Axelsen
CC Swiss Institute of Bioinformatics (SIB)
CC Centre Medical Universitaire (CMU)
CC 1, rue Michel Servet
CC 1211 Geneva 4
CC Switzerland
CC
CC Email: enzyme@isb-sib.ch
CC Telephone: +41-22-379 50 50
CC Fax: +41-22-379 58 58
CC
CC WWW server: http://enzyme.expasy.org/
CC
CC -----------------------------------------------------------------------
CC This database is copyright from the Swiss Institute of Bioinformatics.
CC There are no restrictions on its use by any institutions as long as
CC its content is in no way modified.
CC -----------------------------------------------------------------------
//


An example of an ENZYME entry is shown below:

ID 1.1.1.2
DE Alcohol dehydrogenase (NADP+).
AN Aldehyde reductase (NADPH).
CA An alcohol + NADP(+) = an aldehyde + NADPH.
CF Zinc.
CC -!- Some members of this group oxidize only primary alcohols; others act
CC also on secondary alcohols.
CC -!- May be identical with EC 1.1.1.19, EC 1.1.1.33 and EC 1.1.1.55.
CC -!- A-specific with respect to NADPH.
PR PROSITE; PDOC00061;
DR P35630, ADH1_ENTHI; Q24857, ADH3_ENTHI; O57380, ADH4_RANPE;
DR P25984, ADH_CLOBE ; P75214, ADH_MYCPN ; P31975, ADH_MYCTU ;
DR P14941, ADH_THEBR ; O70473, AKA1_CRIGR; P14550, AKA1_HUMAN;
DR Q9JII6, AKA1_MOUSE; P50578, AKA1_PIG ; P51635, AKA1_RAT ;
DR Q9UUN9, ALD2_SPOSA; P27800, ALDX_SPOSA;
//


The creation of this file follows the rules defined here.

Version:
$Revision: 1.3 $ $Date: 2008/04/01 14:26:09 $
Author:
Michael Darsow

Field Summary
static Properties DE_MODIFIED_ENTRIES
          EC numbers of entries which have been transferred more than once, or to more than one entry, or deleted but actually transferred, and whose DE line must be changed to match the enzyme.dat entry.
 
Method Summary
static long export(Collection enzymes, String version, File outputFile)
          Exports the given collection of enzymes into the ENZYME flat file format using the given file.
static long export(Collection enzymes, String version, String dir, String fileName)
          Exports the given collection of enzymes into the ENZYME flat file format using the given directory and file name to create the file.
static String export(EnzymeEntryImpl enzyme)
          Gives single enzyme view (used in webapp tools).
static void export(EnzymeEntryImpl enzymeEntry, Writer writer)
           
static String insertLineBreaks(String nonWrappedText, LineType lineType)
          Inserts line breaks for the given line type if the given text is longer than 78 characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DE_MODIFIED_ENTRIES

public static final Properties DE_MODIFIED_ENTRIES
EC numbers of entries which have been transferred more than once, or to more than one entry, or deleted but actually transferred, and whose DE line must be changed to match the enzyme.dat entry.

Method Detail

export

public static String export(EnzymeEntryImpl enzyme)
                     throws uk.ac.ebi.interfaces.sptr.SPTRException
Gives single enzyme view (used in webapp tools).

Parameters:
enzyme -
Returns:
Throws:
uk.ac.ebi.interfaces.sptr.SPTRException

export

public static long export(Collection enzymes,
                          String version,
                          File outputFile)
                   throws uk.ac.ebi.interfaces.sptr.SPTRException
Exports the given collection of enzymes into the ENZYME flat file format using the given file.

Parameters:
enzymes - The collection of EnzymeEntry instances.
version - Release version.
outputFile - The file storing the enzyme information.
Returns:
the time elapsed during this process.
Throws:
NullPointerException - if any of the given parameters is null
IllegalArgumentException - if version does not match the following regular expression pattern: \d+\.\d+.
uk.ac.ebi.interfaces.sptr.SPTRException - if an error occured during the export process.

export

public static void export(EnzymeEntryImpl enzymeEntry,
                          Writer writer)
                   throws uk.ac.ebi.interfaces.sptr.SPTRException,
                          IOException
Parameters:
enzymeEntry -
writer -
Throws:
uk.ac.ebi.interfaces.sptr.SPTRException
IOException

export

public static long export(Collection enzymes,
                          String version,
                          String dir,
                          String fileName)
                   throws uk.ac.ebi.interfaces.sptr.SPTRException
Exports the given collection of enzymes into the ENZYME flat file format using the given directory and file name to create the file.

Parameters:
enzymes - The collection of EnzymeEntry instances.
version - Release version.
dir - A valid directory where the file should be stored. If this value is either null or empty the file will be stored in the current working directory.
fileName - Name of the file which stores the enzyme information. If this value is either null or empty then the file will be named enzyme.dat.
Returns:
the time elapsed during this process.
Throws:
NullPointerException - if enzymes or version is null.
IllegalArgumentException - if version does not match the following regular expression pattern: \d+\.\d+ and if dir is not an existing directory.
uk.ac.ebi.interfaces.sptr.SPTRException - if an error occured during the export process.

insertLineBreaks

public static String insertLineBreaks(String nonWrappedText,
                                      LineType lineType)
                               throws uk.ac.ebi.interfaces.sptr.SPTRException
Inserts line breaks for the given line type if the given text is longer than 78 characters.

Parameters:
nonWrappedText - The text following the line type.
lineType - The line type of the line to be wrapped.
Returns:
the wrapped line including the line type information.
Throws:
uk.ac.ebi.interfaces.sptr.SPTRException - if an error occurred during the line breaking process.
NullPointerException - if any of the parameters is null.


Copyright © 2013 EMBL-EBI. All Rights Reserved.