Interface AnalysisSubmissionService
-
- All Superinterfaces:
CRUDService<java.lang.Long,AnalysisSubmission>
- All Known Implementing Classes:
AnalysisSubmissionServiceImpl
public interface AnalysisSubmissionService extends CRUDService<java.lang.Long,AnalysisSubmission>
A service for AnalysisSubmissions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAnalysisSubmissionService.AnalysisServiceStatusClass to store the number of running and queued analyses
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AnalysisSubmissioncreateMultipleSampleSubmission(IridaWorkflow workflow, java.lang.Long ref, java.util.List<SingleEndSequenceFile> sequenceFiles, java.util.List<SequenceFilePair> sequenceFilePairs, java.util.Map<java.lang.String,java.lang.String> unnamedParameters, IridaWorkflowNamedParameters namedParameters, java.lang.String name, java.lang.String analysisDescription, java.util.List<Project> projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)java.util.Collection<AnalysisSubmission>createSingleSampleSubmission(IridaWorkflow workflow, java.lang.Long ref, java.util.List<SingleEndSequenceFile> sequenceFiles, java.util.List<SequenceFilePair> sequenceFilePairs, java.util.Map<java.lang.String,java.lang.String> unnamedParameters, IridaWorkflowNamedParameters namedParameters, java.lang.String name, java.lang.String analysisDescription, java.util.List<Project> projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)AnalysisSubmissionTemplatecreateSingleSampleSubmissionTemplate(IridaWorkflow workflow, java.lang.Long referenceFileId, java.util.Map<java.lang.String,java.lang.String> params, IridaWorkflowNamedParameters namedParameters, java.lang.String submissionName, java.lang.String statusMessage, java.lang.String analysisDescription, Project projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)Create a newAnalysisSubmissionTemplatefor a project with the given settingsvoiddeleteAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)Delete anAnalysisSubmissionTemplatefrom the givenProjectvoiddeleteMultiple(java.util.Collection<java.lang.Long> ids)Delete multipleAnalysisSubmissionsjava.util.Collection<AnalysisSubmission>findAnalysesByState(java.util.Collection<AnalysisState> states)Get a list of allAnalysisSubmissions with a givenAnalysisStatejava.util.List<ProjectSampleAnalysisOutputInfo>getAllAnalysisOutputInfoSharedWithProject(java.lang.Long projectId)Get allProjectSampleAnalysisOutputInfofor aProject.java.util.List<ProjectSampleAnalysisOutputInfo>getAllAutomatedAnalysisOutputInfoForAProject(java.lang.Long projectId)Get all automatedProjectSampleAnalysisOutputInfofor aProject.java.util.List<ProjectSampleAnalysisOutputInfo>getAllUserAnalysisOutputInfo(User user)Get allUsergeneratedAnalysisOutputFileinfojava.util.List<GenericStatModel>getAnalysesRanGrouped(java.util.Date createdDate, StatisticTimePeriod statisticTimePeriod)Get list ofGenericStatModelof analyses run in the past n time period grouped by the format provided.java.lang.LonggetAnalysesRanInTimePeriod(java.util.Date createdDate)Get count of analyses run in the time periodAnalysisSubmissionService.AnalysisServiceStatusgetAnalysisServiceStatus()Get the status of the analysis service.java.util.List<AnalysisSubmission>getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds(java.util.Collection<java.util.UUID> workflowIds)Gets allAnalysisSubmissionServices accessible by the current user matching one of the workflow ids.java.util.Set<AnalysisSubmission>getAnalysisSubmissionsForCurrentUser()java.util.Set<AnalysisSubmission>getAnalysisSubmissionsForUser(User user)java.util.Collection<AnalysisSubmission>getAnalysisSubmissionsSharedToProject(Project project)Get a collection of allAnalysisSubmissions shared with aProject.java.util.List<AnalysisSubmissionTemplate>getAnalysisTemplatesForProject(Project project)Get all theAnalysisSubmissionTemplates for a givenProjectJobErrorgetFirstJobError(java.lang.Long id)Get firstJobErrorfor aAnalysisSubmissionidjava.util.List<JobError>getJobErrors(java.lang.Long id)Get theJobErrorobjects for aAnalysisSubmissionidintgetNumberAnalysesByUser(User user)Get count ofAnalysisSubmissionfor the user grouped by the format provided.floatgetPercentCompleteForAnalysisSubmission(java.lang.Long id)Given the id of anAnalysisSubmissiongets the percentage complete.AnalysisStategetStateForAnalysisSubmission(java.lang.Long analysisSubmissionId)Given an analysis submission id, gets the state of this analysis.org.springframework.data.domain.Page<AnalysisSubmission>listAllSubmissions(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, java.util.Set<java.util.UUID> workflowIds, org.springframework.data.domain.PageRequest pageRequest)Get a page of allAnalysisSubmissions in the systemorg.springframework.data.domain.Page<AnalysisSubmission>listSubmissionsForProject(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, java.util.Set<java.util.UUID> workflowIds, Project project, org.springframework.data.domain.PageRequest pageRequest)Get a page of theAnalysisSubmissions shared with a project.org.springframework.data.domain.Page<AnalysisSubmission>listSubmissionsForUser(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, User user, java.util.Set<java.util.UUID> workflowIds, org.springframework.data.domain.PageRequest pageRequest)Get a page ofAnalysisSubmissions the given user has submitted.AnalysisSubmissionTemplatereadAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)Get anAnalysisSubmissionTemplateon the givenProjectvoidremoveAnalysisProjectShare(AnalysisSubmission submission, Project project)Cancel the share of anAnalysisSubmissionwith a givenProjectProjectAnalysisSubmissionJoinshareAnalysisSubmissionWithProject(AnalysisSubmission submission, Project project)Share anAnalysisSubmissionwith a givenProjectAnalysisSubmissionupdatePriority(AnalysisSubmission submission, AnalysisSubmission.Priority priority)Update the priority of anAnalysisSubmission-
Methods inherited from interface ca.corefacility.bioinformatics.irida.service.CRUDService
count, create, delete, exists, findAll, findRevisions, findRevisions, list, list, list, read, readMultiple, search, search, update, updateFields, updateMultiple
-
-
-
-
Method Detail
-
getStateForAnalysisSubmission
AnalysisState getStateForAnalysisSubmission(java.lang.Long analysisSubmissionId) throws EntityNotFoundException
Given an analysis submission id, gets the state of this analysis.- Parameters:
analysisSubmissionId- The id of this analysis.- Returns:
- The state of this analysis.
- Throws:
EntityNotFoundException- If the corresponding analysis cannot be found.
-
getAnalysisSubmissionsForUser
java.util.Set<AnalysisSubmission> getAnalysisSubmissionsForUser(User user)
- Parameters:
user- TheUserto find all submissions for.- Returns:
- A
SetofAnalysisSubmissions for a user.
-
getAnalysisSubmissionsForCurrentUser
java.util.Set<AnalysisSubmission> getAnalysisSubmissionsForCurrentUser()
- Returns:
- A
SetofAnalysisSubmissions for the current user.
-
getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds
java.util.List<AnalysisSubmission> getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds(java.util.Collection<java.util.UUID> workflowIds)
Gets allAnalysisSubmissionServices accessible by the current user matching one of the workflow ids.- Parameters:
workflowIds- The workflow ids to match.- Returns:
- A list of
AnalysisSubmissions matching one of the workflow ids.
-
deleteMultiple
void deleteMultiple(java.util.Collection<java.lang.Long> ids)
Delete multipleAnalysisSubmissions- Parameters:
ids- the collection of IDs to delete
-
createMultipleSampleSubmission
AnalysisSubmission createMultipleSampleSubmission(IridaWorkflow workflow, java.lang.Long ref, java.util.List<SingleEndSequenceFile> sequenceFiles, java.util.List<SequenceFilePair> sequenceFilePairs, java.util.Map<java.lang.String,java.lang.String> unnamedParameters, IridaWorkflowNamedParameters namedParameters, java.lang.String name, java.lang.String analysisDescription, java.util.List<Project> projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)
- Parameters:
workflow-IridaWorkflowthat the files will be run onref-Longid for aReferenceFilesequenceFiles-ListofSequenceFileto run on the workflowsequenceFilePairs-ListofSequenceFilePairto run on the workflowunnamedParameters-Mapof parameters specific for the pipelinenamedParameters- the named parameters to use for the workflow.name-Stringthe name for the analysisanalysisDescription-Stringthe description of the analysis being submittedprojectsToShare- A list ofProjects to share analysis results withwriteResultsToSamples- If true, results of this pipeline will be saved back to the samples on successful completion.emailPipelineResultCompleted- If true, user will be emailed if a pipeline successfully completesemailPipelineResultError- If true, user will be emailed if a pipeline errors- Returns:
- the
AnalysisSubmissioncreated for the files.
-
createSingleSampleSubmission
java.util.Collection<AnalysisSubmission> createSingleSampleSubmission(IridaWorkflow workflow, java.lang.Long ref, java.util.List<SingleEndSequenceFile> sequenceFiles, java.util.List<SequenceFilePair> sequenceFilePairs, java.util.Map<java.lang.String,java.lang.String> unnamedParameters, IridaWorkflowNamedParameters namedParameters, java.lang.String name, java.lang.String analysisDescription, java.util.List<Project> projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)
- Parameters:
workflow-IridaWorkflowthat the files will be run onref-Longid for aReferenceFilesequenceFiles-ListofSequenceFileto run on the workflowsequenceFilePairs-ListofSequenceFilePairto run on the workflowunnamedParameters-Mapof parameters specific for the pipelinenamedParameters- the named parameters to use for the workflow.name-Stringthe name for the analysisanalysisDescription-Stringthe description of the analysis being submittedprojectsToShare- A list ofProjects to share analysis results withwriteResultsToSamples- If true, results of this pipeline will be saved back to the samples on successful completion.emailPipelineResultCompleted- If true, user will be emailed if a pipelines successfully completesemailPipelineResultError- If true, user will be emailed if a pipeline errors- Returns:
- the
CollectionofAnalysisSubmissioncreated for the supplied files.
-
createSingleSampleSubmissionTemplate
AnalysisSubmissionTemplate createSingleSampleSubmissionTemplate(IridaWorkflow workflow, java.lang.Long referenceFileId, java.util.Map<java.lang.String,java.lang.String> params, IridaWorkflowNamedParameters namedParameters, java.lang.String submissionName, java.lang.String statusMessage, java.lang.String analysisDescription, Project projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)
Create a newAnalysisSubmissionTemplatefor a project with the given settings- Parameters:
workflow-IridaWorkflowthat the files will be run onreferenceFileId-Longid for aReferenceFileparams-Mapof parameters specific for the pipelinenamedParameters- the named parameters to use for the workflow.submissionName-Stringthe name for the analysisstatusMessage- A status message for the submission templateanalysisDescription-Stringthe description of the analysis being submittedprojectsToShare- TheProjectto save the analysis towriteResultsToSamples- If true, results of this pipeline will be saved back to the samples on successful completion.emailPipelineResultCompleted- Whether or not to email the pipeline results that completed to the useremailPipelineResultError- Whether or not to email the pipeline results that errored to the user- Returns:
- the newly created
AnalysisSubmissionTemplate
-
getAnalysisTemplatesForProject
java.util.List<AnalysisSubmissionTemplate> getAnalysisTemplatesForProject(Project project)
Get all theAnalysisSubmissionTemplates for a givenProject- Parameters:
project- theProjectto get templates for- Returns:
- a list of all
AnalysisSubmissionTemplates
-
readAnalysisSubmissionTemplateForProject
AnalysisSubmissionTemplate readAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)
Get anAnalysisSubmissionTemplateon the givenProject- Parameters:
id- theAnalysisSubmissionTemplateidproject- theProjectto get templates for- Returns:
- the found
AnalysisSubmissionTemplate
-
deleteAnalysisSubmissionTemplateForProject
void deleteAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)Delete anAnalysisSubmissionTemplatefrom the givenProject- Parameters:
id- The id of anAnalysisSubmissionTemplate.project- theProjectto delete from
-
getPercentCompleteForAnalysisSubmission
float getPercentCompleteForAnalysisSubmission(java.lang.Long id) throws EntityNotFoundException, NoPercentageCompleteException, ExecutionManagerExceptionGiven the id of anAnalysisSubmissiongets the percentage complete.- Parameters:
id- The id of anAnalysisSubmission.- Returns:
- The percentage complete for this
AnalysisSubmission. - Throws:
NoPercentageCompleteException- An exception that indicates there is no percentage complete for the submission.ExecutionManagerException- If there was an issue when contacting the execution manager.EntityNotFoundException- If no such corresponding submission exists.
-
getJobErrors
java.util.List<JobError> getJobErrors(java.lang.Long id) throws EntityNotFoundException, ExecutionManagerException
Get theJobErrorobjects for aAnalysisSubmissionid- Parameters:
id-AnalysisSubmissionid- Returns:
JobErrorobjects for aAnalysisSubmission- Throws:
EntityNotFoundException- If no suchAnalysisSubmissionexists.ExecutionManagerException- If there was an issue contacting the execution manager.
-
getFirstJobError
JobError getFirstJobError(java.lang.Long id) throws EntityNotFoundException, ExecutionManagerException
Get firstJobErrorfor aAnalysisSubmissionid- Parameters:
id-AnalysisSubmissionid- Returns:
JobErrorobject- Throws:
EntityNotFoundException- If no suchAnalysisSubmissionexists.ExecutionManagerException- If there was an issue contacting the execution manager.
-
shareAnalysisSubmissionWithProject
ProjectAnalysisSubmissionJoin shareAnalysisSubmissionWithProject(AnalysisSubmission submission, Project project)
Share anAnalysisSubmissionwith a givenProject- Parameters:
submission-AnalysisSubmissionto shareproject-Projectto share with- Returns:
- a
ProjectAnalysisSubmissionJoindescribing the relationship
-
removeAnalysisProjectShare
void removeAnalysisProjectShare(AnalysisSubmission submission, Project project)
Cancel the share of anAnalysisSubmissionwith a givenProject- Parameters:
submission- theAnalysisSubmissionto stop sharingproject- theProjectto stop sharing with
-
findAnalysesByState
java.util.Collection<AnalysisSubmission> findAnalysesByState(java.util.Collection<AnalysisState> states)
Get a list of allAnalysisSubmissions with a givenAnalysisState- Parameters:
states- A list ofAnalysisStateto findAnalysisSubmissions for- Returns:
- a Collection of
AnalysisSubmission
-
getAnalysisSubmissionsSharedToProject
java.util.Collection<AnalysisSubmission> getAnalysisSubmissionsSharedToProject(Project project)
Get a collection of allAnalysisSubmissions shared with aProject.- Parameters:
project- TheProjectto search.- Returns:
- A collection of
AnalysisSubmissions.
-
listSubmissionsForProject
org.springframework.data.domain.Page<AnalysisSubmission> listSubmissionsForProject(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, java.util.Set<java.util.UUID> workflowIds, Project project, org.springframework.data.domain.PageRequest pageRequest)
Get a page of theAnalysisSubmissions shared with a project.- Parameters:
search- basic search stringname- analysis submission namestates- Set ofAnalysisStateof the submission to searchworkflowIds- set of workflow UUIDs to searchproject-Projectto search inpageRequest- aPageRequestfor the results to show- Returns:
- a page of
AnalysisSubmission
-
listAllSubmissions
org.springframework.data.domain.Page<AnalysisSubmission> listAllSubmissions(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, java.util.Set<java.util.UUID> workflowIds, org.springframework.data.domain.PageRequest pageRequest)
Get a page of allAnalysisSubmissions in the system- Parameters:
search- basic search stringname- analysis submission namestates- Set ofAnalysisStateof the submission to searchworkflowIds- set of workflow UUIDs to searchpageRequest- aPageRequestfor the results to show- Returns:
- a page of
AnalysisSubmission
-
listSubmissionsForUser
org.springframework.data.domain.Page<AnalysisSubmission> listSubmissionsForUser(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, User user, java.util.Set<java.util.UUID> workflowIds, org.springframework.data.domain.PageRequest pageRequest)
Get a page ofAnalysisSubmissions the given user has submitted.- Parameters:
search- basic search stringname- analysis submission namestates- Set ofAnalysisStateof the submission to searchuser- theUserto get submissions forworkflowIds- set of workflow UUIDs to searchpageRequest- aPageRequestfor the restults to show- Returns:
- a page of
AnalysisSubmissions for the given user
-
updatePriority
AnalysisSubmission updatePriority(AnalysisSubmission submission, AnalysisSubmission.Priority priority)
Update the priority of anAnalysisSubmission- Parameters:
submission- the submission to updatepriority- the new priority- Returns:
- the updated submission
-
getAllUserAnalysisOutputInfo
java.util.List<ProjectSampleAnalysisOutputInfo> getAllUserAnalysisOutputInfo(User user)
Get allUsergeneratedAnalysisOutputFileinfo- Parameters:
user-User- Returns:
- List of
AnalysisOutputFileinfo
-
getAllAnalysisOutputInfoSharedWithProject
java.util.List<ProjectSampleAnalysisOutputInfo> getAllAnalysisOutputInfoSharedWithProject(java.lang.Long projectId)
Get allProjectSampleAnalysisOutputInfofor aProject.- Parameters:
projectId-Projectid- Returns:
- a list of
ProjectSampleAnalysisOutputInfo
-
getAllAutomatedAnalysisOutputInfoForAProject
java.util.List<ProjectSampleAnalysisOutputInfo> getAllAutomatedAnalysisOutputInfoForAProject(java.lang.Long projectId)
Get all automatedProjectSampleAnalysisOutputInfofor aProject.- Parameters:
projectId-Projectid- Returns:
- a list of
ProjectSampleAnalysisOutputInfo
-
getAnalysisServiceStatus
AnalysisSubmissionService.AnalysisServiceStatus getAnalysisServiceStatus()
Get the status of the analysis service. This will be the number of running and queued analyses- Returns:
- An
AnalysisSubmissionService.AnalysisServiceStatusobject showing the number of running and queued analyses
-
getAnalysesRanInTimePeriod
java.lang.Long getAnalysesRanInTimePeriod(java.util.Date createdDate)
Get count of analyses run in the time period- Parameters:
createdDate- the minimum date for submissions ran- Returns:
- An
Longcount of analyses ran
-
getAnalysesRanGrouped
java.util.List<GenericStatModel> getAnalysesRanGrouped(java.util.Date createdDate, StatisticTimePeriod statisticTimePeriod)
Get list ofGenericStatModelof analyses run in the past n time period grouped by the format provided.- Parameters:
createdDate- the minimum date for submissions ranstatisticTimePeriod- the enum containing format for which to group the results by- Returns:
- An
GenericStatModellist
-
getNumberAnalysesByUser
int getNumberAnalysesByUser(User user)
Get count ofAnalysisSubmissionfor the user grouped by the format provided.- Parameters:
user- The user identifier- Returns:
- Count of analyses ran by user
-
-