Interface ExpressionDataFileService

    • Method Detail

      • deleteAllFiles

        void deleteAllFiles​(ExpressionExperiment ee)
        Delete any existing coexpression, data, or differential expression data files.
        Parameters:
        ee - the experiment
      • getDiffExpressionAnalysisArchiveFile

        File getDiffExpressionAnalysisArchiveFile​(Long analysisId,
                                                  boolean forceCreate)
        Locate or create the differential expression data file(s) for a given experiment. We generate an archive that contains following files: - differential expression analysis file (q-values per factor) - file for each result set with contrasts info (such as fold change for each factor value)
        Parameters:
        analysisId - analysis ID
        forceCreate - whether to force creation
        Returns:
        file
      • getOutputFile

        File getOutputFile​(ExpressionExperiment ee,
                           boolean filtered)
        Parameters:
        ee - the experiment
        filtered - if the data matrix is filtered
        Returns:
        file
      • getOutputFile

        File getOutputFile​(ExpressionExperiment ee,
                           boolean filtered,
                           boolean compressed,
                           boolean temporary)
        Parameters:
        filtered - if the data matrix is filtered
        compressed - if the filename should have a .gz extension
        temporary - if you want the file to be saved in the configuration file temporary location
        ee - the experiment
        Returns:
        file
      • getOutputFile

        File getOutputFile​(String filename)
        Parameters:
        filename - without the path - that is, just the name of the file
        Returns:
        File, with location in the appropriate target directory.
      • getOutputFile

        File getOutputFile​(String filename,
                           boolean temporary)
        Parameters:
        filename - without the path - that is, just the name of the file
        temporary - , if this is true then the file gets saved to the temporary location from the configuration file
        Returns:
        File, with location in the appropriate target directory.
      • writeProcessedExpressionDataFile

        Optional<File> writeProcessedExpressionDataFile​(ExpressionExperiment ee,
                                                        boolean filtered,
                                                        String fileName,
                                                        boolean compress)
                                                 throws IOException,
                                                        FilteringException
        Create a data file containing the 'preferred and masked' expression data matrix, with filtering for low expression applied (currently supports default settings only).
        Parameters:
        ee - the experiment
        compress - compress?
        fileName - file name
        filtered - fitlered?
        Returns:
        file, or empty if the experiment has no processed expression data
        Throws:
        IOException - when there are IO problems
        FilteringException
      • writeProcessedExpressionData

        void writeProcessedExpressionData​(ExpressionExperiment ee,
                                          Writer writer)
                                   throws IOException
        Write processed expression data to a given writer for a given quantitation type.

        Note: For compression, wrap a GZIPOutputStream with a OutputStreamWriter. To write to a string, consider using StringWriter.

        Parameters:
        ee - the expression experiment
        writer - the destination for the raw expression data
        Throws:
        IOException - if operations with the writer fails
      • writeOrLocateCoexpressionDataFile

        Optional<File> writeOrLocateCoexpressionDataFile​(ExpressionExperiment ee,
                                                         boolean forceWrite)
        Write or located the coexpression data file for a given experiment
        Parameters:
        ee - the experiment
        forceWrite - whether to force write
        Returns:
        file
      • writeOrLocateProcessedDataFile

        Optional<File> writeOrLocateProcessedDataFile​(ExpressionExperiment ee,
                                                      boolean forceWrite,
                                                      boolean filtered)
                                               throws FilteringException
        Locate or create a data file containing the 'preferred and masked' expression data matrix, with filtering for low expression applied (currently supports default settings only). It will be gzip-compressed. The file will be regenerated even if one already exists if the forceWrite parameter is true, or if there was a recent change (more recent than the last modified date of the existing file) to any of the experiments platforms.
        Parameters:
        filtered - filtered
        forceWrite - force re-write even if file already exists and is up to date.
        ee - the experiment
        Returns:
        file, or empty if the experiment has no processed vectors
        Throws:
        FilteringException
      • writeOrLocateRawExpressionDataFile

        File writeOrLocateRawExpressionDataFile​(ExpressionExperiment ee,
                                                QuantitationType type,
                                                boolean forceWrite)
        Locate or create a new data file for the given quantitation type. The output will include gene information if it can be located from its own file.
        Parameters:
        forceWrite - To not return the existing file, but create it anew.
        type - the quantitation type
        Returns:
        file
      • writeOrLocateDesignFile

        File writeOrLocateDesignFile​(ExpressionExperiment ee,
                                     boolean forceWrite)
        Locate or create an experimental design file for a given experiment. The file will be regenerated even if one already exists if the forceWrite parameter is true, or if there was a recent change (more recent than the last modified date of the existing file) to any of the experiments platforms.
        Parameters:
        ee - the experiment
        forceWrite - force re-write even if file already exists and is up to date
        Returns:
        file
      • writeOrLocateDiffExpressionDataFiles

        Collection<File> writeOrLocateDiffExpressionDataFiles​(ExpressionExperiment ee,
                                                              boolean forceWrite)
        Locate or create the differential expression data file(s) for a given experiment.
        Parameters:
        ee - the experiment
        forceWrite - whether to force write
        Returns:
        collection of files, one per analysis.
      • writeDiffExArchiveFile

        void writeDiffExArchiveFile​(BioAssaySet ee,
                                    DifferentialExpressionAnalysis analysis,
                                    @Nullable
                                    DifferentialExpressionAnalysisConfig config)
                             throws IOException
        Writes to the configured gemma.appdata.home The file created is a zip archive containing at least two files. The first is the summary model fit statistics, ANOVA-style. The others are the contrast details for each factor. They should be R-friendly (e.g., readable with read.delim("analysis.results.txt", header=T, comment.char="#", row.names=1)
        Parameters:
        ee - the experiment
        analysis - analysis
        config - config
        Throws:
        IOException - when there was a problem during write