Class GalaxyHistoriesService


  • public class GalaxyHistoriesService
    extends java.lang.Object
    Class for working with Galaxy Histories.
    • Constructor Summary

      Constructors 
      Constructor Description
      GalaxyHistoriesService​(com.github.jmchilton.blend4j.galaxy.HistoriesClient historiesClient, com.github.jmchilton.blend4j.galaxy.ToolsClient toolsClient, GalaxyLibrariesService librariesService)
      Builds a new GalaxyHistory object for working with Galaxy Histories.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.github.jmchilton.blend4j.galaxy.beans.collection.response.CollectionResponse constructCollection​(com.github.jmchilton.blend4j.galaxy.beans.collection.request.CollectionDescription collectionDescription, com.github.jmchilton.blend4j.galaxy.beans.History history)
      Builds a new Dataset Collection given the description of this collection.
      com.github.jmchilton.blend4j.galaxy.beans.HistoryDeleteResponse deleteHistory​(java.lang.String historyId)
      Deletes a history from Galaxy with the given id.
      void downloadDatasetTo​(java.lang.String historyId, java.lang.String datasetId, java.nio.file.Path destination)
      Given a particular dataset id within a Galaxy history download this dataset to the local filesystem.
      java.util.Map<java.nio.file.Path,​java.lang.String> filesToLibraryToHistory​(java.util.Set<java.nio.file.Path> paths, com.github.jmchilton.blend4j.galaxy.beans.History history, com.github.jmchilton.blend4j.galaxy.beans.Library library, DataStorage dataStorage)
      Uploads a set of files to a given history through the given library.
      com.github.jmchilton.blend4j.galaxy.beans.Dataset fileToHistory​(java.nio.file.Path path, InputFileType fileType, com.github.jmchilton.blend4j.galaxy.beans.History history)
      Uploads a file to a given history.
      com.github.jmchilton.blend4j.galaxy.beans.History findById​(java.lang.String id)
      Finds the history by it's ID.
      com.github.jmchilton.blend4j.galaxy.beans.Dataset getDatasetForFileInHistory​(java.lang.String filename, java.lang.String historyId)
      Gets a Dataset object for a file with the given name in the given history.
      GalaxyWorkflowStatus getStatusForHistory​(java.lang.String historyId)
      Given a history id returns the status for the given workflow.
      com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails libraryDatasetToHistory​(java.lang.String libraryFileId, com.github.jmchilton.blend4j.galaxy.beans.History history)
      Transfers a dataset from a Galaxy library into a history for a workflow.
      com.github.jmchilton.blend4j.galaxy.beans.History newHistoryForWorkflow()
      Creates a new History for running a workflow.
      java.util.List<com.github.jmchilton.blend4j.galaxy.beans.HistoryContents> showHistoryContents​(java.lang.String historyId)
      Show the history contents for the specified history identifier
      com.github.jmchilton.blend4j.galaxy.beans.HistoryContentsProvenance showProvenance​(java.lang.String historyId, java.lang.String historyProvenanceId)
      Show the history provenance contents for the specified history identifiers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GalaxyHistoriesService

        public GalaxyHistoriesService​(com.github.jmchilton.blend4j.galaxy.HistoriesClient historiesClient,
                                      com.github.jmchilton.blend4j.galaxy.ToolsClient toolsClient,
                                      GalaxyLibrariesService librariesService)
        Builds a new GalaxyHistory object for working with Galaxy Histories.
        Parameters:
        historiesClient - The HistoriesClient for interacting with Galaxy histories.
        toolsClient - The ToolsClient for interacting with tools in Galaxy.
        librariesService - A service for dealing with Galaxy libraries.
    • Method Detail

      • newHistoryForWorkflow

        public com.github.jmchilton.blend4j.galaxy.beans.History newHistoryForWorkflow()
        Creates a new History for running a workflow.
        Returns:
        A new History for running a workflow.
      • getStatusForHistory

        public GalaxyWorkflowStatus getStatusForHistory​(java.lang.String historyId)
                                                 throws ExecutionManagerException
        Given a history id returns the status for the given workflow.
        Parameters:
        historyId - The history id to use to find a workflow.
        Returns:
        The WorkflowStatus for the given workflow.
        Throws:
        ExecutionManagerException - If there was an exception when attempting to get the status for a history.
      • libraryDatasetToHistory

        public com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails libraryDatasetToHistory​(java.lang.String libraryFileId,
                                                                                                com.github.jmchilton.blend4j.galaxy.beans.History history)
        Transfers a dataset from a Galaxy library into a history for a workflow.
        Parameters:
        libraryFileId - The id of a file within a Galaxy library.
        history - The history to transfer this library dataset into.
        Returns:
        A HistoryDetails object describing the details of the created history dataset.
      • fileToHistory

        public com.github.jmchilton.blend4j.galaxy.beans.Dataset fileToHistory​(java.nio.file.Path path,
                                                                               InputFileType fileType,
                                                                               com.github.jmchilton.blend4j.galaxy.beans.History history)
                                                                        throws UploadException,
                                                                               GalaxyDatasetException
        Uploads a file to a given history.
        Parameters:
        path - The path to the file to upload.
        fileType - The file type of the file to upload.
        history - The history to upload the file into.
        Returns:
        A Dataset object for the uploaded file.
        Throws:
        UploadException - If there was an issue uploading the file to Galaxy.
        GalaxyDatasetException - If there was an issue finding the corresponding Dataset for the file in the history.
      • filesToLibraryToHistory

        public java.util.Map<java.nio.file.Path,​java.lang.String> filesToLibraryToHistory​(java.util.Set<java.nio.file.Path> paths,
                                                                                                com.github.jmchilton.blend4j.galaxy.beans.History history,
                                                                                                com.github.jmchilton.blend4j.galaxy.beans.Library library,
                                                                                                DataStorage dataStorage)
                                                                                         throws UploadException
        Uploads a set of files to a given history through the given library.
        Parameters:
        paths - The set of paths to upload.
        history - The history to upload the file into.
        library - The library to initially upload the file into.
        dataStorage - The type of DataStorage strategy to use.
        Returns:
        An Map of paths and ids for each dataset object in this history.
        Throws:
        UploadException - If there was an issue uploading the file to Galaxy.
      • constructCollection

        public com.github.jmchilton.blend4j.galaxy.beans.collection.response.CollectionResponse constructCollection​(com.github.jmchilton.blend4j.galaxy.beans.collection.request.CollectionDescription collectionDescription,
                                                                                                                    com.github.jmchilton.blend4j.galaxy.beans.History history)
                                                                                                             throws ExecutionManagerException
        Builds a new Dataset Collection given the description of this collection.
        Parameters:
        collectionDescription - A description of the collection to build.
        history - The history to build the collection within.
        Returns:
        A CollectionResponse describing the constructed collection.
        Throws:
        ExecutionManagerException - If there was an issue constructing the collection.
      • getDatasetForFileInHistory

        public com.github.jmchilton.blend4j.galaxy.beans.Dataset getDatasetForFileInHistory​(java.lang.String filename,
                                                                                            java.lang.String historyId)
                                                                                     throws GalaxyDatasetException
        Gets a Dataset object for a file with the given name in the given history.
        Parameters:
        filename - The name of the file to get a Dataset object for.
        historyId - The history id to look for the dataset.
        Returns:
        The corresponding dataset for the given file name.
        Throws:
        GalaxyDatasetException - If there was an issue when searching for a dataset.
      • downloadDatasetTo

        public void downloadDatasetTo​(java.lang.String historyId,
                                      java.lang.String datasetId,
                                      java.nio.file.Path destination)
                               throws java.io.IOException,
                                      ExecutionManagerDownloadException
        Given a particular dataset id within a Galaxy history download this dataset to the local filesystem.
        Parameters:
        historyId - The id of the history containing the dataset.
        datasetId - The id of the dataset to download.
        destination - The destination to download a file to (will overwrite any exisiting content).
        Throws:
        java.io.IOException - If there was an error downloading the file.
        ExecutionManagerDownloadException - If there was an issue downloading the dataset.
      • showHistoryContents

        public java.util.List<com.github.jmchilton.blend4j.galaxy.beans.HistoryContents> showHistoryContents​(java.lang.String historyId)
                                                                                                      throws ExecutionManagerException
        Show the history contents for the specified history identifier
        Parameters:
        historyId - the identifier to show the history contents for.
        Returns:
        the history contents for the specified identifier.
        Throws:
        ExecutionManagerException - on failure to communicate with Galaxy.
      • showProvenance

        public com.github.jmchilton.blend4j.galaxy.beans.HistoryContentsProvenance showProvenance​(java.lang.String historyId,
                                                                                                  java.lang.String historyProvenanceId)
                                                                                           throws ExecutionManagerException
        Show the history provenance contents for the specified history identifiers.
        Parameters:
        historyId - the identifier to show the history contents for.
        historyProvenanceId - the step in the execution to show provenance for.
        Returns:
        the history provenance contents for the specified identifiers.
        Throws:
        ExecutionManagerException - on failure to communicate with Galaxy.
      • deleteHistory

        public com.github.jmchilton.blend4j.galaxy.beans.HistoryDeleteResponse deleteHistory​(java.lang.String historyId)
                                                                                      throws DeleteGalaxyObjectFailedException
        Deletes a history from Galaxy with the given id.
        Parameters:
        historyId - The id of the history to delete.
        Returns:
        A HistoryDeleteResponse from Galaxy.
        Throws:
        DeleteGalaxyObjectFailedException - If there was an error deleting a history.