forked from SainsburyWellcomeCentre/AnimalTrackingPipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
44 lines (33 loc) · 1.42 KB
/
Snakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
configfile: "config.yaml"
print(config)
SESSION, CAMERA, VIDEO_NAMES, = glob_wildcards(config['raw_path'] + "/{session}/cam{camera}/{rawmov}.MOV")
rule all:
input:
config['processed_path'] + "/metadata_csv/movie_paths.csv",
rule extract_metadata:
input:
config['raw_path'] + "/{session}/cam{camera}/{rawmov}.MOV"
output:
config['processed_path'] + "/metadata_jsons/{session}_cam-{camera}_mov-{rawmov}.json"
conda:
"envs/pipeline/env_pipeline.yml"
shell:
"python scripts/extract_metadata.py --camera {wildcards.camera} --session {wildcards.session} {input} > {output}"
# rule extract_metadata2:
# input:
# config['raw_path'] + "/{session}/cam{camera}/{rawmov}.MOV"
# output:
# config['processed_path'] + "/metadata_ffprobe_jsons/{session}_cam-{camera}_mov-{rawmov}.json"
# container:
# "envs/vid_metadata/ffprobe.def"
# shell:
# "python scripts/extract_metadata_ffprobe.py --camera {wildcards.camera} --session {wildcards.session} {input} > {output}"
rule merge_metadata_to_csv:
input:
expand(config['processed_path'] + "/metadata_jsons/{session}_cam-{camera}_mov-{rawmov}.json", zip, session=SESSION, camera=CAMERA, rawmov=VIDEO_NAMES)
output:
config['processed_path'] + "/metadata_csv/movie_paths.csv"
conda:
"envs/pipeline/env_pipeline.yml"
script:
"scripts/merge_json_to_csv.py"