|
1 | 1 |
|
2 | 2 | rule symlink_stats: |
3 | 3 | input: |
4 | | - os.path.join(result_path, 'results', "{sample}", '{sample}.stats.tsv'), |
5 | | - os.path.join(result_path, 'results', "{sample}", '{sample}.tss_histogram.csv'), |
6 | | - os.path.join(result_path, 'results', "{sample}", 'mapped', '{sample}.txt'), |
7 | | - os.path.join(result_path, 'results', "{sample}", 'mapped', '{sample}.fastp.json'), |
8 | | - os.path.join(result_path, 'results', "{sample}", 'mapped', '{sample}.samblaster.log'), |
9 | | - os.path.join(result_path, 'results', "{sample}", 'mapped', '{sample}.samtools_flagstat.log'), |
10 | | - os.path.join(result_path, 'results', "{sample}", 'peaks', '{sample}.macs2.log'), |
11 | | - os.path.join(result_path, 'results', "{sample}", 'peaks', '{sample}_peaks.xls'), |
| 4 | + stats_tsv = os.path.join(result_path, 'results', "{sample}", '{sample}.stats.tsv'), |
| 5 | + tss_csv = os.path.join(result_path, 'results', "{sample}", '{sample}.tss_histogram.csv'), |
| 6 | + mapped_txt = os.path.join(result_path, 'results', "{sample}", 'mapped', '{sample}.txt'), |
| 7 | + fastp_json = os.path.join(result_path, 'results', "{sample}", 'mapped', '{sample}.fastp.json'), |
| 8 | + samblaster_log = os.path.join(result_path, 'results', "{sample}", 'mapped', '{sample}.samblaster.log'), |
| 9 | + flagstat_log = os.path.join(result_path, 'results', "{sample}", 'mapped', '{sample}.samtools_flagstat.log'), |
| 10 | + macs2_log = os.path.join(result_path, 'results', "{sample}", 'peaks', '{sample}.macs2.log'), |
| 11 | + peaks_xls = os.path.join(result_path, 'results', "{sample}", 'peaks', '{sample}_peaks.xls'), |
12 | 12 | output: |
13 | | - os.path.join(result_path, 'report', '{sample}.stats.tsv'), |
14 | | - os.path.join(result_path, 'report', '{sample}_TSS.csv'), |
15 | | - os.path.join(result_path, 'report', '{sample}.txt'), |
16 | | - os.path.join(result_path, 'report', '{sample}.fastp.json'), |
17 | | - os.path.join(result_path, 'report', '{sample}.samblaster.log'), |
18 | | - os.path.join(result_path, 'report', '{sample}.samtools_flagstat.log'), |
19 | | - os.path.join(result_path, 'report', '{sample}.macs2.log'), |
20 | | - os.path.join(result_path, 'report', '{sample}_peaks.xls'), |
| 13 | + stats_tsv = os.path.join(result_path, 'report', '{sample}.stats.tsv'), |
| 14 | + tss_csv = os.path.join(result_path, 'report', '{sample}_TSS.csv'), |
| 15 | + mapped_txt = os.path.join(result_path, 'report', '{sample}.txt'), |
| 16 | + fastp_json = os.path.join(result_path, 'report', '{sample}.fastp.json'), |
| 17 | + samblaster_log = os.path.join(result_path, 'report', '{sample}.samblaster.log'), |
| 18 | + flagstat_log = os.path.join(result_path, 'report', '{sample}.samtools_flagstat.log'), |
| 19 | + macs2_log = os.path.join(result_path, 'report', '{sample}.macs2.log'), |
| 20 | + peaks_xls = os.path.join(result_path, 'report', '{sample}_peaks.xls'), |
21 | 21 | params: |
22 | 22 | # cluster parameters |
23 | 23 | partition=config.get("partition"), |
24 | 24 | resources: |
25 | 25 | mem_mb=config.get("mem", "1000"), |
26 | 26 | threads: config.get("threads", 1) |
27 | 27 | log: |
28 | | - "logs/rules/symlink_stats_{sample}.log" |
| 28 | + os.path.join("logs", "rules", "symlink_stats_{sample}.log") |
29 | 29 | shell: |
30 | 30 | """ |
31 | | - ln -sf "../../../../{input[0]}" {output[0]} |
32 | | - ln -sf "../../../../{input[1]}" {output[1]} |
33 | | - ln -sf "../../../../{input[2]}" {output[2]} |
34 | | - ln -sf "../../../../{input[3]}" {output[3]} |
35 | | - ln -sf "../../../../{input[4]}" {output[4]} |
36 | | - ln -sf "../../../../{input[5]}" {output[5]} |
37 | | - ln -sf "../../../../{input[6]}" {output[6]} |
38 | | - ln -sf "../../../../{input[7]}" {output[7]} |
| 31 | + ln -sfn $(realpath --relative-to=$(dirname {output.stats_tsv}) {input.stats_tsv}) {output.stats_tsv} |
| 32 | + ln -sfn $(realpath --relative-to=$(dirname {output.tss_csv}) {input.tss_csv}) {output.tss_csv} |
| 33 | + ln -sfn $(realpath --relative-to=$(dirname {output.mapped_txt}) {input.mapped_txt}) {output.mapped_txt} |
| 34 | + ln -sfn $(realpath --relative-to=$(dirname {output.fastp_json}) {input.fastp_json}) {output.fastp_json} |
| 35 | + ln -sfn $(realpath --relative-to=$(dirname {output.samblaster_log}) {input.samblaster_log}) {output.samblaster_log} |
| 36 | + ln -sfn $(realpath --relative-to=$(dirname {output.flagstat_log}) {input.flagstat_log}) {output.flagstat_log} |
| 37 | + ln -sfn $(realpath --relative-to=$(dirname {output.macs2_log}) {input.macs2_log}) {output.macs2_log} |
| 38 | + ln -sfn $(realpath --relative-to=$(dirname {output.peaks_xls}) {input.peaks_xls}) {output.peaks_xls} |
39 | 39 | """ |
40 | 40 |
|
41 | 41 | rule ucsc_hub: |
|
0 commit comments