Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(url string)
Delete send a request to delete a completed job and its corresponding files. Must be only executes after the results have been already downloaded.
func DownloadAll ¶
func DownloadAll(jr JobResults, job JobStatus, destDir string)
DownloadAll will use parallelization to get all the result files from Cipres server. It will create a new folder at the given destination directory, named as the job metadata clientJobName or the jobhandle code if the previuos field is empty.
func DownloadFile ¶
DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory. The target folder should be given as the first funtion argument, followed by the file url. Returns an error if something goes wrong.
func ParseConfig ¶
ParseConfig can extract Visible Parameters and Metadata from a plain text file and return a map ready to use for submission. It is usefull to use with data copied from Cipres Tool Configuration Helper (https://www.phylo.org/restusers/docs/cipresXml) output and saved to a text file.
The data should be in the following format: tool = IQTREE_XSEDE, with each parameter or metadata in a different line.
Infile Parameters should be entered separately as the file parameter of submit function, once they are processed differently by the function.
Types ¶
type Auth ¶
type Auth struct { URL string `json:"url"` AppID string `json:"appid"` User string `json:"username"` Passwd string `json:"password"` }
Auth stores the authentication data imported from cra_auth.json
type JobResults ¶
type JobResults struct { XMLName xml.Name `xml:"results"` Text string `xml:",chardata"` Jobfiles struct { Text string `xml:",chardata"` Jobfile []struct { Text string `xml:",chardata"` DownloadURI struct { Text string `xml:",chardata"` URL string `xml:"url"` Rel string `xml:"rel"` Title string `xml:"title"` } `xml:"downloadUri"` JobHandle string `xml:"jobHandle"` Filename string `xml:"filename"` Length int `xml:"length"` ParameterName string `xml:"parameterName"` OutputDocumentID string `xml:"outputDocumentId"` } `xml:"jobfile"` } `xml:"jobfiles"` }
JobResults stores a finished job result information retrieved from CIPRES server
func JobResult ¶
func JobResult(jb JobStatus) JobResults
JobResult GETs a finished job files list from CIPRES server based on a job handle provided by jobStatus function and returns a JobResults structure
type JobStatus ¶
type JobStatus struct { XMLName xml.Name `xml:"jobstatus"` Text string `xml:",chardata"` SelfURI struct { Text string `xml:",chardata"` URL string `xml:"url"` Rel string `xml:"rel"` Title string `xml:"title"` } `xml:"selfUri"` JobHandle string `xml:"jobHandle"` JobStage string `xml:"jobStage"` TerminalStage bool `xml:"terminalStage"` Failed string `xml:"failed"` Metadata struct { Text string `xml:",chardata"` Entry struct { Text string `xml:",chardata"` Key string `xml:"key"` Value string `xml:"value"` } `xml:"entry"` } `xml:"metadata"` DateSubmitted string `xml:"dateSubmitted"` ResultsURI struct { Text string `xml:",chardata"` URL string `xml:"url"` Rel string `xml:"rel"` Title string `xml:"title"` } `xml:"resultsUri"` WorkingDirURI struct { Text string `xml:",chardata"` URL string `xml:"url"` Rel string `xml:"rel"` Title string `xml:"title"` } `xml:"workingDirUri"` Messages struct { Text string `xml:",chardata"` Message struct { Chardata string `xml:",chardata"` Timestamp string `xml:"timestamp"` Stage string `xml:"stage"` Text string `xml:"text"` } `xml:"message"` } `xml:"messages"` MinPollIntervalSeconds int `xml:"minPollIntervalSeconds"` }
JobStatus stores a job status information retrieved from CIPRES server
func JobStat ¶
JobStat GETs a job handle url (as s string) information from CIPRES server provided by listJobs function and returns a JobStatus structure
func Submit ¶
func Submit(params map[string]string, path map[string]string, validate bool) (JobStatus, *bytes.Buffer)
Submit a job and returns a JobStatus object and pointer to a bytes.Buffer.
params is a map where each key is a Visible parameter or metadata and the value is the string to assign to the parameter.
For example: { "vparam.toolId" : "CLUSTALW", "vparam.runtime_" : "1", }
path is a map where each key is an InFile parameter and the value is the full path of the file.
For example: { "input.infile_" : "/samplefiles/sample1_in.fasta, "input.usetree_" : "/samplefiles/guidetree.dnd", }
See https://www.phylo.org/restusers/docs/guide.html#ConfigureParams for more info on files, parameters and metadata accepted by each tool.
If you want to validate you submission before actually doing it, set validate to true.
type JobsList ¶
type JobsList struct { XMLName xml.Name `xml:"joblist"` Text string `xml:",chardata"` Title string `xml:"title"` Jobs struct { Text string `xml:",chardata"` Jobstatus []struct { Text string `xml:",chardata"` SelfURI struct { Text string `xml:",chardata"` URL string `xml:"url"` Rel string `xml:"rel"` Title string `xml:"title"` } `xml:"selfUri"` } `xml:"jobstatus"` } `xml:"jobs"` }
JobsList stores jobs list information retrieved from CIPRES server
type WorkingDir ¶
type WorkingDir struct { XMLName xml.Name `xml:"workingdir"` Text string `xml:",chardata"` Jobfiles struct { Text string `xml:",chardata"` Jobfile []struct { Text string `xml:",chardata"` DownloadURI struct { Text string `xml:",chardata"` URL string `xml:"url"` Rel string `xml:"rel"` Title string `xml:"title"` } `xml:"downloadUri"` Filename string `xml:"filename"` Length int `xml:"length"` DateModified string `xml:"dateModified"` ParameterName string `xml:"parameterName"` OutputDocumentID string `xml:"outputDocumentId"` } `xml:"jobfile"` } `xml:"jobfiles"` }
WorkingDir stores a running job files list retrieved from CIPRES server
func WorkDir ¶
func WorkDir(job JobStatus) WorkingDir
WorkDir GETs a job working directory files list from CIPRES server based on a job handle provided by jobStatus function and returns a WorkingDir structure