Class ExpressionDataWriterUtils
- java.lang.Object
-
- ubic.gemma.core.datastructure.matrix.io.ExpressionDataWriterUtils
-
public class ExpressionDataWriterUtils extends Object
- Author:
- keshav
-
-
Constructor Summary
Constructors Constructor Description ExpressionDataWriterUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
appendBaseHeader(String fileTypeStr, BuildInfo buildInfo, Writer buf)
Append a base header to a file.static void
appendBaseHeader(ExpressionExperiment experiment, String fileTypeStr, String experimentUrl, BuildInfo buildInfo, Writer buf)
Appends base header information (about the experiment) to a file.static String
constructFactorValueName(FactorValue factorValue)
Produce a value for representing a factor value.static String
constructSampleExternalId(BioMaterial bioMaterial, Collection<BioAssay> bioAssays)
static String
constructSampleName(BulkExpressionDataMatrix<?> matrix, int assayColumnIndex)
Constructs a sample name for a given column of a data matrix.static String
constructSampleName(BioMaterial bioMaterial, Collection<BioAssay> bioAssays)
Construct a BioAssay column name prefixed by theBioMaterial
from which it originates.static String
constructSampleName(BioMaterial bm, BioAssay ba)
Construct a sample name in case there is only one BioAssay attached to the corresponding BioMaterial.
-
-
-
Method Detail
-
appendBaseHeader
public static void appendBaseHeader(String fileTypeStr, BuildInfo buildInfo, Writer buf) throws IOException
Append a base header to a file.- Throws:
IOException
-
appendBaseHeader
public static void appendBaseHeader(ExpressionExperiment experiment, String fileTypeStr, @Nullable String experimentUrl, BuildInfo buildInfo, Writer buf) throws IOException
Appends base header information (about the experiment) to a file.- Parameters:
buf
- bufferfileTypeStr
- file type strexperiment
- eeexperimentUrl
- an URL for the expriment, or null to ommit- Throws:
IOException
-
constructSampleName
public static String constructSampleName(BulkExpressionDataMatrix<?> matrix, int assayColumnIndex)
Constructs a sample name for a given column of a data matrix.- Parameters:
matrix
- matrixassayColumnIndex
- The column index in the matrix.- Returns:
- BA name
-
constructSampleName
public static String constructSampleName(BioMaterial bm, BioAssay ba)
Construct a sample name in case there is only one BioAssay attached to the corresponding BioMaterial.
-
constructSampleName
public static String constructSampleName(BioMaterial bioMaterial, Collection<BioAssay> bioAssays)
Construct a BioAssay column name prefixed by theBioMaterial
from which it originates.
-
constructFactorValueName
public static String constructFactorValueName(FactorValue factorValue)
Produce a value for representing a factor value.In the context of the design file, this is focusing on the value (i.e. subjects or measurement value) itself and not its metadata which are instead exposed in the file header.
Replaces spaces and hyphens with underscores.
- Parameters:
factorValue
- FV- Returns:
- replaced string
-
constructSampleExternalId
public static String constructSampleExternalId(BioMaterial bioMaterial, Collection<BioAssay> bioAssays)
- Parameters:
bioAssays
- BAsbioMaterial
- BM- Returns:
- String representing the external identifier of the biomaterial. This will usually be a GEO or ArrayExpression accession id, or else blank.
-
-