Class ExpressionDataFileServiceImpl
- java.lang.Object
-
- ubic.gemma.core.analysis.service.ExpressionDataFileServiceImpl
-
- All Implemented Interfaces:
ExpressionDataFileService
@Service @Transactional(propagation=NEVER) public class ExpressionDataFileServiceImpl extends Object implements ExpressionDataFileService
Supports the creation and location of 'flat file' versions of data in the system, for download by users. Files are cached on the filesystem and reused if possible, rather than recreating them every time.Never use this service in a
Transactional
context, it uses locks for files and spends significant time writing to disk.- Author:
- paul
-
-
Constructor Summary
Constructors Constructor Description ExpressionDataFileServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Path
copyMetadataFile(ExpressionExperiment ee, Path existingFile, String filename, boolean forceWrite)
Copy a generic metadata file.Path
copyMetadataFile(ExpressionExperiment ee, Path existingFile, ExpressionExperimentMetaFileType type, boolean forceWrite)
Copy a metadata file to the location of a given metadata type.int
deleteAllAnalysisFiles(ExpressionExperiment ee)
Delete all analyses files for a given experiment.int
deleteAllAnnotatedFiles(ExpressionExperiment ee)
Delete all files that contain platform annotations for a given experiment.int
deleteAllDataFiles(ExpressionExperiment ee, QuantitationType qt)
Delete all data files for a given QT.int
deleteAllFiles(ExpressionExperiment ee)
Delete any existing design, coexpression, data, or differential expression data files.int
deleteAllProcessedDataFiles(ExpressionExperiment ee)
Delete all the processed files for a given experiment.boolean
deleteCoexpressionDataFile(ExpressionExperiment ee)
Delete a coexpression data file if it exists.boolean
deleteDataFile(ExpressionExperiment ee, boolean filtered, ExpressionExperimentDataFileType type)
Delete a processed data file if it exists.boolean
deleteDataFile(ExpressionExperiment ee, QuantitationType qt, ExpressionExperimentDataFileType type)
Delete a raw or single-cell data file if it exists.boolean
deleteDesignFile(ExpressionExperiment ee)
Delete the experimental design file for a given experiment.boolean
deleteDiffExArchiveFile(DifferentialExpressionAnalysis analysis)
Delete a diff. ex. analysis archive file for a given analysis.boolean
deleteMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type)
Delete a metadata file.LockedPath
getDataFile(String filename, boolean exclusive)
Locate any data file in the data directory.LockedPath
getDataFile(String filename, boolean exclusive, long timeout, TimeUnit timeUnit)
LockedPath
getDataFile(ExpressionExperiment ee, QuantitationType qt, ExpressionExperimentDataFileType type, boolean exclusive, long timeout, TimeUnit timeUnit)
Optional<LockedPath>
getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive)
Optional<LockedPath>
getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive, long timeout, TimeUnit timeUnit)
Optional<LockedPath>
getMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type, boolean exclusive)
Locate a metadata file.void
writeDesignMatrix(ExpressionExperiment ee, Writer writer)
Writes out the experimental design for the given experiment.LockedPath
writeDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, DifferentialExpressionAnalysisConfig config)
int
writeMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean forceWrite, Path destDir)
int
writeMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, ScaleType scaleType, boolean useEnsemblIds, OutputStream stream)
int
writeMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean forceWrite, Path destDir)
Write single-cell expression data to a given output stream for a given quantitation type.int
writeMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, boolean useEnsemblIds, OutputStream stream)
Write single-cell expression data to a given output stream for a given quantitation type.LockedPath
writeOrLocateCoexpressionDataFile(ExpressionExperiment ee, boolean forceWrite)
Write or located the coexpression data file for a given experimentOptional<LockedPath>
writeOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite)
Locate or create an experimental design file for a given experiment.Optional<LockedPath>
writeOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite, long timeout, TimeUnit timeUnit)
LockedPath
writeOrLocateDiffExArchiveFile(Long analysisId, boolean forceCreate)
Locate or create the differential expression data file(s) for a given experiment.Collection<LockedPath>
writeOrLocateDiffExpressionDataFiles(ExpressionExperiment ee, boolean forceWrite)
Locate or create the differential expression data file(s) for a given experiment.Optional<LockedPath>
writeOrLocateJSONProcessedExpressionDataFile(ExpressionExperiment ee, boolean forceWrite, boolean filtered)
LockedPath
writeOrLocateJSONRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite)
LockedPath
writeOrLocateMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean forceWrite)
Write single-cell expression data to a standard location for a given quantitation type.Future<Path>
writeOrLocateMexSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean forceWrite)
Optional<LockedPath>
writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite)
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).Optional<LockedPath>
writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite, long timeout, TimeUnit timeUnit)
LockedPath
writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite)
Locate or create a new data file for the given quantitation type.LockedPath
writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite, long timeout, TimeUnit timeUnit)
LockedPath
writeOrLocateTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean forceWrite)
Write single-cell expression data to a standard location for a given quantitation type in tabular format.Future<Path>
writeOrLocateTabularSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean forceWrite)
int
writeProcessedExpressionData(ExpressionExperiment ee, boolean filtered, ScaleType scaleType, Writer writer, boolean autoFlush)
Write processed expression data to a given writer for a given quantitation type.int
writeProcessedExpressionData(ExpressionExperiment ee, List<BioAssay> samples, boolean filtered, ScaleType scaleType, Writer writer, boolean autoFlush)
int
writeRawExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, ScaleType scaleType, Writer writer, boolean autoFlush)
int
writeRawExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, Writer writer, boolean autoFlush)
Write raw expression data to a given writer for a given quantitation type.int
writeTabularSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, ScaleType scaleType, int fetchSize, Writer writer, boolean autoFlush)
int
writeTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, int fetchSize, Writer writer, boolean autoFlush)
Write single-cell expression data to a given writer for a given quantitation type in tabular format.
-
-
-
Method Detail
-
deleteAllFiles
public int deleteAllFiles(ExpressionExperiment ee)
Description copied from interface:ExpressionDataFileService
Delete any existing design, coexpression, data, or differential expression data files.Experiment metadata are not deleted, use
ExpressionDataFileService.deleteMetadataFile(ExpressionExperiment, ExpressionExperimentMetaFileType)
for that purpose.- Specified by:
deleteAllFiles
in interfaceExpressionDataFileService
- See Also:
ExpressionDataFileService.deleteDesignFile(ExpressionExperiment)
,ExpressionDataFileService.deleteAllDataFiles(ExpressionExperiment, QuantitationType)
,ExpressionDataFileService.deleteAllProcessedDataFiles(ExpressionExperiment)
,ExpressionDataFileService.deleteAllAnnotatedFiles(ExpressionExperiment)
-
deleteDesignFile
public boolean deleteDesignFile(ExpressionExperiment ee)
Description copied from interface:ExpressionDataFileService
Delete the experimental design file for a given experiment.- Specified by:
deleteDesignFile
in interfaceExpressionDataFileService
-
deleteAllAnnotatedFiles
public int deleteAllAnnotatedFiles(ExpressionExperiment ee)
Description copied from interface:ExpressionDataFileService
Delete all files that contain platform annotations for a given experiment.This includes all the data and analysis files.
- Specified by:
deleteAllAnnotatedFiles
in interfaceExpressionDataFileService
- See Also:
ExpressionDataFileService.deleteAllDataFiles(ExpressionExperiment, QuantitationType)
,ExpressionDataFileService.deleteAllProcessedDataFiles(ExpressionExperiment)
,ExpressionDataFileService.deleteDiffExArchiveFile(DifferentialExpressionAnalysis)
-
deleteAllDataFiles
public int deleteAllDataFiles(ExpressionExperiment ee, QuantitationType qt)
Description copied from interface:ExpressionDataFileService
Delete all data files for a given QT.This includes all the possible file types enumerated in
ExpressionExperimentDataFileType
.- Specified by:
deleteAllDataFiles
in interfaceExpressionDataFileService
-
deleteAllProcessedDataFiles
public int deleteAllProcessedDataFiles(ExpressionExperiment ee)
Description copied from interface:ExpressionDataFileService
Delete all the processed files for a given experiment.This includes all the possible file types enumerated in
ExpressionExperimentDataFileType
.- Specified by:
deleteAllProcessedDataFiles
in interfaceExpressionDataFileService
-
deleteAllAnalysisFiles
public int deleteAllAnalysisFiles(ExpressionExperiment ee)
Description copied from interface:ExpressionDataFileService
Delete all analyses files for a given experiment.
-
deleteDiffExArchiveFile
public boolean deleteDiffExArchiveFile(DifferentialExpressionAnalysis analysis)
Description copied from interface:ExpressionDataFileService
Delete a diff. ex. analysis archive file for a given analysis.- Specified by:
deleteDiffExArchiveFile
in interfaceExpressionDataFileService
- Returns:
- true if any file was deleted
-
deleteCoexpressionDataFile
public boolean deleteCoexpressionDataFile(ExpressionExperiment ee)
Description copied from interface:ExpressionDataFileService
Delete a coexpression data file if it exists.- Specified by:
deleteCoexpressionDataFile
in interfaceExpressionDataFileService
-
getMetadataFile
public Optional<LockedPath> getMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type, boolean exclusive) throws IOException
Description copied from interface:ExpressionDataFileService
Locate a metadata file. If the metadata file is represented by a directory (i.e.ExpressionExperimentMetaFileType.isDirectory()
is true), then the latest file in the directory is returned. If no such file exists.Optional.empty()
is returned.If the data file is being written (i.e. with
ExpressionDataFileService.copyMetadataFile(ExpressionExperiment, Path, ExpressionExperimentMetaFileType, boolean)
, this method will block until it is completed.- Specified by:
getMetadataFile
in interfaceExpressionDataFileService
- Returns:
- the metadata file or empty if none is present in the case of a directory-structured metadata
- Throws:
IOException
-
getMetadataFile
public Optional<LockedPath> getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive) throws IOException
- Specified by:
getMetadataFile
in interfaceExpressionDataFileService
- Throws:
IOException
-
getMetadataFile
public Optional<LockedPath> getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive, long timeout, TimeUnit timeUnit) throws InterruptedException, TimeoutException, IOException
- Specified by:
getMetadataFile
in interfaceExpressionDataFileService
- Throws:
InterruptedException
TimeoutException
IOException
-
copyMetadataFile
public Path copyMetadataFile(ExpressionExperiment ee, Path existingFile, ExpressionExperimentMetaFileType type, boolean forceWrite) throws IOException
Description copied from interface:ExpressionDataFileService
Copy a metadata file to the location of a given metadata type.Writing to a directory (i.e.
ExpressionExperimentMetaFileType.isDirectory()
is true) is not supported.If the metadata file is in use, this method will block until it is released.
- Specified by:
copyMetadataFile
in interfaceExpressionDataFileService
existingFile
- file to copy, must existforceWrite
- override any existing metadata file- Returns:
- the resulting metadata file, which can also be retrieved with
ExpressionDataFileService.getMetadataFile(ExpressionExperiment, ExpressionExperimentMetaFileType, boolean)
- Throws:
IOException
-
copyMetadataFile
public Path copyMetadataFile(ExpressionExperiment ee, Path existingFile, String filename, boolean forceWrite) throws IOException
Description copied from interface:ExpressionDataFileService
Copy a generic metadata file.This can only be used for metadata files that are not listed in
ExpressionExperimentMetaFileType
; using any of these reserved filenames will result in an exception. In addition,CHANGELOG.md
is also reserved, useExpressionMetadataChangelogFileService
to manipulate it.- Specified by:
copyMetadataFile
in interfaceExpressionDataFileService
- Throws:
IOException
-
deleteMetadataFile
public boolean deleteMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type) throws IOException
Description copied from interface:ExpressionDataFileService
Delete a metadata file.If the metadata file is organized as a directory, it is deleted recursively.
If the metadata file is in use, this method will block until it is released.
- Specified by:
deleteMetadataFile
in interfaceExpressionDataFileService
type
- the type of metadata file to delete- Returns:
- true if a metadata file was deleted
- Throws:
IOException
-
getDataFile
public LockedPath getDataFile(String filename, boolean exclusive) throws IOException
Description copied from interface:ExpressionDataFileService
Locate any data file in the data directory.- Specified by:
getDataFile
in interfaceExpressionDataFileService
exclusive
- if true, acquire an exclusive lock on the file- Throws:
IOException
-
getDataFile
public LockedPath getDataFile(String filename, boolean exclusive, long timeout, TimeUnit timeUnit) throws IOException, InterruptedException, TimeoutException
- Specified by:
getDataFile
in interfaceExpressionDataFileService
- Throws:
IOException
InterruptedException
TimeoutException
-
getDataFile
public LockedPath getDataFile(ExpressionExperiment ee, QuantitationType qt, ExpressionExperimentDataFileType type, boolean exclusive, long timeout, TimeUnit timeUnit) throws InterruptedException, TimeoutException, IOException
- Specified by:
getDataFile
in interfaceExpressionDataFileService
- Throws:
InterruptedException
TimeoutException
IOException
-
deleteDataFile
public boolean deleteDataFile(ExpressionExperiment ee, QuantitationType qt, ExpressionExperimentDataFileType type) throws IOException
Description copied from interface:ExpressionDataFileService
Delete a raw or single-cell data file if it exists.If the data file is in use, this method will block until it is released.
- Specified by:
deleteDataFile
in interfaceExpressionDataFileService
- Returns:
- true if the file was deleted, false if it did not exist
- Throws:
IOException
-
deleteDataFile
public boolean deleteDataFile(ExpressionExperiment ee, boolean filtered, ExpressionExperimentDataFileType type) throws IOException
Description copied from interface:ExpressionDataFileService
Delete a processed data file if it exists.If the data file is in use, this method will block until it is released.
- Specified by:
deleteDataFile
in interfaceExpressionDataFileService
- Returns:
- true if the file was deleted, false if it did not exist
- Throws:
IOException
-
writeTabularSingleCellExpressionData
public int writeTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, int fetchSize, Writer writer, boolean autoFlush) throws IOException
Description copied from interface:ExpressionDataFileService
Write single-cell expression data to a given writer for a given quantitation type in tabular format.- Specified by:
writeTabularSingleCellExpressionData
in interfaceExpressionDataFileService
- Parameters:
ee
- the experiment to useqt
- the quantitation type to retrievescaleType
- a scale type to use or null to leave the data untransformedfetchSize
- retrieve data in a streaming fashion- Throws:
IOException
- See Also:
TabularMatrixWriter
-
writeTabularSingleCellExpressionData
public int writeTabularSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, int fetchSize, Writer writer, boolean autoFlush) throws IOException
- Specified by:
writeTabularSingleCellExpressionData
in interfaceExpressionDataFileService
- Throws:
IOException
-
writeOrLocateTabularSingleCellExpressionData
public LockedPath writeOrLocateTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean forceWrite) throws IOException
Description copied from interface:ExpressionDataFileService
Write single-cell expression data to a standard location for a given quantitation type in tabular format.- Specified by:
writeOrLocateTabularSingleCellExpressionData
in interfaceExpressionDataFileService
- Returns:
- a path where the vectors were written
- Throws:
IOException
- See Also:
ExpressionDataFileService.writeTabularSingleCellExpressionData(ExpressionExperiment, QuantitationType, ScaleType, int, Writer, boolean)
,TabularMatrixWriter
-
writeOrLocateTabularSingleCellExpressionDataAsync
public Future<Path> writeOrLocateTabularSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean forceWrite)
-
writeMexSingleCellExpressionData
public int writeMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, OutputStream stream) throws IOException
Description copied from interface:ExpressionDataFileService
Write single-cell expression data to a given output stream for a given quantitation type.Note: this method is memory intensive because the whole matrix needs to be in-memory to write each individual sample matrices. Thus, no streaming is possible.
- Specified by:
writeMexSingleCellExpressionData
in interfaceExpressionDataFileService
- Parameters:
ee
- the experiment to useqt
- the quantitation type to retrievescaleType
- a scale type to use or null to leave the data untransformeduseEnsemblIds
- use Ensembl IDs instead of official gene symbols- Throws:
IOException
- See Also:
MexMatrixWriter
-
writeMexSingleCellExpressionData
public int writeMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, OutputStream stream) throws IOException
- Specified by:
writeMexSingleCellExpressionData
in interfaceExpressionDataFileService
- Throws:
IOException
-
writeMexSingleCellExpressionData
public int writeMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean forceWrite, Path destDir) throws IOException
Description copied from interface:ExpressionDataFileService
Write single-cell expression data to a given output stream for a given quantitation type.- Specified by:
writeMexSingleCellExpressionData
in interfaceExpressionDataFileService
- Parameters:
ee
- the experiment to useqt
- the quantitation type to retrievescaleType
- a scale type to use or null to leave the data untransformeduseEnsemblIds
- use Ensembl IDs instead of official gene symbolsfetchSize
- fetch size to use for streaming, or load everything in memory of zero or lessforceWrite
- whether to force write and ignore any pre-existing directory- Throws:
IOException
- See Also:
MexMatrixWriter
-
writeMexSingleCellExpressionData
public int writeMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean forceWrite, Path destDir) throws IOException
- Specified by:
writeMexSingleCellExpressionData
in interfaceExpressionDataFileService
- Throws:
IOException
-
writeOrLocateMexSingleCellExpressionData
public LockedPath writeOrLocateMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean forceWrite) throws IOException
Description copied from interface:ExpressionDataFileService
Write single-cell expression data to a standard location for a given quantitation type.- Specified by:
writeOrLocateMexSingleCellExpressionData
in interfaceExpressionDataFileService
- Returns:
- a path where the vectors were written
- Throws:
IOException
- See Also:
ExpressionDataFileService.writeMexSingleCellExpressionData(ExpressionExperiment, QuantitationType, ScaleType, boolean, int, boolean, Path)
,MexMatrixWriter
-
writeOrLocateMexSingleCellExpressionDataAsync
public Future<Path> writeOrLocateMexSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean forceWrite)
-
writeRawExpressionData
public int writeRawExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, Writer writer, boolean autoFlush) throws IOException
Description copied from interface:ExpressionDataFileService
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
.- Specified by:
writeRawExpressionData
in interfaceExpressionDataFileService
- Parameters:
ee
- the expression experimentqt
- a quantitation type to usescaleType
- a scale type to use or null to leave the data untransformedwriter
- the destination for the raw expression data- Throws:
IOException
- if operations with the writer fails
-
writeRawExpressionData
public int writeRawExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, Writer writer, boolean autoFlush) throws IOException
- Specified by:
writeRawExpressionData
in interfaceExpressionDataFileService
- Throws:
IOException
-
writeDesignMatrix
public void writeDesignMatrix(ExpressionExperiment ee, Writer writer) throws IOException
Description copied from interface:ExpressionDataFileService
Writes out the experimental design for the given experiment.The bioassays (col 0) matches the header row of the data matrix printed out by the
MatrixWriter
.- Specified by:
writeDesignMatrix
in interfaceExpressionDataFileService
- Throws:
IOException
- See Also:
ExperimentalDesignWriter
-
writeProcessedExpressionData
public int writeProcessedExpressionData(ExpressionExperiment ee, boolean filtered, @Nullable ScaleType scaleType, Writer writer, boolean autoFlush) throws FilteringException, IOException
Description copied from interface:ExpressionDataFileService
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
.- Specified by:
writeProcessedExpressionData
in interfaceExpressionDataFileService
- Parameters:
ee
- the expression experimentwriter
- the destination for the raw expression data- Throws:
IOException
- if operations with the writer failsFilteringException
-
writeProcessedExpressionData
public int writeProcessedExpressionData(ExpressionExperiment ee, List<BioAssay> samples, boolean filtered, @Nullable ScaleType scaleType, Writer writer, boolean autoFlush) throws FilteringException, IOException
- Specified by:
writeProcessedExpressionData
in interfaceExpressionDataFileService
- Throws:
FilteringException
IOException
-
writeOrLocateCoexpressionDataFile
public LockedPath writeOrLocateCoexpressionDataFile(ExpressionExperiment ee, boolean forceWrite) throws IOException
Description copied from interface:ExpressionDataFileService
Write or located the coexpression data file for a given experiment- Specified by:
writeOrLocateCoexpressionDataFile
in interfaceExpressionDataFileService
- Parameters:
ee
- the experimentforceWrite
- whether to force write- Returns:
- file
- Throws:
IOException
-
writeOrLocateProcessedDataFile
public Optional<LockedPath> writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite) throws IOException, FilteringException
Description copied from interface:ExpressionDataFileService
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.- Specified by:
writeOrLocateProcessedDataFile
in interfaceExpressionDataFileService
- Parameters:
ee
- the experimentfiltered
- filteredforceWrite
- force re-write even if file already exists and is up to date.- Returns:
- file, or empty if the experiment has no processed vectors
- Throws:
IOException
FilteringException
-
writeOrLocateProcessedDataFile
public Optional<LockedPath> writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite, long timeout, TimeUnit timeUnit) throws TimeoutException, IOException, InterruptedException, FilteringException
- Specified by:
writeOrLocateProcessedDataFile
in interfaceExpressionDataFileService
- Throws:
TimeoutException
IOException
InterruptedException
FilteringException
-
writeOrLocateRawExpressionDataFile
public LockedPath writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite) throws IOException
Description copied from interface:ExpressionDataFileService
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.- Specified by:
writeOrLocateRawExpressionDataFile
in interfaceExpressionDataFileService
type
- the quantitation typeforceWrite
- To not return the existing file, but create it anew.- Returns:
- file
- Throws:
IOException
-
writeOrLocateRawExpressionDataFile
public LockedPath writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite, long timeout, TimeUnit timeUnit) throws TimeoutException, IOException, InterruptedException
- Specified by:
writeOrLocateRawExpressionDataFile
in interfaceExpressionDataFileService
- Throws:
TimeoutException
IOException
InterruptedException
-
writeOrLocateDesignFile
public Optional<LockedPath> writeOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite) throws IOException
Description copied from interface:ExpressionDataFileService
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.- Specified by:
writeOrLocateDesignFile
in interfaceExpressionDataFileService
- Parameters:
ee
- the experimentforceWrite
- force re-write even if file already exists and is up to date- Returns:
- a file or empty if the experiment does not have a design
- Throws:
IOException
- See Also:
ExpressionDataFileService.writeDesignMatrix(ExpressionExperiment, Writer)
-
writeOrLocateDesignFile
public Optional<LockedPath> writeOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite, long timeout, TimeUnit timeUnit) throws TimeoutException, IOException, InterruptedException
- Specified by:
writeOrLocateDesignFile
in interfaceExpressionDataFileService
- Throws:
TimeoutException
IOException
InterruptedException
-
writeOrLocateDiffExpressionDataFiles
public Collection<LockedPath> writeOrLocateDiffExpressionDataFiles(ExpressionExperiment ee, boolean forceWrite) throws IOException
Description copied from interface:ExpressionDataFileService
Locate or create the differential expression data file(s) for a given experiment.- Specified by:
writeOrLocateDiffExpressionDataFiles
in interfaceExpressionDataFileService
- Parameters:
ee
- the experimentforceWrite
- whether to force write- Returns:
- collection of files, one per analysis.
- Throws:
IOException
-
writeOrLocateDiffExArchiveFile
public LockedPath writeOrLocateDiffExArchiveFile(Long analysisId, boolean forceCreate) throws IOException
Description copied from interface:ExpressionDataFileService
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)- Specified by:
writeOrLocateDiffExArchiveFile
in interfaceExpressionDataFileService
- Parameters:
analysisId
- analysis IDforceCreate
- whether to force creation- Returns:
- file
- Throws:
IOException
-
writeDiffExAnalysisArchiveFile
public LockedPath writeDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, @Nullable DifferentialExpressionAnalysisConfig config) throws IOException
- Specified by:
writeDiffExAnalysisArchiveFile
in interfaceExpressionDataFileService
- Throws:
IOException
-
writeOrLocateJSONProcessedExpressionDataFile
public Optional<LockedPath> writeOrLocateJSONProcessedExpressionDataFile(ExpressionExperiment ee, boolean forceWrite, boolean filtered) throws FilteringException, IOException
- Specified by:
writeOrLocateJSONProcessedExpressionDataFile
in interfaceExpressionDataFileService
- Throws:
FilteringException
IOException
- See Also:
ExpressionDataFileService.writeOrLocateProcessedDataFile(ExpressionExperiment, boolean, boolean)
-
writeOrLocateJSONRawExpressionDataFile
public LockedPath writeOrLocateJSONRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite) throws IOException
- Specified by:
writeOrLocateJSONRawExpressionDataFile
in interfaceExpressionDataFileService
- Throws:
IOException
- See Also:
ExpressionDataFileService.writeOrLocateRawExpressionDataFile(ExpressionExperiment, QuantitationType, boolean)
-
-