|
46 | 46 |
|
47 | 47 | @click.option('--extract-mito', '-em', is_flag=True, help='Extract mitochondrial DNA and annotate with droplet barcodes.') |
48 | 48 | @click.option('--keep-temp-files', '-z', is_flag=True, help='Keep all intermediate files.') |
| 49 | +@click.option('--snakemake-stdout', '-ss', is_flag=True, help='Write what would typically go in the snakemake log file into stdout.') |
| 50 | + |
49 | 51 | @click.option('--mapq', '-mq', default = 30, help='Minimum mapping quality to keep read for downstream analyses') |
50 | 52 | @click.option('--max-insert', '-mi', default = 2000, help='Max insert size to keep fragment for downstream analysis') |
51 | 53 | @click.option('--all-pairs', '-ap', is_flag=True, help='Include all read pairs when assembling fragments (not just proper pairs, which is the default)') |
|
62 | 64 | @click.option('--tabix-path', default = "", help='Path to tabix; by default, assumes that tabix is in PATH') |
63 | 65 | @click.option('--snakemake-path', default = "", help='Path to snakemake; by default, assumes that snakemake is in PATH') |
64 | 66 |
|
65 | | -@click.option('--drop-tag', '-dt', default = "DB", help='New tag in the .bam file(s) that will be the name of the drop barcode.') |
66 | | -@click.option('--bead-tag', '-bt', default = "XB", help='Tag in the .bam file(s) that point to the bead barcode.') |
| 67 | +@click.option('--drop-tag', '-dt', default = "DB", help='New tag in the .bam file(s) that will be the name of the droplet barcode.') |
| 68 | +@click.option('--bead-tag', '-bt', default = "XB", help='Tag in the .bam file(s) that points to the bead barcode (should already exist).') |
67 | 69 |
|
68 | 70 |
|
69 | 71 | def main(mode, input, output, name, ncores, reference_genome, |
70 | 72 | cluster, jobs, peak_file, |
71 | 73 | minimum_barcode_fragments, barcode_whitelist, |
72 | 74 | minimum_jaccard_index, nc_threshold, regularize_threshold, one_to_one, barcoded_tn5, |
73 | | - extract_mito, keep_temp_files, mapq, max_insert, all_pairs, |
| 75 | + extract_mito, keep_temp_files, snakemake_stdout, mapq, max_insert, all_pairs, |
74 | 76 | bedtools_genome, blacklist_file, tss_file, mito_chromosome, |
75 | 77 | r_path, bedtools_path, samtools_path, bgzip_path, tabix_path, snakemake_path, |
76 | 78 | drop_tag, bead_tag): |
@@ -125,7 +127,7 @@ def main(mode, input, output, name, ncores, reference_genome, |
125 | 127 | cluster, jobs, peak_file, |
126 | 128 | minimum_barcode_fragments, barcode_whitelist, |
127 | 129 | minimum_jaccard_index, nc_threshold, regularize_threshold, one_to_one, barcoded_tn5, |
128 | | - extract_mito, keep_temp_files, mapq, max_insert, all_pairs, |
| 130 | + extract_mito, keep_temp_files, snakemake_stdout, mapq, max_insert, all_pairs, |
129 | 131 | bedtools_genome, blacklist_file, tss_file, mito_chromosome, |
130 | 132 | r_path, bedtools_path, samtools_path, bgzip_path, tabix_path, snakemake_path, |
131 | 133 | drop_tag, bead_tag, speciesMix) |
@@ -206,7 +208,14 @@ def main(mode, input, output, name, ncores, reference_genome, |
206 | 208 | # Assemble some log files for the snake file |
207 | 209 | snake_stats = logs + "/" + p.name + ".snakemake.stats" |
208 | 210 | snake_log = logs + "/" + p.name + ".snakemake.log" |
209 | | - snakecmd_chr = p.snakemake+snakeclust+' --snakefile '+script_dir+'/bin/snake/Snakefile.bap2.chr --cores '+ncores+' --config cfp="' + y_s + '" --stats '+snake_stats+' &>' + snake_log |
| 211 | + |
| 212 | + # Handle edge cases of needing to write snakemake stdout to log |
| 213 | + if(snakemake_stdout): |
| 214 | + snake_log_preference = "" |
| 215 | + else: |
| 216 | + snake_log_preference = ' &>' + snake_log |
| 217 | + |
| 218 | + snakecmd_chr = p.snakemake+snakeclust+' --snakefile '+script_dir+'/bin/snake/Snakefile.bap2.chr --cores '+ncores+' --config cfp="' + y_s + '" --stats '+snake_stats+snake_log_preference |
210 | 219 | os.system(snakecmd_chr) |
211 | 220 |
|
212 | 221 | # Check to make sure snakemake Processing worked |
|
0 commit comments