crs4/fair-crcc-get-data
None
Overview
Topics:
Latest release: v1.0.0, Last update: 2022-10-27
Linting: linting: failed, Formatting: formatting: failed
Deployment
Step 1: Install Snakemake and Snakedeploy
Snakemake and Snakedeploy are best installed via the Mamba package manager (a drop-in replacement for conda). If you have neither Conda nor Mamba, it is recommended to install Miniforge. More details regarding Mamba can be found here.
When using Mamba, run
mamba create -c conda-forge -c bioconda --name snakemake snakemake snakedeploy
to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via
conda activate snakemake
Step 2: Deploy workflow
With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:
mkdir -p path/to/project-workdir
cd path/to/project-workdir
In all following steps, we will assume that you are inside of that directory. Then run
snakedeploy deploy-workflow https://github.com/crs4/fair-crcc-get-data . --tag v1.0.0
Snakedeploy will create two folders, workflow
and config
. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.
Step 3: Configure workflow
To configure the workflow, adapt config/config.yml
to your needs following the instructions below.
Step 4: Run workflow
The deployment method is controlled using the --software-deployment-method
(short --sdm
) argument.
To run the workflow with automatic deployment of all required software via conda
/mamba
, use
snakemake --cores all --sdm conda
Snakemake will automatically detect the main Snakefile
in the workflow
subfolder and execute the workflow module that has been defined by the deployment in step 2.
For further options such as cluster and cloud execution, see the docs.
Step 5: Generate report
After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using
snakemake --report report.zip
Configuration
The following section is imported from the workflow’s config/README.md
.
Describe how to configure the workflow (using config.yaml and maybe additional files). All of them need to be present with example entries inside of the config folder.
Linting and formatting
Linting results
1WorkflowError in file /tmp/tmpi11vazt_/crs4-fair-crcc-get-data-2a5f214/workflow/rules/common.smk, line 13:
2Error validating config file.
3ValidationError: 'recipient_key' is a required property
4
5Failed validating 'required' in schema:
6 {'$defs': {'connection': {'description': 'Connection parameters for '
7 '[Snakemake remote '
8 'provider](https://snakemake.readthedocs.io/en/v6.13.1/snakefiles/remote_files.html#remote-files). '
9 'Keys required/supported vary '
10 'depending on the provider '
11 'type. See the snakemake '
12 'documentation for details.\n',
13 'example': {'access_key_id': 'MYACCESSKEY',
14 'host': 'http://localhost:9000',
15 'secret_access_key': 'MYSECRET',
16 'verify': False},
17 'type': 'object'},
18 'connection_type': {'enum': ['AzBlob',
19 'dropbox',
20 'EGA',
21 'FTP',
22 'gfal',
23 'gridftp',
24 'GS',
25 'HTTP',
26 'iRODS',
27 'NCBI',
28 'S3',
29 'SFTP',
30 'webdav',
31 'XRootD'],
32 'type': 'string'},
33 'root_path': {'default': '/', 'type': 'string'},
34 'rule': {'properties': {'action': {'enum': ['include',
35 'exclude'],
36 'type': 'string'},
37 'pattern': {'type': 'string'}},
38 'required': ['action', 'pattern'],
39 'type': 'object'}},
40 '$schema': 'https://json-schema.org/draft/2020-12/schema',
41 'description': 'Configuration schema for get-data workflow.',
42 'examples': {'destination': {'connection': {'access_key_id': 'MYACCESSKEY',
43 'host': 'http://localhost:9000',
44 'secret_access_key': 'MYSECRET',
45 'verify': False},
46 'root_path': 'bucket/subpath/',
47 'type': 'S3'},
48 'filters': [{'action': 'exclude',
49 'pattern': 'test-file_2.txt'}],
50 'recipient_key': './recipient_key',
51 'repository': {'path': '/mnt/rbd/data/sftp/fair-crcc/',
52 'private_key': 'bbmri-key',
53 'public_key': 'bbmri-key.pub'},
54 'sources': {'glob_extension': '.tiff.c4gh',
55 'items': ['some/directory/to/glob',
56 'another/individual/file.tiff.c4gh']}},
57 'properties': {'destination': {'description': 'Destination for '
58 'decrypted data.\n',
59 'properties': {'connection': {'$ref': '#/$defs/connection'},
60 'root_path': {'allOf': [{'$ref': '#/$defs/root_path'},
61 {'description': 'Prefix '
62 'path '
63 'for '
64 'destination. '
65 'The '
66 'workflow '
67 'will '
68 're-create '
69 'the '
70 'original '
71 'source '
72 'directory '
73 'structure '
74 'at '
75 'the '
76 'destination '
77 'storage '
78 'and '
79 'under '
80 'this '
81 'path.\n'}]},
82 'type': {'default': 'local',
83 'description': 'Any '
84 'of '
85 'the '
86 '[remote '
87 'providers '
88 'supported '
89 'by '
90 'snakemake](https://snakemake.readthedocs.io/en/v6.13.1/snakefiles/remote_files.html#remote-files) '
91 'plus '
92 '"local". '
93 'Default '
94 'value: '
95 '"local"\n',
96 'oneOf': [{'enum': ['local'],
97 'type': 'string'},
98 {'$ref': '#/$defs/connection_type'}]}},
99 'required': ['type'],
100 'type': 'object'},
101 'filters': {'description': 'Optional list of of '
102 'filters to be applied to '
103 'destination file names. '
104 'These are the original '
105 'names of the files and the '
106 'names with which they will '
107 'be saved in the specified '
108 'destination. The filters '
109 'follow a logic similar to '
110 'rsync (for those who are '
111 'familiar with that tool).\n'
112 'Each filter specifies a '
113 'glob expression for '
114 'matching files and an '
115 '"include" or "exclude" '
116 'action that they apply, if '
117 'they match a file. The '
118 'filters are tried in the '
119 'order they are specified: '
120 'the first one that matches '
121 'is applied; if no filters '
122 'match a file name, the '
123 'file is included.\n',
124 'items': {'$ref': '#/$defs/rule'},
125 'type': 'array'},
126 'recipient_key': {'description': "Path to recipient's "
127 'c4gh private key. '
128 'Must be within '
129 'working directory '
130 'tree.\n',
131 'type': 'string'},
132 'source': {'description': 'Source of encrypted data.',
133 'properties': {'connection': {'$ref': '#/$defs/connection'},
134 'root_path': {'allOf': [{'$ref': '#/$defs/root_path'},
135 {'description': 'Prefix '
136 'path '
137 'for '
138 'source. '
139 'The '
140 'workflow '
141 'will '
142 'look '
143 'for '
144 'files '
145 'under '
146 'this '
147 'path.\n'}]},
148 'type': {'allOf': [{'$ref': '#/$defs/connection_type'}],
149 'description': 'Any '
150 'of '
151 'the '
152 '[remote '
153 'providers '
154 'supported '
155 'by '
156 'snakemake](https://snakemake.readthedocs.io/en/v6.13.1/snakefiles/remote_files.html#remote-files).\n'}},
157 'required': ['type', 'connection'],
158 'type': 'object'}},
159 'required': ['recipient_key', 'source', 'destination']}
160
161On instance:
162 {}
163 File "/tmp/tmpi11vazt_/crs4-fair-crcc-get-data-2a5f214/workflow/Snakefile", line 17, in <module>
164 File "/tmp/tmpi11vazt_/crs4-fair-crcc-get-data-2a5f214/workflow/rules/common.smk", line 13, in <module>
Formatting results
1[DEBUG]
2[DEBUG] In file "/tmp/tmpi11vazt_/crs4-fair-crcc-get-data-2a5f214/workflow/rules/download.smk": Formatted content is different from original
3[DEBUG]
4[DEBUG] In file "/tmp/tmpi11vazt_/crs4-fair-crcc-get-data-2a5f214/workflow/rules/decryption.smk": Formatted content is different from original
5[DEBUG]
6[DEBUG] In file "/tmp/tmpi11vazt_/crs4-fair-crcc-get-data-2a5f214/workflow/rules/common.smk": Formatted content is different from original
7[DEBUG]
8[DEBUG] In file "/tmp/tmpi11vazt_/crs4-fair-crcc-get-data-2a5f214/workflow/Snakefile": Formatted content is different from original
9[INFO] 4 file(s) would be changed 😬
10
11snakefmt version: 0.8.4