-
Notifications
You must be signed in to change notification settings - Fork 1
/
finishing.snakefile
80 lines (53 loc) · 2.15 KB
/
finishing.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
configfile: "./config.yaml"
from os.path import join
snakemake.utils.makedirs('AGapEs_analysis/results_AGapEs/finishing/alignments_final/')
#Todo 1: solve conflicts
rule all:
input:
"AGapEs_analysis/report.txt",
"AGapEs_analysis/results_AGapEs/finishing/ancestral_sequence_map_new_augmented"
rule sortAndIndex:
input:
"AGapEs_analysis/results_AGapEs/scaffold/gaps_coordinates_and_length",
"AGapEs_analysis/results_AGapEs/finishing/",
"AGapEs_analysis/results_AGapEs/assemblies/"
output:
"AGapEs_analysis/results_AGapEs/finishing/gaps_filled_index_X"
shell:
"""
python2 ./scripts/index_ancestral_gap_sequences.py {input} X
python2 ./scripts/sort_ancestral_gap_sequences.py {input}
cp AGapEs_analysis/results_AGapEs/gapFilling_partial/part_filled/*ancestral AGapEs_analysis/results_AGapEs/finishing/alignments_final/
cp AGapEs_analysis/results_AGapEs/gapFilling_partial_IS/part_IS_filled/*ancestral AGapEs_analysis/results_AGapEs/finishing/alignments_final/
"""
rule run_FPSAC_finishing:
input:
tree=config["tree"],
contigs=config["contigs"],
references=config["references"],
index="AGapEs_analysis/results_AGapEs/finishing/gaps_filled_index_X",
output:
"AGapEs_analysis/results_AGapEs/finishing/ancestral_sequence_map_new"
log:
"logs/fpsac/finishing.log"
shell:
"cd FPSAC; ./run_finishing.sh AGapEs_analysis {input.tree} {input.contigs} {input.references}; cd .."
rule extendAncestralMap:
input:
"AGapEs_analysis/results_AGapEs/finishing/ancestral_sequence_map_new",
"AGapEs_analysis/results_AGapEs/finishing/gaps_filled_index_X",
"AGapEs_analysis/results_AGapEs/gapFilling_partial/partGaps_coordinates.index",
"AGapEs_analysis/results_AGapEs/gapFilling_partial_IS/partGaps_coordinates.index",
"AGapEs_analysis/adjacencies.info"
output:
"AGapEs_analysis/results_AGapEs/finishing/ancestral_sequence_map_new_augmented"
shell:
"python2 ./scripts/extending_ancestral_map.py {input}"
rule createReport:
input:
contigs=config["contigs"],
map="AGapEs_analysis/results_AGapEs/finishing/ancestral_sequence_map_new"
output:
"AGapEs_analysis/report.txt"
shell:
"./scripts/createReport.sh {input.contigs}"