Class BioAssaySetUtil

java.lang.Object
net.sf.basedb.util.BioAssaySetUtil

public class BioAssaySetUtil
extends Object
This is a utility class for BioAssaySet.
Version:
2.0
Author:
Johan
Last modified
$Date: 2015-06-03 08:19:32 +0200 (on, 03 jun 2015) $
  • Constructor Details

    • BioAssaySetUtil

      public BioAssaySetUtil()
  • Method Details

    • getAnnotationValues

      public static Set<?> getAnnotationValues​(DbControl dc, SnapshotManager snapshotManager, BioAssay bioAssay, AnnotationType annotationType)
      Find the annotation values for a given annotation type on a bioassay. This method will only check annotations, primary and inherited, on the root raw bioassays that the bioassay is a child of.

      Since a bioassay may have more than one parent raw bioassay and each annotation may have multiple values it is possible that the set contains multiple values. Each value is only present once regardless of how many times it appears in the annotations.

      Parameters:
      dc - The DbControl for database access
      snapshotManager - A snapshot manager that is used for loading the annotations from either the database or the file cache (if null, an internal, non-reusable snapshot manager is used)
      bioAssay - The bioassay to get the annotations for
      annotationType - The annotation type of the annotations
      Returns:
      A set containing all values
      Since:
      2.14
    • getParentProperties

      public static Set<Object> getParentProperties​(DbControl dc, BioAssay bioAssay, Metadata.PropertyPath<RawBioAssay,​?> property)
      Find the values of parent properties for a given bioassay. This method starts by loading all raw bioassays that are parents to the bioassay. For each raw bioassay it uses the Metadata.PropertyPath object to find the value of the given property for that raw bioassay.

      Since a bioassay may have more than one parent raw bioassay and it is possible that the set contains multiple values. Each value is only present once regardless of how many times it appears among the parents.

      Examples of property paths:

      • spots: to get the number of spots in the raw bioassay
      • software.name: to get the name of the software used to analyse the image files
      • scan.hybridization.creationEvent.eventDate: to get the date when the hybridization was created
      Parameters:
      dc - The DbControl for database access
      bioAssay - The bioassay to get the annotations for
      property - The property to get the value for
      Returns:
      A set containing all values
    • createJepRestriction

      public static Restriction createJepRestriction​(DbControl dc, String formula, DynamicQuery query)
      Parse a JEP expression and create a restrictions that is suitable to be used in a dynamic query. In addition to the standard functions defined by JEP (see Jep.getFunctions()) this method can use additional functions. The extra functions are defined by the query. See AbstractSqlQuery.getJepFunctions(DbControl, boolean) and it's subclasses for detailed information. Here are some useful functions:
      Parameters:
      dc - DbControl to use when accessing the database.
      formula - The formula to parse. Must not be null.
      query - The query where the restriction will be used, it is not recommended to use the expression in a different query since it may generate incorrect SQL
      Returns:
      A restriction to be used on a query.
      Throws:
      InvalidDataException - If any of required parameters are null.
      BaseException - If creating the restriction fails.
      See Also:
      Jep
    • createJepExpression

      public static Expression createJepExpression​(DbControl dc, String formula, DynamicQuery query)
      Parse a JEP expression and create a restrictions that is suitable to be used in a dynamic query. In addition to the standard functions defined by JEP (see Jep.getFunctions()) this method can use additional functions. The extra functions are defined by the query. See AbstractSqlQuery.getJepFunctions(DbControl, boolean) and it's subclasses for detailed information. Here are some useful functions:
      • raw(property): The value of the specified raw data property. The use of this function can be denied if the bioassayset contains merged spot data. The DynamicSpotQuery.setDisableRawJoinOnMergedData(boolean) flag controls this.
      • rep(property): The value of the specified reporter property
      • pos(): The position of a spot. Note that this is not the same as raw(position)
      • ch(n): The intensity in channel n (un-transformed)
      • rawCh(n): The possibly transformed intensity in channel n
      • score(list): The score of the ReporterData in the specified ReporterList (numeric or external ID)
      • xtra(extraValue): The value of the specified ExtraValue (numeric ID or the external ID of the ExtraValueType)
      Parameters:
      dc - The DbControl to use when accessing the database.
      formula - The formula that should be parsed. Must not be null.
      query - The query where the expression will be used, it is not recommended to use the expression in a different query since it may generate incorrect SQL
      Returns:
      An expression to be used with a query.
      Throws:
      InvalidDataException - If any of required parameters are null.
      BaseException - If creating the expression fails.
      Since:
      2.15
      See Also:
      Jep