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 class
AnalysisSubmissionService.AnalysisServiceStatus
Class to store the number of running and queued analyses
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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)
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)
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 newAnalysisSubmissionTemplate
for a project with the given settingsvoid
deleteAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)
Delete anAnalysisSubmissionTemplate
from the givenProject
void
deleteMultiple(java.util.Collection<java.lang.Long> ids)
Delete multipleAnalysisSubmission
sjava.util.Collection<AnalysisSubmission>
findAnalysesByState(java.util.Collection<AnalysisState> states)
Get a list of allAnalysisSubmission
s with a givenAnalysisState
java.util.List<ProjectSampleAnalysisOutputInfo>
getAllAnalysisOutputInfoSharedWithProject(java.lang.Long projectId)
Get allProjectSampleAnalysisOutputInfo
for aProject
.java.util.List<ProjectSampleAnalysisOutputInfo>
getAllAutomatedAnalysisOutputInfoForAProject(java.lang.Long projectId)
Get all automatedProjectSampleAnalysisOutputInfo
for aProject
.java.util.List<ProjectSampleAnalysisOutputInfo>
getAllUserAnalysisOutputInfo(User user)
Get allUser
generatedAnalysisOutputFile
infojava.util.List<GenericStatModel>
getAnalysesRanGrouped(java.util.Date createdDate, StatisticTimePeriod statisticTimePeriod)
Get list ofGenericStatModel
of analyses run in the past n time period grouped by the format provided.java.lang.Long
getAnalysesRanInTimePeriod(java.util.Date createdDate)
Get count of analyses run in the time periodAnalysisSubmissionService.AnalysisServiceStatus
getAnalysisServiceStatus()
Get the status of the analysis service.java.util.List<AnalysisSubmission>
getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds(java.util.Collection<java.util.UUID> workflowIds)
Gets allAnalysisSubmissionService
s 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 allAnalysisSubmission
s shared with aProject
.java.util.List<AnalysisSubmissionTemplate>
getAnalysisTemplatesForProject(Project project)
Get all theAnalysisSubmissionTemplate
s for a givenProject
JobError
getFirstJobError(java.lang.Long id)
Get firstJobError
for aAnalysisSubmission
idjava.util.List<JobError>
getJobErrors(java.lang.Long id)
Get theJobError
objects for aAnalysisSubmission
idint
getNumberAnalysesByUser(User user)
Get count ofAnalysisSubmission
for the user grouped by the format provided.float
getPercentCompleteForAnalysisSubmission(java.lang.Long id)
Given the id of anAnalysisSubmission
gets the percentage complete.AnalysisState
getStateForAnalysisSubmission(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 allAnalysisSubmission
s 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 theAnalysisSubmission
s 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 ofAnalysisSubmission
s the given user has submitted.AnalysisSubmissionTemplate
readAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)
Get anAnalysisSubmissionTemplate
on the givenProject
void
removeAnalysisProjectShare(AnalysisSubmission submission, Project project)
Cancel the share of anAnalysisSubmission
with a givenProject
ProjectAnalysisSubmissionJoin
shareAnalysisSubmissionWithProject(AnalysisSubmission submission, Project project)
Share anAnalysisSubmission
with a givenProject
AnalysisSubmission
updatePriority(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
- TheUser
to find all submissions for.- Returns:
- A
Set
ofAnalysisSubmission
s for a user.
-
getAnalysisSubmissionsForCurrentUser
java.util.Set<AnalysisSubmission> getAnalysisSubmissionsForCurrentUser()
- Returns:
- A
Set
ofAnalysisSubmission
s for the current user.
-
getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds
java.util.List<AnalysisSubmission> getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds(java.util.Collection<java.util.UUID> workflowIds)
Gets allAnalysisSubmissionService
s accessible by the current user matching one of the workflow ids.- Parameters:
workflowIds
- The workflow ids to match.- Returns:
- A list of
AnalysisSubmission
s matching one of the workflow ids.
-
deleteMultiple
void deleteMultiple(java.util.Collection<java.lang.Long> ids)
Delete multipleAnalysisSubmission
s- 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
-IridaWorkflow
that the files will be run onref
-Long
id for aReferenceFile
sequenceFiles
-List
ofSequenceFile
to run on the workflowsequenceFilePairs
-List
ofSequenceFilePair
to run on the workflowunnamedParameters
-Map
of parameters specific for the pipelinenamedParameters
- the named parameters to use for the workflow.name
-String
the name for the analysisanalysisDescription
-String
the description of the analysis being submittedprojectsToShare
- A list ofProject
s 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
AnalysisSubmission
created 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
-IridaWorkflow
that the files will be run onref
-Long
id for aReferenceFile
sequenceFiles
-List
ofSequenceFile
to run on the workflowsequenceFilePairs
-List
ofSequenceFilePair
to run on the workflowunnamedParameters
-Map
of parameters specific for the pipelinenamedParameters
- the named parameters to use for the workflow.name
-String
the name for the analysisanalysisDescription
-String
the description of the analysis being submittedprojectsToShare
- A list ofProject
s 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
Collection
ofAnalysisSubmission
created 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 newAnalysisSubmissionTemplate
for a project with the given settings- Parameters:
workflow
-IridaWorkflow
that the files will be run onreferenceFileId
-Long
id for aReferenceFile
params
-Map
of parameters specific for the pipelinenamedParameters
- the named parameters to use for the workflow.submissionName
-String
the name for the analysisstatusMessage
- A status message for the submission templateanalysisDescription
-String
the description of the analysis being submittedprojectsToShare
- TheProject
to 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 theAnalysisSubmissionTemplate
s for a givenProject
- Parameters:
project
- theProject
to get templates for- Returns:
- a list of all
AnalysisSubmissionTemplate
s
-
readAnalysisSubmissionTemplateForProject
AnalysisSubmissionTemplate readAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)
Get anAnalysisSubmissionTemplate
on the givenProject
- Parameters:
id
- theAnalysisSubmissionTemplate
idproject
- theProject
to get templates for- Returns:
- the found
AnalysisSubmissionTemplate
-
deleteAnalysisSubmissionTemplateForProject
void deleteAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)
Delete anAnalysisSubmissionTemplate
from the givenProject
- Parameters:
id
- The id of anAnalysisSubmissionTemplate
.project
- theProject
to delete from
-
getPercentCompleteForAnalysisSubmission
float getPercentCompleteForAnalysisSubmission(java.lang.Long id) throws EntityNotFoundException, NoPercentageCompleteException, ExecutionManagerException
Given the id of anAnalysisSubmission
gets 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 theJobError
objects for aAnalysisSubmission
id- Parameters:
id
-AnalysisSubmission
id- Returns:
JobError
objects for aAnalysisSubmission
- Throws:
EntityNotFoundException
- If no suchAnalysisSubmission
exists.ExecutionManagerException
- If there was an issue contacting the execution manager.
-
getFirstJobError
JobError getFirstJobError(java.lang.Long id) throws EntityNotFoundException, ExecutionManagerException
Get firstJobError
for aAnalysisSubmission
id- Parameters:
id
-AnalysisSubmission
id- Returns:
JobError
object- Throws:
EntityNotFoundException
- If no suchAnalysisSubmission
exists.ExecutionManagerException
- If there was an issue contacting the execution manager.
-
shareAnalysisSubmissionWithProject
ProjectAnalysisSubmissionJoin shareAnalysisSubmissionWithProject(AnalysisSubmission submission, Project project)
Share anAnalysisSubmission
with a givenProject
- Parameters:
submission
-AnalysisSubmission
to shareproject
-Project
to share with- Returns:
- a
ProjectAnalysisSubmissionJoin
describing the relationship
-
removeAnalysisProjectShare
void removeAnalysisProjectShare(AnalysisSubmission submission, Project project)
Cancel the share of anAnalysisSubmission
with a givenProject
- Parameters:
submission
- theAnalysisSubmission
to stop sharingproject
- theProject
to stop sharing with
-
findAnalysesByState
java.util.Collection<AnalysisSubmission> findAnalysesByState(java.util.Collection<AnalysisState> states)
Get a list of allAnalysisSubmission
s with a givenAnalysisState
- Parameters:
states
- A list ofAnalysisState
to findAnalysisSubmission
s for- Returns:
- a Collection of
AnalysisSubmission
-
getAnalysisSubmissionsSharedToProject
java.util.Collection<AnalysisSubmission> getAnalysisSubmissionsSharedToProject(Project project)
Get a collection of allAnalysisSubmission
s shared with aProject
.- Parameters:
project
- TheProject
to search.- Returns:
- A collection of
AnalysisSubmission
s.
-
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 theAnalysisSubmission
s shared with a project.- Parameters:
search
- basic search stringname
- analysis submission namestates
- Set ofAnalysisState
of the submission to searchworkflowIds
- set of workflow UUIDs to searchproject
-Project
to search inpageRequest
- aPageRequest
for 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 allAnalysisSubmission
s in the system- Parameters:
search
- basic search stringname
- analysis submission namestates
- Set ofAnalysisState
of the submission to searchworkflowIds
- set of workflow UUIDs to searchpageRequest
- aPageRequest
for 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 ofAnalysisSubmission
s the given user has submitted.- Parameters:
search
- basic search stringname
- analysis submission namestates
- Set ofAnalysisState
of the submission to searchuser
- theUser
to get submissions forworkflowIds
- set of workflow UUIDs to searchpageRequest
- aPageRequest
for the restults to show- Returns:
- a page of
AnalysisSubmission
s 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 allUser
generatedAnalysisOutputFile
info- Parameters:
user
-User
- Returns:
- List of
AnalysisOutputFile
info
-
getAllAnalysisOutputInfoSharedWithProject
java.util.List<ProjectSampleAnalysisOutputInfo> getAllAnalysisOutputInfoSharedWithProject(java.lang.Long projectId)
Get allProjectSampleAnalysisOutputInfo
for aProject
.- Parameters:
projectId
-Project
id- Returns:
- a list of
ProjectSampleAnalysisOutputInfo
-
getAllAutomatedAnalysisOutputInfoForAProject
java.util.List<ProjectSampleAnalysisOutputInfo> getAllAutomatedAnalysisOutputInfoForAProject(java.lang.Long projectId)
Get all automatedProjectSampleAnalysisOutputInfo
for aProject
.- Parameters:
projectId
-Project
id- 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.AnalysisServiceStatus
object 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
Long
count of analyses ran
-
getAnalysesRanGrouped
java.util.List<GenericStatModel> getAnalysesRanGrouped(java.util.Date createdDate, StatisticTimePeriod statisticTimePeriod)
Get list ofGenericStatModel
of 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
GenericStatModel
list
-
getNumberAnalysesByUser
int getNumberAnalysesByUser(User user)
Get count ofAnalysisSubmission
for the user grouped by the format provided.- Parameters:
user
- The user identifier- Returns:
- Count of analyses ran by user
-
-