Interface ExpressionDataFileService
- All Known Implementing Classes:
ExpressionDataFileServiceImpl
- Author:
- paul
-
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 type, 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.booleandeleteDifferentialExpressionResultSetTsvFile(Long resultSetId) Delete the cached TSV (if any) for a single differential-expression result set.booleanDelete a diff.booleanDelete a metadata file.booleangetDataFile(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.voidstreamAndWriteProcessedExpressionData(ExpressionExperiment ee, boolean filtered, boolean forceWrite, Writer writer, boolean autoFlush) Stream the processed expression data to the writer while populating the cache file in the same pass.voidstreamAndWriteRawExpressionData(ExpressionExperiment ee, QuantitationType qt, boolean forceWrite, Writer writer, boolean autoFlush) voidstreamAndWriteTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, Writer writer, boolean autoFlush) Tabular single-cell sibling ofstreamAndWriteProcessedExpressionData(ExpressionExperiment, boolean, boolean, Writer, boolean)— the payloads here are the largest in the system, so the duplicated cold build this replaces was at its most expensive on this path: two concurrent full scans of the single-cell vectors per cold request.intwriteCellBrowserSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush, Console console) voidwriteDesignMatrix(ExpressionExperiment ee, boolean useProcessedData, Writer writer, boolean autoFlush) Writes out the experimental design for the given experiment.voidwriteDesignMatrix(ExpressionExperiment ee, QuantitationType qt, Class<? extends DataVector> vectorType, Writer writer, boolean autoFlush) Writes out the experimental design for the given experiment and quantitation type.voidwriteDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, OutputStream outputStream) Write a differential expression analysis archive file for a given analysis to an output stream.voidwriteDiffExAnalysisArchiveFileById(Long id, 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, Console console) 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, Console console) 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.writeOrLocateDesignFile(ExpressionExperiment ee, boolean useProcessedQuantitationType, boolean forceWrite) Locate or create an experimental design file for a given experiment.writeOrLocateDesignFile(ExpressionExperiment ee, boolean useProcessedQuantitationType, boolean forceWrite, long timeout, TimeUnit timeUnit) writeOrLocateDifferentialExpressionResultSetTsvFile(Long resultSetId, boolean forceWrite) Locate or create a cached TSV for a single differential-expression result set.writeOrLocateDifferentialExpressionResultSetTsvFileAsync(Long resultSetId, boolean forceWrite) writeOrLocateDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, boolean forceWrite) Locate or create the differential expression archive file for a given analysis.writeOrLocateDiffExAnalysisArchiveFileAsync(DifferentialExpressionAnalysis analysis, boolean forceWrite) Build the differential expression analysis archive file off the request thread via theexpressionDataFileTaskExecutor.writeOrLocateDiffExAnalysisArchiveFileById(Long analysisId, boolean forceWrite) 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, Console console) 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) writeOrLocateProcessedDataFileAsync(ExpressionExperiment ee, boolean filtered, boolean forceWrite) Build the processed-expression data file off the request thread via theexpressionDataFileTaskExecutor.writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite) Locate or create a new data file for the given quantitation type.writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType qt, boolean forceWrite, long timeout, TimeUnit timeUnit) writeOrLocateRawExpressionDataFileAsync(ExpressionExperiment ee, QuantitationType qt, boolean forceWrite) Build the raw-expression data file off the request thread via theexpressionDataFileTaskExecutor.writeOrLocateTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, Console console) 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, Console console) intwriteTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush, Console console) Write single-cell expression data to a given writer for a given quantitation type in tabular format.
-
Method Details
-
deleteAllFiles
Delete any existing design, coexpression, data, or differential expression data files.Experiment metadata are not deleted, use
deleteMetadataFile(ExpressionExperiment, ExpressionExperimentMetaFileType)for that purpose.- See Also:
-
deleteDesignFile
Delete the experimental design file for a given experiment. -
deleteProcessedDataDesignFile
-
deleteAllAnnotatedFiles
Delete all files that contain platform annotations for a given experiment.This includes all the data and analysis files.
- See Also:
-
deleteAllDataFiles
Delete all data files for a given QT.This includes all the possible file types enumerated in
ExpressionExperimentDataFileType. -
deleteAllProcessedDataFiles
Delete all the processed files for a given experiment.This includes all the possible file types enumerated in
ExpressionExperimentDataFileType. -
deleteAllAnalysisFiles
Delete all analyses files for a given experiment.- See Also:
-
deleteDiffExArchiveFile
Delete a diff. ex. analysis archive file for a given analysis.- Returns:
- true if any file was deleted
-
deleteCoexpressionDataFile
Delete a coexpression data file if it exists. -
getMetadataFile
Optional<LockedPath> getMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type, boolean exclusive) throws IOException 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
copyMetadataFile(ExpressionExperiment, Path, ExpressionExperimentMetaFileType, boolean), this method will block until it is completed.- Returns:
- the metadata file or empty if none is present in the case of a directory-structured metadata
- Throws:
IOException
-
getMetadataFile
LockedPath getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive) throws IOException - Throws:
IOException
-
getMetadataFile
LockedPath getMetadataFile(ExpressionExperiment ee, String filename, boolean exclusive, long timeout, TimeUnit timeUnit) throws InterruptedException, TimeoutException, IOException -
copyMetadataFile
Path copyMetadataFile(ExpressionExperiment ee, Path existingFile, ExpressionExperimentMetaFileType type, boolean forceWrite) throws IOException 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.
- Parameters:
existingFile- file to copy, must existforceWrite- override any existing metadata file- Returns:
- the resulting metadata file, which can also be retrieved with
getMetadataFile(ExpressionExperiment, ExpressionExperimentMetaFileType, boolean) - Throws:
IOException
-
copyMetadataFile
Path copyMetadataFile(ExpressionExperiment ee, Path existingFile, String filename, boolean forceWrite) throws IOException 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.mdis also reserved, useExpressionMetadataChangelogFileServiceto manipulate it.- Throws:
IOException
-
copyMultiQCReport
Path copyMultiQCReport(ExpressionExperiment ee, Path existingFile, ExpressionExperimentMetaFileType type, boolean forceWrite) throws IOException Copy a MultiQC report.This is a helper based on
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- Parameters:
type- must be a MultiQC report (i.e.ExpressionExperimentMetaFileType.RNASEQ_PIPELINE_REPORTorExpressionExperimentMetaFileType.CELL_TYPE_ANNOTATION_PIPELINE_REPORT)- Throws:
IOException
-
deleteMetadataFile
boolean deleteMetadataFile(ExpressionExperiment ee, ExpressionExperimentMetaFileType type) throws IOException 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.
- Parameters:
type- the type of metadata file to delete- Returns:
- true if a metadata file was deleted
- Throws:
IOException
-
getDataFile
Locate any data file in the data directory.- Parameters:
exclusive- if true, acquire an exclusive lock on the file- Throws:
IOException
-
getDataFile
LockedPath getDataFile(String filename, boolean exclusive, long timeout, TimeUnit timeUnit) throws IOException, InterruptedException, TimeoutException -
getDataFile
LockedPath getDataFile(ExpressionExperiment ee, QuantitationType qt, ExpressionExperimentDataFileType type, boolean exclusive, long timeout, TimeUnit timeUnit) throws IOException, InterruptedException, TimeoutException -
deleteDataFile
boolean deleteDataFile(ExpressionExperiment ee, QuantitationType qt, ExpressionExperimentDataFileType type) throws IOException 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.
- Returns:
- true if the file was deleted, false if it did not exist
- Throws:
IOException
-
deleteDataFile
boolean deleteDataFile(ExpressionExperiment ee, boolean filtered, ExpressionExperimentDataFileType type) throws IOException Delete a processed data file if it exists.If the data file is in use, this method will block until it is released.
- Returns:
- true if the file was deleted, false if it did not exist
- Throws:
IOException
-
writeTabularSingleCellExpressionData
int writeTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush, @Nullable Console console) throws IOException Write single-cell expression data to a given writer for a given quantitation type in tabular format.- 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
int writeTabularSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush, @Nullable Console console) throws IOException - Throws:
IOException
-
writeOrLocateTabularSingleCellExpressionData
LockedPath writeOrLocateTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, @Nullable Console console) throws IOException Write single-cell expression data to a standard location for a given quantitation type in tabular format.- Returns:
- a path where the vectors were written
- Throws:
IOException- See Also:
-
writeOrLocateTabularSingleCellExpressionDataAsync
Future<Path> writeOrLocateTabularSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) throws RejectedExecutionException - Throws:
RejectedExecutionException- if the queue for creating data files is full- See Also:
-
writeCellBrowserSingleCellExpressionData
int writeCellBrowserSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean useBioAssayIds, boolean useRawColumnNames, int fetchSize, boolean useCursorFetchIfSupported, Writer writer, boolean autoFlush, @Nullable Console console) throws IOException - Throws:
IOException
-
writeMexSingleCellExpressionData
int writeMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, OutputStream stream) throws IOException 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.
- 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
int writeMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, OutputStream stream) throws IOException - Throws:
IOException
-
writeMexSingleCellExpressionData
int writeMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, Path destDir, boolean autoFlush, @Nullable Console console) throws IOException Write single-cell expression data to a given output stream for a given quantitation type.- 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, usewriteOrLocateMexSingleCellExpressionData(ExpressionExperiment, QuantitationType, int, boolean, boolean, Console)instead.console- console to write progress to, ignored if null- Throws:
IOException- See Also:
-
writeMexSingleCellExpressionData
int writeMexSingleCellExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, boolean useEnsemblIds, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, Path destDir, boolean autoFlush, @Nullable Console console) throws IOException - Throws:
IOException
-
writeOrLocateMexSingleCellExpressionData
LockedPath writeOrLocateMexSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, @Nullable Console console) throws IOException Write single-cell expression data to a standard location for a given quantitation type.- Returns:
- a path where the vectors were written
- Throws:
IOException- See Also:
-
writeOrLocateMexSingleCellExpressionDataAsync
Future<Path> writeOrLocateMexSingleCellExpressionDataAsync(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite) throws RejectedExecutionException - Throws:
RejectedExecutionException- if the queue for creating data files is full- See Also:
-
writeRawExpressionData
int writeRawExpressionData(ExpressionExperiment ee, QuantitationType qt, @Nullable ScaleType scaleType, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) throws IOException Write 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.- Parameters:
ee- the expression experimentqt- a quantitation type to usescaleType- a scale type to use or null to leave the data untransformedexcludeSampleIdentifiers- whether to exclude sample identifiers for the output file and only use assay identifiersuseBioAssayIds- 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
int writeRawExpressionData(ExpressionExperiment ee, List<BioAssay> samples, QuantitationType qt, @Nullable ScaleType scaleType, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) throws IOException - Throws:
IOException
-
writeProcessedExpressionData
int writeProcessedExpressionData(ExpressionExperiment ee, boolean filtered, @Nullable ScaleType scaleType, boolean excludeSampleIdentifiers, boolean useBioAssayIds, boolean useRawColumnNames, Writer writer, boolean autoFlush) throws FilteringException, IOException Write 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.- Parameters:
ee- the expression experimentexcludeSampleIdentifiers- whether to exclude sample identifiers for the output file and only use assay identifiersuseBioAssayIds- 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
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 - Throws:
FilteringExceptionIOException
-
streamAndWriteProcessedExpressionData
void streamAndWriteProcessedExpressionData(ExpressionExperiment ee, boolean filtered, boolean forceWrite, Writer writer, boolean autoFlush) throws FilteringException, IOException Stream the processed expression data to the writer while populating the cache file in the same pass.One matrix build feeds both consumers. This replaces the cold-path pattern of racing a fire-and-forget cache build against an in-band stream of the same data, which fetched the vectors, thawed the platforms and read the annotations twice per cold request. The two sides fail independently: a caller that goes away mid-stream does not abort the cache build, and a cache-file write error does not abort the stream. When another writer already holds the cache file, this degrades to a plain stream, exactly like
writeProcessedExpressionData(ExpressionExperiment, boolean, ScaleType, boolean, boolean, boolean, Writer, boolean); when the cache file turns out to be fresh by the time the lock is acquired, its content is streamed instead of being rebuilt.- Parameters:
forceWrite- rebuild the cache file even if it exists and is up to date- Throws:
FilteringExceptionIOException
-
streamAndWriteRawExpressionData
void streamAndWriteRawExpressionData(ExpressionExperiment ee, QuantitationType qt, boolean forceWrite, Writer writer, boolean autoFlush) throws IOException Raw sibling ofstreamAndWriteProcessedExpressionData(ExpressionExperiment, boolean, boolean, Writer, boolean).- Throws:
IOException
-
streamAndWriteTabularSingleCellExpressionData
void streamAndWriteTabularSingleCellExpressionData(ExpressionExperiment ee, QuantitationType qt, int fetchSize, boolean useCursorFetchIfSupported, boolean forceWrite, Writer writer, boolean autoFlush) throws IOException Tabular single-cell sibling ofstreamAndWriteProcessedExpressionData(ExpressionExperiment, boolean, boolean, Writer, boolean)— the payloads here are the largest in the system, so the duplicated cold build this replaces was at its most expensive on this path: two concurrent full scans of the single-cell vectors per cold request.- Throws:
IOException
-
writeDesignMatrix
void writeDesignMatrix(ExpressionExperiment ee, boolean useProcessedData, Writer writer, boolean autoFlush) throws IOException 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.- Throws:
IOException- See Also:
-
writeDesignMatrix
void writeDesignMatrix(ExpressionExperiment ee, QuantitationType qt, Class<? extends DataVector> vectorType, Writer writer, boolean autoFlush) throws IOException Writes out the experimental design for the given experiment and quantitation type.- Throws:
IOException
-
writeOrLocateProcessedDataFile
Optional<LockedPath> writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite) throws FilteringException, IOException 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:
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:
FilteringExceptionIOException
-
writeOrLocateProcessedDataFile
Optional<LockedPath> writeOrLocateProcessedDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite, long timeout, TimeUnit timeUnit) throws TimeoutException, IOException, InterruptedException, FilteringException -
writeOrLocateProcessedDataFileAsync
Future<Path> writeOrLocateProcessedDataFileAsync(ExpressionExperiment ee, boolean filtered, boolean forceWrite) throws RejectedExecutionException Build the processed-expression data file off the request thread via theexpressionDataFileTaskExecutor. WrapswriteOrLocateProcessedDataFile(ExpressionExperiment, boolean, boolean)so cold-cache HTTP callers can return immediately and stream the data while the cached file materializes for the next caller.- Throws:
RejectedExecutionException- if the queue for creating data files is full
-
writeOrLocateRawExpressionDataFile
LockedPath writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite) throws IOException 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:
type- the quantitation typeforceWrite- To not return the existing file, but create it anew.- Returns:
- file
- Throws:
IOException
-
writeOrLocateRawExpressionDataFile
LockedPath writeOrLocateRawExpressionDataFile(ExpressionExperiment ee, QuantitationType qt, boolean forceWrite, long timeout, TimeUnit timeUnit) throws TimeoutException, IOException, InterruptedException -
writeOrLocateRawExpressionDataFileAsync
Future<Path> writeOrLocateRawExpressionDataFileAsync(ExpressionExperiment ee, QuantitationType qt, boolean forceWrite) throws RejectedExecutionException Build the raw-expression data file off the request thread via theexpressionDataFileTaskExecutor. WrapswriteOrLocateRawExpressionDataFile(ExpressionExperiment, QuantitationType, boolean)so cold-cache HTTP callers can return immediately and stream the data while the cached file materializes for the next caller.- Throws:
RejectedExecutionException- if the queue for creating data files is full
-
writeOrLocateDesignFile
Optional<LockedPath> writeOrLocateDesignFile(ExpressionExperiment ee, boolean useProcessedQuantitationType, boolean forceWrite) throws IOException 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 experimentuseProcessedQuantitationType- if true, produce the design for the assays of the processed data instead of the assays of the experiment. These two are usually the same, but they will differ if there is a sub-sample structure (i.e. single-cell data).forceWrite- 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
Optional<LockedPath> writeOrLocateDesignFile(ExpressionExperiment ee, boolean useProcessedQuantitationType, boolean forceWrite, long timeout, TimeUnit timeUnit) throws TimeoutException, IOException, InterruptedException -
writeOrLocateJSONProcessedExpressionDataFile
Optional<LockedPath> writeOrLocateJSONProcessedExpressionDataFile(ExpressionExperiment ee, boolean filtered, boolean forceWrite) throws FilteringException, IOException - Throws:
FilteringExceptionIOException- See Also:
-
writeOrLocateJSONRawExpressionDataFile
LockedPath writeOrLocateJSONRawExpressionDataFile(ExpressionExperiment ee, QuantitationType type, boolean forceWrite) throws IOException - Throws:
IOException- See Also:
-
writeOrLocateDifferentialExpressionResultSetTsvFile
LockedPath writeOrLocateDifferentialExpressionResultSetTsvFile(Long resultSetId, boolean forceWrite) throws IOException Locate or create a cached TSV for a single differential-expression result set.Result sets are immutable post-creation, so the on-disk cache is effectively permanent.
On a cache hit, returns the existing path with a shared lock (no DB hit). On a cache miss, materializes the result set + contrasts + factor values + result-to-genes map via
ExpressionAnalysisResultSetService, writes the TSV viaExpressionAnalysisResultSetFileService, stores it gzipped under<dataDir>/resultSets/resultSet_<id>.tsv.gz, and returns the locked path. The/resultSets/{id}REST endpoint sends those bytes verbatim via sendfile under@GZIP(alreadyCompressed = true)— it cannot compress on the fly, because sendfile bypasses the encoder's stream entirely.- Parameters:
resultSetId- the result-set ID to materializeforceWrite- ignore any existing cached file- Returns:
- a locked path to the TSV file, which must be released after use
- Throws:
NoSuchElementException- if the result set cannot be foundIOException
-
writeOrLocateDifferentialExpressionResultSetTsvFileAsync
Future<Path> writeOrLocateDifferentialExpressionResultSetTsvFileAsync(Long resultSetId, boolean forceWrite) throws RejectedExecutionException - Throws:
RejectedExecutionException- if the queue for creating data files is full- See Also:
-
deleteDifferentialExpressionResultSetTsvFile
Delete the cached TSV (if any) for a single differential-expression result set.Intended to be called by the DEA-deletion path so the per-result-set TSV cache does not outlive the underlying entity. Idempotent; returns
trueonly when a cached file was actually removed.- Parameters:
resultSetId- the result-set ID whose cached TSV should be deleted- Returns:
trueif a cached file was deleted,falseif none existed
-
writeOrLocateDiffExAnalysisArchiveFiles
Collection<Path> writeOrLocateDiffExAnalysisArchiveFiles(ExpressionExperiment ee, boolean forceWrite) throws IOException Locate or create the differential expression archive file(s) for a given experiment.- Parameters:
ee- the experimentforceWrite- whether to force write- Returns:
- collection of files, one per analysis.
- Throws:
IOException- See Also:
-
writeOrLocateDiffExAnalysisArchiveFileById
LockedPath writeOrLocateDiffExAnalysisArchiveFileById(Long analysisId, boolean forceWrite) throws IOException Locate or create the differential expression archive file for a given analysis ID.- Throws:
IOException- See Also:
-
writeOrLocateDiffExAnalysisArchiveFile
LockedPath writeOrLocateDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, boolean forceWrite) throws IOException Locate 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).
- Parameters:
analysis- analysisforceWrite- whether to force creation- Returns:
- a locked path to the archive file, which must be released after use
- Throws:
IOException
-
writeOrLocateDiffExAnalysisArchiveFileAsync
Future<Path> writeOrLocateDiffExAnalysisArchiveFileAsync(DifferentialExpressionAnalysis analysis, boolean forceWrite) throws RejectedExecutionException Build the differential expression analysis archive file off the request thread via theexpressionDataFileTaskExecutor. The returnedFutureresolves to the archive path once the write completes; callers that only need fire-and-forget semantics may ignore the result. The shared lock acquired by the underlying sync write is released before the future resolves.- Throws:
RejectedExecutionException- if the queue for creating data files is full- See Also:
-
writeDiffExAnalysisArchiveFiles
Collection<Path> writeDiffExAnalysisArchiveFiles(ExpressionExperiment ee, Path outputDir, boolean forceWrite) throws IOException Write all the differential expression data files for a given experiment to a particular directory.- Throws:
IOException
-
writeDiffExAnalysisArchiveFiles
Collection<Path> writeDiffExAnalysisArchiveFiles(Collection<DifferentialExpressionAnalysis> analyses, Path outputDir, boolean forceWrite) throws IOException - Throws:
IOException
-
writeDiffExAnalysisArchiveFileById
- Throws:
IOException- See Also:
-
writeDiffExAnalysisArchiveFile
void writeDiffExAnalysisArchiveFile(DifferentialExpressionAnalysis analysis, OutputStream outputStream) throws IOException Write a differential expression analysis archive file for a given analysis to an output stream.- Throws:
IOException
-