Partek Flow Documentation

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Alternatively, GetToken.py will generate a token:

>python
Code Block
languagebash
python GetToken.py --server localhost:8080 --user admin

...

When accessing the API directly, the encrypt parameter must be specified with the RSA value to use the token:

Code Block
languagebash
curl --form username=admin --form encrypt=RSA --form password=cUOWY0VvkSFagr... http://localhost:8080/flow/api/v1/users/list

...

Use UploadSamples.py to upload the samples and launch the pipeline:

>
Code Block
languagebash
python UploadSamples.py -v --server http://localhost:8080 --user admin --password [access token] --files ~/sample1.fastq.gz ~/sample2.fastq.gz --project ProjectName --pipeline AlignAndQuantify --inputs 28061,145855

Use AddAttribute.py to add sample attributes:

Code Block
languagebash
python AddAttribute.py -v --server http://localhost:8080 --user admin --password [access token] --project_name ProjectName --sample_name sample1 --attribute Type --value Case 

 

Add a collaborator to a project

To add a collaborator to a project:

Code Block
languagebash
curl -X PUT "http://localhost:8080/flow/api/v1/projects?project=ProjectName&collaborator=user1&role=Collaborator&username=admin&encrypt=RSA&password=[url encoded token]"

...

Monitor a folder and upload files as they are created

Code Block
languagebash
#!/bin/bash
inotifywait -m $PATH_TO_MONITOR -e create -e moved_to |
  while read path action file; do
      if [[ $file == *.fastq.gz ]]; then
              echo "Uploading $file"
              python UploadSamples.py -v --server $SERVER --user $USER --password $TOKEN --files $path/$file --project "$PROJECT" 
      fi
  done

Monitor the queue and send a notification if there are too many waiting tasks:

Code Block
languagebash
#!/bin/bash
while true; do
      result=`python QueueStatistics.py --server $SERVER --user $USER --password $TOKEN --max_waiting $MAX_WAITING`
      if [ $? -eq 1 ]; then
              /usr/bin/notify-send $result
              exit 1
      fi
      sleep $INTERVAL
done

...