Pipeline template template » History » Version 3
Bryan Cosca, 05/21/2015 05:25 PM
1 | 1 | Bryan Cosca | h1. Pipeline template template |
---|---|---|---|
2 | |||
3 | h2. Run-Command Template |
||
4 | |||
5 | |||
6 | h2. Crunch Script Template |
||
7 | <pre> |
||
8 | #!/usr/bin/env python |
||
9 | |||
10 | import arvados |
||
11 | import subprocess |
||
12 | import os |
||
13 | import sys |
||
14 | import re |
||
15 | from arvados.collection import Collection as coll |
||
16 | import arvados_tools |
||
17 | import shutil |
||
18 | |||
19 | arvados_tools.spawn_new_task_per_file('input','.*realigned.bqsrCal.bam$',if_sequence=0, and_end_task=True) |
||
20 | |||
21 | this_job = arvados.current_job() |
||
22 | this_task = arvados.current_task() |
||
23 | tmpdir = arvados.current_task().tmpdir |
||
24 | |||
25 | input_1 = this_task['parameters']['input_1'] |
||
26 | input_1_path = os.path.join(arvados.get_job_param_mount("input"),input_1) |
||
27 | tmp_input_1_path = os.path.join(tmpdir,input_1) # If we need to copy to tmpdir |
||
28 | shutil.copyfile(input_1_path,tmp_input_1_path) # If we need to copy to tmpdir |
||
29 | </pre> |
||
30 | |||
31 | |||
32 | <pre> |
||
33 | samtools_path = arvados_tools.get_file_path('samtools','^samtools$') |
||
34 | gatk_path = arvados_tools.get_file_path('gatk_jar','^GenomeAnalysisTK.jar$') |
||
35 | reference_path = arvados_tools.get_file_path('reference','.*f(ast)?a(.gz)?$') |
||
36 | dbsnp_path = arvados_tools.get_file_path('dbsnp','^dbsnp.*vcf$') |
||
37 | </pre> |
||
38 | |||
39 | <pre> |
||
40 | gatk_inserttool_args = [] |
||
41 | gatk_inserttool_output_name |
||
42 | gatk_inserttool_output_path |
||
43 | gatk_inserttool_pipe = subprocess.check_output() |
||
44 | </pre> |
||
45 | |||
46 | <pre> |
||
47 | samtools_inserttool_args = [] |
||
48 | </pre> |
||
49 | |||
50 | h2. Script Parameter Template |
||
51 | |||
52 | |||
53 | 3 | Bryan Cosca | h2. Latest arvados_sdk_version: |
54 | 2 | Bryan Cosca | |
55 | https://arvados.org/projects/arvados/repository/revisions/master/show/sdk/python |