Mercurial > repos > chrisw > monorail_test
comparison Snakefile @ 14:f2258de365ee draft
Uploaded
| author | chrisw |
|---|---|
| date | Wed, 13 Feb 2019 16:05:41 -0500 |
| parents | af1f49e5242d |
| children | 3fa68a0d59c5 |
comparison
equal
deleted
inserted
replaced
| 13:af1f49e5242d | 14:f2258de365ee |
|---|---|
| 12 'bamcount_frag.tsv', | 12 'bamcount_frag.tsv', |
| 13 'Chimeric.out.junction.zst', | 13 'Chimeric.out.junction.zst', |
| 14 'all.exon_bw_count.zst', 'unique.exon_bw_count.zst', | 14 'all.exon_bw_count.zst', 'unique.exon_bw_count.zst', |
| 15 'manifest'] | 15 'manifest'] |
| 16 | 16 |
| 17 #get rid of the pesky warnings about current paths | |
| 18 #and make sure we're not assuming any wrong relative paths | |
| 17 import os | 19 import os |
| 18 config['output']=os.path.abspath(config['output']) | 20 config['output']=os.path.abspath(config['output']) |
| 19 config['temp']=os.path.abspath(config['temp']) | 21 config['temp']=os.path.abspath(config['temp']) |
| 22 config['exon_bed']=os.path.abspath(config['exon_bed']) | |
| 23 config['ref']=os.path.abspath(config['ref']) | |
| 20 | 24 |
| 21 import subprocess | 25 import subprocess |
| 22 def run_command(cmd_args): | 26 def run_command(cmd_args): |
| 23 cmd_args = ' '.join(cmd_args) | 27 cmd_args = ' '.join(cmd_args) |
| 24 try: | 28 try: |
| 157 | 161 |
| 158 rule bamcount: | 162 rule bamcount: |
| 159 input: | 163 input: |
| 160 bam=config['temp'] + '/{quad}-sorted.bam', | 164 bam=config['temp'] + '/{quad}-sorted.bam', |
| 161 bamidx=config['temp'] + '/{quad}-sorted.bam.bai', | 165 bamidx=config['temp'] + '/{quad}-sorted.bam.bai', |
| 162 #exe='/bamcount/bamcount', | |
| 163 exe='bamcount', | |
| 164 bed=lambda wildcards: '%s/%s/gtf/%s' % (config['ref'], wildcards.quad.split('_')[2], config.get('bw_bed', 'exons.bed')) | 166 bed=lambda wildcards: '%s/%s/gtf/%s' % (config['ref'], wildcards.quad.split('_')[2], config.get('bw_bed', 'exons.bed')) |
| 165 output: | 167 output: |
| 166 nonref=config['output'] + '/{quad}.bamcount_nonref.csv.zst', | 168 nonref=config['output'] + '/{quad}.bamcount_nonref.csv.zst', |
| 167 auc=config['output'] + '/{quad}.bamcount_auc.tsv', | 169 auc=config['output'] + '/{quad}.bamcount_auc.tsv', |
| 168 frag=config['output'] + '/{quad}.bamcount_frag.tsv', | 170 frag=config['output'] + '/{quad}.bamcount_frag.tsv', |
| 177 uniq_qual=config.get('unique_qual', 10) | 179 uniq_qual=config.get('unique_qual', 10) |
| 178 threads: 4 | 180 threads: 4 |
| 179 shell: | 181 shell: |
| 180 """ | 182 """ |
| 181 TMP={config[temp]}/{params.srr}_bamcount | 183 TMP={config[temp]}/{params.srr}_bamcount |
| 182 {input.exe} {input.bam} \ | 184 bamcount {input.bam} \ |
| 183 --threads {threads} \ | 185 --threads {threads} \ |
| 184 --coverage \ | 186 --coverage \ |
| 185 --no-head \ | 187 --no-head \ |
| 186 --require-mdz \ | 188 --require-mdz \ |
| 187 --min-unique-qual {params.uniq_qual} \ | 189 --min-unique-qual {params.uniq_qual} \ |
