Package ubic.gemma.core.analysis.service
Interface ExpressionDataFileService
-
- All Superinterfaces:
FileService<ExpressionExperiment>
,TsvFileService<ExpressionExperiment>
- All Known Implementing Classes:
ExpressionDataFileServiceImpl
@ParametersAreNonnullByDefault public interface ExpressionDataFileService extends TsvFileService<ExpressionExperiment>
- Author:
- paul
-
-
Field Summary
Fields Modifier and Type Field Description static String
DATA_ARCHIVE_FILE_SUFFIX
static String
DATA_DIR
static String
DATA_FILE_SUFFIX
static String
DATA_FILE_SUFFIX_COMPRESSED
static String
DISCLAIMER
static String
JSON_FILE_SUFFIX
static String
TMP_DATA_DIR
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
analysisResultSetsToString(Collection<ExpressionAnalysisResultSet> results, Map<Long,String[]> geneAnnotations, StringBuilder buf)
List<DifferentialExpressionAnalysisResult>
analysisResultSetToString(ExpressionAnalysisResultSet ears, Map<Long,String[]> geneAnnotations, StringBuilder buf, Map<Long,StringBuilder> probe2String, List<DifferentialExpressionAnalysisResult> sortedFirstColumnOfResults)
void
deleteAllFiles(ExpressionExperiment ee)
Delete any existing coexpression, data, or differential expression data files.void
deleteDiffExArchiveFile(DifferentialExpressionAnalysis analysis)
File
getDiffExpressionAnalysisArchiveFile(Long analysisId, boolean forceCreate)
Locate or create the differential expression data file(s) for a given experiment.File
getMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type)
Locate a metadata file.File
getOutputFile(String filename)
File
getOutputFile(String filename, boolean temporary)
File
getOutputFile(ExpressionExperiment ee, boolean filtered)
File
getOutputFile(ExpressionExperiment ee, boolean filtered, boolean compressed, boolean temporary)
void
writeDiffExArchiveFile(BioAssaySet ee, DifferentialExpressionAnalysis analysis, DifferentialExpressionAnalysisConfig config)
Writes to the configured gemma.appdata.home The file created is a zip archive containing at least two files.Optional<File>
writeOrLocateCoexpressionDataFile(ExpressionExperiment ee, boolean forceWrite)
Write or located the coexpression data file for a given experimentFile
writeOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite)
Locate or create an experimental design file for a given experiment.Collection<File>
writeOrLocateDiffExpressionDataFiles(ExpressionExperiment ee, boolean forceWrite)
Locate or create the differential expression data file(s) for a given experiment.Optional<File>
writeOrLocateJSONProcessedExpressionDataFile(ExpressionExperiment ee, boolean forceWrite, boolean filtered)
File
writeOrLocateJSONRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite)
Optional<File>
writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean forceWrite, boolean filtered)
Locate or create a data file containing the 'preferred and masked' expression data matrix, with filtering for low expression applied (currently supports default settings only).File
writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite)
Locate or create a new data file for the given quantitation type.void
writeProcessedExpressionData(ExpressionExperiment ee, Writer writer)
Write processed expression data to a given writer for a given quantitation type.Optional<File>
writeProcessedExpressionDataFile(ExpressionExperiment ee, boolean filtered, String fileName, boolean compress)
Create a data file containing the 'preferred and masked' expression data matrix, with filtering for low expression applied (currently supports default settings only).void
writeRawExpressionData(ExpressionExperiment ee, QuantitationType qt, Writer writer)
Write raw expression data to a given writer for a given quantitation type.-
Methods inherited from interface ubic.gemma.core.analysis.service.FileService
write, write
-
Methods inherited from interface ubic.gemma.core.analysis.service.TsvFileService
writeTsv, writeTsv
-
-
-
-
Field Detail
-
DATA_ARCHIVE_FILE_SUFFIX
static final String DATA_ARCHIVE_FILE_SUFFIX
- See Also:
- Constant Field Values
-
DATA_DIR
static final String DATA_DIR
-
DATA_FILE_SUFFIX
static final String DATA_FILE_SUFFIX
- See Also:
- Constant Field Values
-
DATA_FILE_SUFFIX_COMPRESSED
static final String DATA_FILE_SUFFIX_COMPRESSED
- See Also:
- Constant Field Values
-
DISCLAIMER
static final String DISCLAIMER
- See Also:
- Constant Field Values
-
JSON_FILE_SUFFIX
static final String JSON_FILE_SUFFIX
- See Also:
- Constant Field Values
-
TMP_DATA_DIR
static final String TMP_DATA_DIR
-
-
Method Detail
-
analysisResultSetsToString
void analysisResultSetsToString(Collection<ExpressionAnalysisResultSet> results, Map<Long,String[]> geneAnnotations, StringBuilder buf)
-
analysisResultSetToString
List<DifferentialExpressionAnalysisResult> analysisResultSetToString(ExpressionAnalysisResultSet ears, Map<Long,String[]> geneAnnotations, StringBuilder buf, Map<Long,StringBuilder> probe2String, @Nullable List<DifferentialExpressionAnalysisResult> sortedFirstColumnOfResults)
-
deleteAllFiles
void deleteAllFiles(ExpressionExperiment ee)
Delete any existing coexpression, data, or differential expression data files.- Parameters:
ee
- the experiment
-
getDiffExpressionAnalysisArchiveFile
File getDiffExpressionAnalysisArchiveFile(Long analysisId, boolean forceCreate)
Locate or create the differential expression data file(s) for a given experiment. We generate an archive that contains following files: - differential expression analysis file (q-values per factor) - file for each result set with contrasts info (such as fold change for each factor value)- Parameters:
analysisId
- analysis IDforceCreate
- whether to force creation- Returns:
- file
-
getOutputFile
File getOutputFile(ExpressionExperiment ee, boolean filtered)
- Parameters:
ee
- the experimentfiltered
- if the data matrix is filtered- Returns:
- file
-
getOutputFile
File getOutputFile(ExpressionExperiment ee, boolean filtered, boolean compressed, boolean temporary)
- Parameters:
filtered
- if the data matrix is filteredcompressed
- if the filename should have a .gz extensiontemporary
- if you want the file to be saved in the configuration file temporary locationee
- the experiment- Returns:
- file
-
getOutputFile
File getOutputFile(String filename)
- Parameters:
filename
- without the path - that is, just the name of the file- Returns:
- File, with location in the appropriate target directory.
-
getOutputFile
File getOutputFile(String filename, boolean temporary)
- Parameters:
filename
- without the path - that is, just the name of the filetemporary
- , if this is true then the file gets saved to the temporary location from the configuration file- Returns:
- File, with location in the appropriate target directory.
-
getMetadataFile
File getMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type)
Locate a metadata file.
-
writeProcessedExpressionDataFile
Optional<File> writeProcessedExpressionDataFile(ExpressionExperiment ee, boolean filtered, String fileName, boolean compress) throws IOException, FilteringException
Create a data file containing the 'preferred and masked' expression data matrix, with filtering for low expression applied (currently supports default settings only).- Parameters:
ee
- the experimentcompress
- compress?fileName
- file namefiltered
- fitlered?- Returns:
- file, or empty if the experiment has no processed expression data
- Throws:
IOException
- when there are IO problemsFilteringException
-
writeRawExpressionData
void writeRawExpressionData(ExpressionExperiment ee, QuantitationType qt, Writer writer) throws IOException
Write raw expression data to a given writer for a given quantitation type.Note: For compression, wrap a
GZIPOutputStream
with aOutputStreamWriter
. To write to a string, consider usingStringWriter
.- Parameters:
ee
- the expression experimentqt
- a quantitation type to usewriter
- the destination for the raw expression data- Throws:
IOException
- if operations with the writer fails
-
writeProcessedExpressionData
void writeProcessedExpressionData(ExpressionExperiment ee, Writer writer) throws IOException
Write processed expression data to a given writer for a given quantitation type.Note: For compression, wrap a
GZIPOutputStream
with aOutputStreamWriter
. To write to a string, consider usingStringWriter
.- Parameters:
ee
- the expression experimentwriter
- the destination for the raw expression data- Throws:
IOException
- if operations with the writer fails
-
writeOrLocateCoexpressionDataFile
Optional<File> writeOrLocateCoexpressionDataFile(ExpressionExperiment ee, boolean forceWrite)
Write or located the coexpression data file for a given experiment- Parameters:
ee
- the experimentforceWrite
- whether to force write- Returns:
- file
-
writeOrLocateProcessedDataFile
Optional<File> writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean forceWrite, boolean filtered) throws FilteringException
Locate or create a data file containing the 'preferred and masked' expression data matrix, with filtering for low expression applied (currently supports default settings only). It will be gzip-compressed. The file will be regenerated even if one already exists if the forceWrite parameter is true, or if there was a recent change (more recent than the last modified date of the existing file) to any of the experiments platforms.- Parameters:
filtered
- filteredforceWrite
- force re-write even if file already exists and is up to date.ee
- the experiment- Returns:
- file, or empty if the experiment has no processed vectors
- Throws:
FilteringException
-
writeOrLocateRawExpressionDataFile
File writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite)
Locate or create a new data file for the given quantitation type. The output will include gene information if it can be located from its own file.- Parameters:
forceWrite
- To not return the existing file, but create it anew.type
- the quantitation type- Returns:
- file
-
writeOrLocateDesignFile
File writeOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite)
Locate or create an experimental design file for a given experiment. The file will be regenerated even if one already exists if the forceWrite parameter is true, or if there was a recent change (more recent than the last modified date of the existing file) to any of the experiments platforms.- Parameters:
ee
- the experimentforceWrite
- force re-write even if file already exists and is up to date- Returns:
- file
-
writeOrLocateDiffExpressionDataFiles
Collection<File> writeOrLocateDiffExpressionDataFiles(ExpressionExperiment ee, boolean forceWrite)
Locate or create the differential expression data file(s) for a given experiment.- Parameters:
ee
- the experimentforceWrite
- whether to force write- Returns:
- collection of files, one per analysis.
-
writeOrLocateJSONProcessedExpressionDataFile
Optional<File> writeOrLocateJSONProcessedExpressionDataFile(ExpressionExperiment ee, boolean forceWrite, boolean filtered) throws FilteringException
-
writeOrLocateJSONRawExpressionDataFile
File writeOrLocateJSONRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite)
-
deleteDiffExArchiveFile
void deleteDiffExArchiveFile(DifferentialExpressionAnalysis analysis)
-
writeDiffExArchiveFile
void writeDiffExArchiveFile(BioAssaySet ee, DifferentialExpressionAnalysis analysis, @Nullable DifferentialExpressionAnalysisConfig config) throws IOException
Writes to the configured gemma.appdata.home The file created is a zip archive containing at least two files. The first is the summary model fit statistics, ANOVA-style. The others are the contrast details for each factor. They should be R-friendly (e.g., readable withread.delim("analysis.results.txt", header=T, comment.char="#", row.names=1)
- Parameters:
ee
- the experimentanalysis
- analysisconfig
- config- Throws:
IOException
- when there was a problem during write
-
-