uk.ac.sanger.cgp.standalonecsa.util
Class CsaConfig

java.lang.Object
  extended by uk.ac.sanger.cgp.standalonecsa.util.CsaConfig

public class CsaConfig
extends java.lang.Object

This class handles access to configuration property files. In most cases this can involve just making sure a file is only read once. In some other cases particular data structures are generated.

Author:
Original: kr2, $Author: kr2 $

Field Summary
static java.lang.String CONFIG_LOC
          The location where the standaloneCsa.properties file is expected to be.
static java.lang.String CSA_ANALYSIS_LOC
          The location where the csa_analysis.properties file is expected to be.
static java.lang.String DEFAULT_AMPLIMER_CONFIG_LOC
          The location where the amplimer.properties file is expected to be.
protected static java.lang.String DEFAULT_PROP_LOC
          The location where the default.properties file is expected to be.
static java.util.Properties DEFAULT_PROPERTIES
          Holds the pre-loaded content from default.properties.
protected static org.apache.commons.logging.Log log
           
protected static java.lang.String STATUS_LOC
          The location where the status.properties file is expected to be.
static java.util.Properties STATUS_PROPERTIES
          Holds the pre-loaded content from status.properties.
static java.util.Properties VELOCITY_PROPERTIES
          Holds the pre-loaded content from the file specified under view_config in default.properties.
 
Constructor Summary
protected CsaConfig()
          Creates a new instance of CsaConfig
 
Method Summary
static java.util.Map getAmplimerConfig()
          Gets a map of AmplimerBeans accessible by amplimer name.
static FileProcessingInfoBean getFileProperties()
          Creates a FileProcessingInfoBean based on standaloneCsa.properties.
protected static java.util.Properties getProperties()
          Get the properties object for standaloneCsa.properties.
static java.lang.String getProperty(java.lang.String toGet)
          Gets the value of the specified property from standaloneCsa.properties.
static boolean parseToBoolean(java.lang.String property)
          Converts the specified property of standaloneCsa.properties to a boolean result.
static void setFileProperties(FileProcessingInfoBean newProps)
          Public access for testing classes only, not for general use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

CONFIG_LOC

public static final java.lang.String CONFIG_LOC
The location where the standaloneCsa.properties file is expected to be.

See Also:
Constant Field Values

DEFAULT_PROP_LOC

protected static final java.lang.String DEFAULT_PROP_LOC
The location where the default.properties file is expected to be. This property file contains much of the text used in the setup GUI. Ideally this will allow internationalisation to be carried out at some point. In addition to this the information to construct the mobility correction and the csa_analysis.properties files are held here.

See Also:
Constant Field Values

STATUS_LOC

protected static final java.lang.String STATUS_LOC
The location where the status.properties file is expected to be. This file holds textual interpretations of status values used in AutoCSA. Ideally this will allow internationalisation to be carried out at some point.

See Also:
Constant Field Values

CSA_ANALYSIS_LOC

public static final java.lang.String CSA_ANALYSIS_LOC
The location where the csa_analysis.properties file is expected to be. This file contains user configurable parameters for the analysis and comparison steps of AutoCSA. The file is created during setup and populated with the default values (which would rarely be altered).

See Also:
Constant Field Values

DEFAULT_AMPLIMER_CONFIG_LOC

public static final java.lang.String DEFAULT_AMPLIMER_CONFIG_LOC
The location where the amplimer.properties file is expected to be. This file should contain information about the amplimers being screened.

Required field
 amplimer-amplimerName=acgtcgctagc....cacgggctacgatcgact
 
Recommended field
 roi-amplimerName=50,130
 
Optional fields
 map-amplimerName=cdsName
 cds-cdsName=atggtacgatcgacgttacgatcgacgggcatcgagctaggtagctacgtacgatag
 

Please see user documentation for further information regarding these fields.

See Also:
Constant Field Values

DEFAULT_PROPERTIES

public static final java.util.Properties DEFAULT_PROPERTIES
Holds the pre-loaded content from default.properties.


STATUS_PROPERTIES

public static final java.util.Properties STATUS_PROPERTIES
Holds the pre-loaded content from status.properties.


VELOCITY_PROPERTIES

public static final java.util.Properties VELOCITY_PROPERTIES
Holds the pre-loaded content from the file specified under view_config in default.properties.

Constructor Detail

CsaConfig

protected CsaConfig()
Creates a new instance of CsaConfig

Method Detail

getFileProperties

public static FileProcessingInfoBean getFileProperties()
Creates a FileProcessingInfoBean based on standaloneCsa.properties.

Returns:
object with information regarding the filename structure and how it should be processed

setFileProperties

public static void setFileProperties(FileProcessingInfoBean newProps)
Public access for testing classes only, not for general use.

Parameters:
newProps - properties object to be parsed into a FileProcessingInfoBean

parseToBoolean

public static boolean parseToBoolean(java.lang.String property)
Converts the specified property of standaloneCsa.properties to a boolean result.

Parameters:
property - property to parse
Returns:
true when property is set to 1

getProperties

protected static java.util.Properties getProperties()
Get the properties object for standaloneCsa.properties. Only parses the file to the object if first call.

Returns:
a properties object representing standaloneCsa.properties

getProperty

public static java.lang.String getProperty(java.lang.String toGet)
Gets the value of the specified property from standaloneCsa.properties.

Parameters:
toGet - property key
Returns:
the value of the requested property

getAmplimerConfig

public static java.util.Map getAmplimerConfig()
Gets a map of AmplimerBeans accessible by amplimer name. Any ROI, CDS mapping and CDS sequence is also loaded into this object if present. Only generated on first request.

Returns:
a Map of AmplimerBeans containing CdsBeans