Class ExpressionDataFileServiceImpl
- All Implemented Interfaces:
ExpressionDataFileService
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 -
Method Summary
Modifier and TypeMethodDescriptioncopyMetadataFile(ExpressionExperiment ee, Path existingFile, String filename, boolean forceWrite) Copy a generic metadata file.copyMetadataFile(ExpressionExperiment ee, Path existingFile, ExpressionExperimentMetaFileType type, boolean forceWrite) Copy a metadata file to the location of a given metadata type.copyMultiQCReport(ExpressionExperiment ee, Path existingFile, ExpressionExperimentMetaFileType fileType, boolean forceWrite) Copy a MultiQC report.intDelete all analyses files for a given experiment.intDelete all files that contain platform annotations for a given experiment.intDelete all data files for a given QT.intDelete any existing design, coexpression, data, or differential expression data files.intDelete all the processed files for a given experiment.booleanDelete a coexpression data file if it exists.booleandeleteDataFile(ExpressionExperiment ee, boolean filtered, ExpressionExperimentDataFileType type) Delete a processed data file if it exists.booleanDelete a raw or single-cell data file if it exists.booleanDelete the experimental design file for a given experiment.booleanDelete a diff.booleanDelete a metadata file.getDataFile(String filename, boolean exclusive) Locate any data file in the data directory.getDataFile(String filename, boolean exclusive, long timeout, TimeUnit timeUnit) getDataFile(ExpressionExperiment ee, QuantitationType qt, ExpressionExperimentDataFileType type, boolean exclusive, long timeout, TimeUnit timeUnit) getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive) getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive, long timeout, TimeUnit timeUnit) getMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type, boolean exclusive) Locate a metadata file.intwriteCellBrowserSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush) voidwriteDesignMatrix(ExpressionExperiment ee, Writer writer, boolean autoFlush) Writes out the experimental design for the given experiment.voidwriteDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, OutputStream stream) Write a differential expression analysis archive file for a given analysis to an output stream.voidwriteDiffExAnalysisArchiveFileById(Long analysisId, OutputStream outputStream) writeDiffExAnalysisArchiveFiles(Collection<DifferentialExpressionAnalysis> analyses, Path outputDir, boolean forceWrite) writeDiffExAnalysisArchiveFiles(ExpressionExperiment ee, Path outputDir, boolean forceWrite) Write all the differential expression data files for a given experiment to a particular directory.intwriteMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, Path destDir, boolean autoFlush) intwriteMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, ScaleType scaleType, boolean useEnsemblIds, OutputStream stream) intwriteMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, Path destDir, boolean autoFlush) Write single-cell expression data to a given output stream for a given quantitation type.intwriteMexSingleCellExpressionData(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.writeOrLocateCoexpressionDataFile(ExpressionExperiment ee, boolean forceWrite) Write or located the coexpression data file for a given experimentwriteOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite) Locate or create an experimental design file for a given experiment.writeOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite, long timeout, TimeUnit timeUnit) writeOrLocateDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, boolean forceCreate) Locate or create the differential expression archive file for a given analysis.writeOrLocateDiffExAnalysisArchiveFileById(Long analysisId, boolean forceCreate) Locate or create the differential expression archive file for a given analysis ID.writeOrLocateDiffExAnalysisArchiveFiles(ExpressionExperiment ee, boolean forceWrite) Locate or create the differential expression archive file(s) for a given experiment.writeOrLocateJSONProcessedExpressionDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite) writeOrLocateJSONRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite) writeOrLocateMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) Write single-cell expression data to a standard location for a given quantitation type.writeOrLocateMexSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) 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).writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite, long timeout, TimeUnit timeUnit) writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite) Locate or create a new data file for the given quantitation type.writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite, long timeout, TimeUnit timeUnit) writeOrLocateTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) Write single-cell expression data to a standard location for a given quantitation type in tabular format.writeOrLocateTabularSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) intwriteProcessedExpressionData(ExpressionExperiment ee, boolean filtered, ScaleType scaleType, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) Write processed expression data to a given writer for a given quantitation type.intwriteProcessedExpressionData(ExpressionExperiment ee, List<BioAssay> samples, boolean filtered, ScaleType scaleType, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) intwriteRawExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, ScaleType scaleType, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) intwriteRawExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) Write raw expression data to a given writer for a given quantitation type.intwriteTabularSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush) intwriteTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush) Write single-cell expression data to a given writer for a given quantitation type in tabular format.
-
Constructor Details
-
ExpressionDataFileServiceImpl
public ExpressionDataFileServiceImpl()
-
-
Method Details
-
deleteAllFiles
Description copied from interface:ExpressionDataFileServiceDelete 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:
deleteAllFilesin interfaceExpressionDataFileService- See Also:
-
deleteDesignFile
Description copied from interface:ExpressionDataFileServiceDelete the experimental design file for a given experiment.- Specified by:
deleteDesignFilein interfaceExpressionDataFileService
-
deleteAllAnnotatedFiles
Description copied from interface:ExpressionDataFileServiceDelete all files that contain platform annotations for a given experiment.This includes all the data and analysis files.
- Specified by:
deleteAllAnnotatedFilesin interfaceExpressionDataFileService- See Also:
-
deleteAllDataFiles
Description copied from interface:ExpressionDataFileServiceDelete all data files for a given QT.This includes all the possible file types enumerated in
ExpressionExperimentDataFileType.- Specified by:
deleteAllDataFilesin interfaceExpressionDataFileService
-
deleteAllProcessedDataFiles
Description copied from interface:ExpressionDataFileServiceDelete all the processed files for a given experiment.This includes all the possible file types enumerated in
ExpressionExperimentDataFileType.- Specified by:
deleteAllProcessedDataFilesin interfaceExpressionDataFileService
-
deleteAllAnalysisFiles
Description copied from interface:ExpressionDataFileServiceDelete all analyses files for a given experiment.- Specified by:
deleteAllAnalysisFilesin interfaceExpressionDataFileService- See Also:
-
deleteDiffExArchiveFile
Description copied from interface:ExpressionDataFileServiceDelete a diff. ex. analysis archive file for a given analysis.- Specified by:
deleteDiffExArchiveFilein interfaceExpressionDataFileService- Returns:
- true if any file was deleted
-
deleteCoexpressionDataFile
Description copied from interface:ExpressionDataFileServiceDelete a coexpression data file if it exists.- Specified by:
deleteCoexpressionDataFilein interfaceExpressionDataFileService
-
getMetadataFile
public Optional<LockedPath> getMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type, boolean exclusive) throws IOException Description copied from interface:ExpressionDataFileServiceLocate 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:
getMetadataFilein interfaceExpressionDataFileService- Returns:
- the metadata file or empty if none is present in the case of a directory-structured metadata
- Throws:
IOException
-
getMetadataFile
public LockedPath getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive) throws IOException - Specified by:
getMetadataFilein interfaceExpressionDataFileService- Throws:
IOException
-
getMetadataFile
public LockedPath getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive, long timeout, TimeUnit timeUnit) throws InterruptedException, TimeoutException, IOException - Specified by:
getMetadataFilein interfaceExpressionDataFileService- Throws:
InterruptedExceptionTimeoutExceptionIOException
-
copyMetadataFile
public Path copyMetadataFile(ExpressionExperiment ee, Path existingFile, ExpressionExperimentMetaFileType type, boolean forceWrite) throws IOException Description copied from interface:ExpressionDataFileServiceCopy 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:
copyMetadataFilein interfaceExpressionDataFileService- Parameters:
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:ExpressionDataFileServiceCopy 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.mdis also reserved, useExpressionMetadataChangelogFileServiceto manipulate it.- Specified by:
copyMetadataFilein interfaceExpressionDataFileService- Throws:
IOException
-
copyMultiQCReport
public Path copyMultiQCReport(ExpressionExperiment ee, Path existingFile, ExpressionExperimentMetaFileType fileType, boolean forceWrite) throws IOException Description copied from interface:ExpressionDataFileServiceCopy a MultiQC report.This is a helper based on
ExpressionDataFileService.copyMetadataFile(ExpressionExperiment, Path, String, boolean)that will automatically copy the main HTML report file as well as the log and JSON data files if they exist.:w- Specified by:
copyMultiQCReportin interfaceExpressionDataFileService- Parameters:
fileType- must be a MultiQC report (i.e.ExpressionExperimentMetaFileType.RNASEQ_PIPELINE_REPORTorExpressionExperimentMetaFileType.CELL_TYPE_ANNOTATION_PIPELINE_REPORT)- Throws:
IOException
-
deleteMetadataFile
public boolean deleteMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type) throws IOException Description copied from interface:ExpressionDataFileServiceDelete 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:
deleteMetadataFilein interfaceExpressionDataFileService- Parameters:
type- the type of metadata file to delete- Returns:
- true if a metadata file was deleted
- Throws:
IOException
-
getDataFile
Description copied from interface:ExpressionDataFileServiceLocate any data file in the data directory.- Specified by:
getDataFilein interfaceExpressionDataFileService- Parameters:
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:
getDataFilein interfaceExpressionDataFileService- Throws:
IOExceptionInterruptedExceptionTimeoutException
-
getDataFile
public LockedPath getDataFile(ExpressionExperiment ee, QuantitationType qt, ExpressionExperimentDataFileType type, boolean exclusive, long timeout, TimeUnit timeUnit) throws InterruptedException, TimeoutException, IOException - Specified by:
getDataFilein interfaceExpressionDataFileService- Throws:
InterruptedExceptionTimeoutExceptionIOException
-
deleteDataFile
public boolean deleteDataFile(ExpressionExperiment ee, QuantitationType qt, ExpressionExperimentDataFileType type) throws IOException Description copied from interface:ExpressionDataFileServiceDelete 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:
deleteDataFilein 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:ExpressionDataFileServiceDelete a processed data file if it exists.If the data file is in use, this method will block until it is released.
- Specified by:
deleteDataFilein 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, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush) throws IOException Description copied from interface:ExpressionDataFileServiceWrite single-cell expression data to a given writer for a given quantitation type in tabular format.- Specified by:
writeTabularSingleCellExpressionDatain interfaceExpressionDataFileService- Parameters:
ee- the experiment to useqt- the quantitation type to retrievescaleType- a scale type to use or null to leave the data untransformeduseBioAssayIds- whether to use bioassay and biomaterial IDs instead of names or short namesuseRawColumnNames- whether to use raw column names instead of R-friendly onesfetchSize- retrieve data in a streaming fashionuseCursorFetchIfSupported- use cursor fetching if supported by the database. It is not recommended to use this for public-facing operations because it may require a lot of memory- Throws:
IOException- See Also:
-
writeTabularSingleCellExpressionData
public int writeTabularSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush) throws IOException - Specified by:
writeTabularSingleCellExpressionDatain interfaceExpressionDataFileService- Throws:
IOException
-
writeOrLocateTabularSingleCellExpressionData
public LockedPath writeOrLocateTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) throws IOException Description copied from interface:ExpressionDataFileServiceWrite single-cell expression data to a standard location for a given quantitation type in tabular format.- Specified by:
writeOrLocateTabularSingleCellExpressionDatain interfaceExpressionDataFileService- Returns:
- a path where the vectors were written
- Throws:
IOException- See Also:
-
writeOrLocateTabularSingleCellExpressionDataAsync
public Future<Path> writeOrLocateTabularSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) - Specified by:
writeOrLocateTabularSingleCellExpressionDataAsyncin interfaceExpressionDataFileService- See Also:
-
writeCellBrowserSingleCellExpressionData
public int writeCellBrowserSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush) throws IOException - Specified by:
writeCellBrowserSingleCellExpressionDatain interfaceExpressionDataFileService- Throws:
IOException
-
writeMexSingleCellExpressionData
public int writeMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, OutputStream stream) throws IOException Description copied from interface:ExpressionDataFileServiceWrite 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:
writeMexSingleCellExpressionDatain 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:
-
writeMexSingleCellExpressionData
public int writeMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, OutputStream stream) throws IOException - Specified by:
writeMexSingleCellExpressionDatain interfaceExpressionDataFileService- Throws:
IOException
-
writeMexSingleCellExpressionData
public int writeMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, Path destDir, boolean autoFlush) throws IOException Description copied from interface:ExpressionDataFileServiceWrite single-cell expression data to a given output stream for a given quantitation type.- Specified by:
writeMexSingleCellExpressionDatain 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 lessuseCursorFetchIfSupported- use cursor fetching if supported by the database. It is not recommended to use this for public-facing operations because it may require a lot of memoryforceWrite- whether to force write and ignore any pre-existing directorydestDir- the destination directory to write the data to. It is now allowed to write under the${gemma.appdata.home}/dateFilesdirectory using this method, useExpressionDataFileService.writeOrLocateMexSingleCellExpressionData(ExpressionExperiment, QuantitationType, int, boolean, boolean)instead.- Throws:
IOException- See Also:
-
writeMexSingleCellExpressionData
public int writeMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, Path destDir, boolean autoFlush) throws IOException - Specified by:
writeMexSingleCellExpressionDatain interfaceExpressionDataFileService- Throws:
IOException
-
writeOrLocateMexSingleCellExpressionData
public LockedPath writeOrLocateMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) throws IOException Description copied from interface:ExpressionDataFileServiceWrite single-cell expression data to a standard location for a given quantitation type.- Specified by:
writeOrLocateMexSingleCellExpressionDatain interfaceExpressionDataFileService- Returns:
- a path where the vectors were written
- Throws:
IOException- See Also:
-
writeOrLocateMexSingleCellExpressionDataAsync
public Future<Path> writeOrLocateMexSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) - Specified by:
writeOrLocateMexSingleCellExpressionDataAsyncin interfaceExpressionDataFileService- See Also:
-
writeRawExpressionData
public int writeRawExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) throws IOException Description copied from interface:ExpressionDataFileServiceWrite raw expression data to a given writer for a given quantitation type.Note: For compression, wrap a
GZIPOutputStreamwith aOutputStreamWriter. To write to a string, consider usingStringWriter.- Specified by:
writeRawExpressionDatain interfaceExpressionDataFileService- Parameters:
ee- the expression experimentqt- a quantitation type to usescaleType- a scale type to use or null to leave the data untransformedexcludeSampleIdentifiers-useBioAssayIds- whether to use bioassay and biomaterial IDs instead of names or short namesuseRawColumnNames- whether to use raw column names instead of R-friendly oneswriter- 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, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) throws IOException - Specified by:
writeRawExpressionDatain interfaceExpressionDataFileService- Throws:
IOException
-
writeDesignMatrix
public void writeDesignMatrix(ExpressionExperiment ee, Writer writer, boolean autoFlush) throws IOException Description copied from interface:ExpressionDataFileServiceWrites 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:
writeDesignMatrixin interfaceExpressionDataFileService- Throws:
IOException- See Also:
-
writeProcessedExpressionData
public int writeProcessedExpressionData(ExpressionExperiment ee, boolean filtered, @Nullable ScaleType scaleType, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) throws FilteringException, IOException Description copied from interface:ExpressionDataFileServiceWrite processed expression data to a given writer for a given quantitation type.Note: For compression, wrap a
GZIPOutputStreamwith aOutputStreamWriter. To write to a string, consider usingStringWriter.- Specified by:
writeProcessedExpressionDatain interfaceExpressionDataFileService- Parameters:
ee- the expression experimentexcludeSampleIdentifiers-useBioAssayIds- whether to use bioassay and biomaterial IDs instead of names or short namesuseRawColumnNames- whether to use raw column names instead of R-friendly oneswriter- 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, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) throws FilteringException, IOException - Specified by:
writeProcessedExpressionDatain interfaceExpressionDataFileService- Throws:
FilteringExceptionIOException
-
writeOrLocateCoexpressionDataFile
public LockedPath writeOrLocateCoexpressionDataFile(ExpressionExperiment ee, boolean forceWrite) throws IOException Description copied from interface:ExpressionDataFileServiceWrite or located the coexpression data file for a given experiment- Specified by:
writeOrLocateCoexpressionDataFilein 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:ExpressionDataFileServiceLocate 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:
writeOrLocateProcessedDataFilein 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:
IOExceptionFilteringException
-
writeOrLocateProcessedDataFile
public Optional<LockedPath> writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite, long timeout, TimeUnit timeUnit) throws TimeoutException, IOException, InterruptedException, FilteringException - Specified by:
writeOrLocateProcessedDataFilein interfaceExpressionDataFileService- Throws:
TimeoutExceptionIOExceptionInterruptedExceptionFilteringException
-
writeOrLocateRawExpressionDataFile
public LockedPath writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite) throws IOException Description copied from interface:ExpressionDataFileServiceLocate 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:
writeOrLocateRawExpressionDataFilein interfaceExpressionDataFileService- Parameters:
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:
writeOrLocateRawExpressionDataFilein interfaceExpressionDataFileService- Throws:
TimeoutExceptionIOExceptionInterruptedException
-
writeOrLocateDesignFile
public Optional<LockedPath> writeOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite) throws IOException Description copied from interface:ExpressionDataFileServiceLocate 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:
writeOrLocateDesignFilein 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:
-
writeOrLocateDesignFile
public Optional<LockedPath> writeOrLocateDesignFile(ExpressionExperiment ee, boolean forceWrite, long timeout, TimeUnit timeUnit) throws TimeoutException, IOException, InterruptedException - Specified by:
writeOrLocateDesignFilein interfaceExpressionDataFileService- Throws:
TimeoutExceptionIOExceptionInterruptedException
-
writeOrLocateJSONProcessedExpressionDataFile
public Optional<LockedPath> writeOrLocateJSONProcessedExpressionDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite) throws FilteringException, IOException - Specified by:
writeOrLocateJSONProcessedExpressionDataFilein interfaceExpressionDataFileService- Throws:
FilteringExceptionIOException- See Also:
-
writeOrLocateJSONRawExpressionDataFile
public LockedPath writeOrLocateJSONRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite) throws IOException - Specified by:
writeOrLocateJSONRawExpressionDataFilein interfaceExpressionDataFileService- Throws:
IOException- See Also:
-
writeOrLocateDiffExAnalysisArchiveFiles
public Collection<Path> writeOrLocateDiffExAnalysisArchiveFiles(ExpressionExperiment ee, boolean forceWrite) throws IOException Description copied from interface:ExpressionDataFileServiceLocate or create the differential expression archive file(s) for a given experiment.- Specified by:
writeOrLocateDiffExAnalysisArchiveFilesin interfaceExpressionDataFileService- Parameters:
ee- the experimentforceWrite- whether to force write- Returns:
- collection of files, one per analysis.
- Throws:
IOException- See Also:
-
writeOrLocateDiffExAnalysisArchiveFileById
public LockedPath writeOrLocateDiffExAnalysisArchiveFileById(Long analysisId, boolean forceCreate) throws IOException Description copied from interface:ExpressionDataFileServiceLocate or create the differential expression archive file for a given analysis ID.- Specified by:
writeOrLocateDiffExAnalysisArchiveFileByIdin interfaceExpressionDataFileService- Throws:
IOException- See Also:
-
writeOrLocateDiffExAnalysisArchiveFile
public LockedPath writeOrLocateDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, boolean forceCreate) throws IOException Description copied from interface:ExpressionDataFileServiceLocate or create the differential expression archive file for a given analysis.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:
writeOrLocateDiffExAnalysisArchiveFilein interfaceExpressionDataFileService- Parameters:
analysis- analysisforceCreate- whether to force creation- Returns:
- a locked path to the archive file, which must be released after use
- Throws:
IOException
-
writeDiffExAnalysisArchiveFiles
public Collection<Path> writeDiffExAnalysisArchiveFiles(ExpressionExperiment ee, Path outputDir, boolean forceWrite) throws IOException Description copied from interface:ExpressionDataFileServiceWrite all the differential expression data files for a given experiment to a particular directory.- Specified by:
writeDiffExAnalysisArchiveFilesin interfaceExpressionDataFileService- Throws:
IOException
-
writeDiffExAnalysisArchiveFiles
public Collection<Path> writeDiffExAnalysisArchiveFiles(Collection<DifferentialExpressionAnalysis> analyses, Path outputDir, boolean forceWrite) throws IOException - Specified by:
writeDiffExAnalysisArchiveFilesin interfaceExpressionDataFileService- Throws:
IOException
-
writeDiffExAnalysisArchiveFileById
public void writeDiffExAnalysisArchiveFileById(Long analysisId, OutputStream outputStream) throws IOException - Specified by:
writeDiffExAnalysisArchiveFileByIdin interfaceExpressionDataFileService- Throws:
IOException- See Also:
-
writeDiffExAnalysisArchiveFile
public void writeDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, OutputStream stream) throws IOException Description copied from interface:ExpressionDataFileServiceWrite a differential expression analysis archive file for a given analysis to an output stream.- Specified by:
writeDiffExAnalysisArchiveFilein interfaceExpressionDataFileService- Throws:
IOException
-