Skip to content

Commit 68c6f10

Browse files
authored
Merge pull request #46 from bbglab/18-openvariant-dont-fail-if-folderfile-permission-denied
18 OpenVariant Dont fail if folderfile permission denied
2 parents 24dbf20 + 3f8b7de commit 68c6f10

File tree

15 files changed

+737
-473
lines changed

15 files changed

+737
-473
lines changed

docs/examples/cli/introduction_cli.ipynb

+47-12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {
66
"collapsed": false,
7+
"jupyter": {
8+
"outputs_hidden": false
9+
},
710
"pycharm": {
811
"name": "#%% md\n"
912
}
@@ -16,6 +19,9 @@
1619
"cell_type": "markdown",
1720
"metadata": {
1821
"collapsed": false,
22+
"jupyter": {
23+
"outputs_hidden": false
24+
},
1925
"pycharm": {
2026
"name": "#%% md\n"
2127
}
@@ -31,6 +37,9 @@
3137
"execution_count": 1,
3238
"metadata": {
3339
"collapsed": false,
40+
"jupyter": {
41+
"outputs_hidden": false
42+
},
3443
"pycharm": {
3544
"name": "#%%\n"
3645
}
@@ -67,6 +76,9 @@
6776
"cell_type": "markdown",
6877
"metadata": {
6978
"collapsed": false,
79+
"jupyter": {
80+
"outputs_hidden": false
81+
},
7082
"pycharm": {
7183
"name": "#%% md\n"
7284
}
@@ -77,9 +89,12 @@
7789
},
7890
{
7991
"cell_type": "code",
80-
"execution_count": 2,
92+
"execution_count": 1,
8193
"metadata": {
8294
"collapsed": false,
95+
"jupyter": {
96+
"outputs_hidden": false
97+
},
8398
"pycharm": {
8499
"name": "#%%\n"
85100
}
@@ -98,6 +113,7 @@
98113
" -a, --annotations PATH Annotation path. eg: /path/annotation_vcf.yaml\n",
99114
" --header Show the result header.\n",
100115
" -o, --output TEXT File to write the output.\n",
116+
" --skip Skip files and directories that are unreadable.\n",
101117
" -h, --help Show this message and exit.\n"
102118
]
103119
}
@@ -111,6 +127,9 @@
111127
"cell_type": "markdown",
112128
"metadata": {
113129
"collapsed": false,
130+
"jupyter": {
131+
"outputs_hidden": false
132+
},
114133
"pycharm": {
115134
"name": "#%% md\n"
116135
}
@@ -121,9 +140,12 @@
121140
},
122141
{
123142
"cell_type": "code",
124-
"execution_count": 3,
143+
"execution_count": 2,
125144
"metadata": {
126145
"collapsed": false,
146+
"jupyter": {
147+
"outputs_hidden": false
148+
},
127149
"pycharm": {
128150
"name": "#%%\n"
129151
}
@@ -144,6 +166,7 @@
144166
" -c, --cores INTEGER Maximum processes to run in parallel.\n",
145167
" -q, --quite Don't show the progress.\n",
146168
" -o, --output TEXT File to write the output.\n",
169+
" --skip Skip files and directories that are unreadable.\n",
147170
" -h, --help Show this message and exit.\n"
148171
]
149172
}
@@ -157,6 +180,9 @@
157180
"cell_type": "markdown",
158181
"metadata": {
159182
"collapsed": false,
183+
"jupyter": {
184+
"outputs_hidden": false
185+
},
160186
"pycharm": {
161187
"name": "#%% md\n"
162188
}
@@ -167,9 +193,12 @@
167193
},
168194
{
169195
"cell_type": "code",
170-
"execution_count": 4,
196+
"execution_count": 3,
171197
"metadata": {
172198
"collapsed": false,
199+
"jupyter": {
200+
"outputs_hidden": false
201+
},
173202
"pycharm": {
174203
"name": "#%%\n"
175204
}
@@ -194,6 +223,7 @@
194223
" -c, --cores INTEGER Maximum processes to run in parallel.\n",
195224
" -q, --quite Don't show the progress.\n",
196225
" -o, --output TEXT File to write the output.\n",
226+
" --skip Skip files and directories that are unreadable.\n",
197227
" -h, --help Show this message and exit.\n"
198228
]
199229
}
@@ -207,6 +237,9 @@
207237
"cell_type": "markdown",
208238
"metadata": {
209239
"collapsed": false,
240+
"jupyter": {
241+
"outputs_hidden": false
242+
},
210243
"pycharm": {
211244
"name": "#%% md\n"
212245
}
@@ -217,9 +250,12 @@
217250
},
218251
{
219252
"cell_type": "code",
220-
"execution_count": 5,
253+
"execution_count": 4,
221254
"metadata": {
222255
"collapsed": false,
256+
"jupyter": {
257+
"outputs_hidden": false
258+
},
223259
"pycharm": {
224260
"name": "#%%\n"
225261
}
@@ -234,9 +270,8 @@
234270
" Actions to apply on the plugin system.\n",
235271
"\n",
236272
"Options:\n",
237-
" -n, --name TEXT Name of the plugin.\n",
238-
" -d, --directory TEXT Directory to reach the plugin.\n",
239-
" -h, --help Show this message and exit.\n"
273+
" -n, --name TEXT Name of the plugin.\n",
274+
" -h, --help Show this message and exit.\n"
240275
]
241276
}
242277
],
@@ -248,23 +283,23 @@
248283
],
249284
"metadata": {
250285
"kernelspec": {
251-
"display_name": "Python 3",
286+
"display_name": "Python 3 (ipykernel)",
252287
"language": "python",
253288
"name": "python3"
254289
},
255290
"language_info": {
256291
"codemirror_mode": {
257292
"name": "ipython",
258-
"version": 2
293+
"version": 3
259294
},
260295
"file_extension": ".py",
261296
"mimetype": "text/x-python",
262297
"name": "python",
263298
"nbconvert_exporter": "python",
264-
"pygments_lexer": "ipython2",
265-
"version": "2.7.6"
299+
"pygments_lexer": "ipython3",
300+
"version": "3.13.2"
266301
}
267302
},
268303
"nbformat": 4,
269-
"nbformat_minor": 0
304+
"nbformat_minor": 4
270305
}

docs/examples/find_files/find_files_with_directory_path.ipynb

+59-40
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,75 @@
1313
},
1414
{
1515
"cell_type": "markdown",
16-
"source": [
17-
"A Simple example on how find files task works for a directory path."
18-
],
1916
"metadata": {
2017
"collapsed": false,
18+
"jupyter": {
19+
"outputs_hidden": false
20+
},
2121
"pycharm": {
2222
"name": "#%% md\n"
2323
}
24-
}
24+
},
25+
"source": [
26+
"A Simple example on how find files task works for a directory path."
27+
]
2528
},
2629
{
2730
"cell_type": "code",
2831
"execution_count": 1,
32+
"metadata": {
33+
"collapsed": false,
34+
"jupyter": {
35+
"outputs_hidden": false
36+
},
37+
"pycharm": {
38+
"name": "#%%\n"
39+
}
40+
},
2941
"outputs": [],
3042
"source": [
3143
"from os import getcwd\n",
3244
"from os.path import dirname\n",
3345
"from openvariant import findfiles\n",
3446
"\n",
3547
"dataset_folder = f'{dirname(getcwd())}/datasets/sample1'"
36-
],
48+
]
49+
},
50+
{
51+
"cell_type": "markdown",
3752
"metadata": {
3853
"collapsed": false,
54+
"jupyter": {
55+
"outputs_hidden": false
56+
},
3957
"pycharm": {
40-
"name": "#%%\n"
58+
"name": "#%% md\n"
4159
}
42-
}
43-
},
44-
{
45-
"cell_type": "markdown",
60+
},
4661
"source": [
4762
"It will get any type of file that matches with any _annotation_ file that is on the same folder or in a child folder.\n",
4863
"\n",
4964
"`find_files` function parameters:\n",
5065
"\n",
5166
"- `base_path` - Base path of _input_ folder.\n",
5267
"- `annotation_path` - Path of _annotation_ file.\n",
68+
"- `skip_files` - Skip unreadable files and directories.\n",
5369
"\n",
5470
"As we see, the output has two types of pattern `*.vcf.gz` and `*.maf.gz`.\n"
55-
],
56-
"metadata": {
57-
"collapsed": false,
58-
"pycharm": {
59-
"name": "#%% md\n"
60-
}
61-
}
71+
]
6272
},
6373
{
6474
"cell_type": "code",
6575
"execution_count": 2,
76+
"metadata": {
77+
"collapsed": false,
78+
"jupyter": {
79+
"outputs_hidden": false
80+
},
81+
"pycharm": {
82+
"name": "#%%\n"
83+
}
84+
},
6685
"outputs": [
6786
{
6887
"name": "stdout",
@@ -94,31 +113,37 @@
94113
" print(f'File path: {file_path}')\n",
95114
" print(f'Annotation object: {annotation}')\n",
96115
" print(\"-------------------------------------\")"
97-
],
98-
"metadata": {
99-
"collapsed": false,
100-
"pycharm": {
101-
"name": "#%%\n"
102-
}
103-
}
116+
]
104117
},
105118
{
106119
"cell_type": "markdown",
107-
"source": [
108-
"In the following example, we will get files with a fixed _Annotation_ file.\n",
109-
"\n",
110-
"All the files that we will be able to detect will follow the pattern described on annotations."
111-
],
112120
"metadata": {
113121
"collapsed": false,
122+
"jupyter": {
123+
"outputs_hidden": false
124+
},
114125
"pycharm": {
115126
"name": "#%% md\n"
116127
}
117-
}
128+
},
129+
"source": [
130+
"In the following example, we will get files with a fixed _Annotation_ file.\n",
131+
"\n",
132+
"All the files that we will be able to detect will follow the pattern described on annotations."
133+
]
118134
},
119135
{
120136
"cell_type": "code",
121137
"execution_count": 3,
138+
"metadata": {
139+
"collapsed": false,
140+
"jupyter": {
141+
"outputs_hidden": false
142+
},
143+
"pycharm": {
144+
"name": "#%%\n"
145+
}
146+
},
122147
"outputs": [
123148
{
124149
"name": "stdout",
@@ -140,13 +165,7 @@
140165
" print(f'File path: {file_path}')\n",
141166
" print(f'Annotation object: {annotation}')\n",
142167
" print(\"-------------------------------------\")"
143-
],
144-
"metadata": {
145-
"collapsed": false,
146-
"pycharm": {
147-
"name": "#%%\n"
148-
}
149-
}
168+
]
150169
}
151170
],
152171
"metadata": {
@@ -166,9 +185,9 @@
166185
"name": "python",
167186
"nbconvert_exporter": "python",
168187
"pygments_lexer": "ipython3",
169-
"version": "3.8.12"
188+
"version": "3.10.16"
170189
}
171190
},
172191
"nbformat": 4,
173-
"nbformat_minor": 1
174-
}
192+
"nbformat_minor": 4
193+
}

0 commit comments

Comments
 (0)