Skip to content

Commit 8b35816

Browse files
author
caleblareau
committed
v0.6.0 stable
1 parent 8342ddb commit 8b35816

4 files changed

Lines changed: 19 additions & 10 deletions

File tree

bap/bap2ProjectClass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(self, script_dir, supported_genomes, mode, input, output, name, nco
6363
cluster, jobs, peak_file,
6464
minimum_barcode_fragments, barcode_whitelist,
6565
minimum_jaccard_index, nc_threshold, regularize_threshold, one_to_one, barcoded_tn5,
66-
extract_mito, keep_temp_files, mapq, max_insert, all_pairs,
66+
extract_mito, s_temp_files, snakemake_stdout, mapq, max_insert, all_pairs,
6767
bedtools_genome, blacklist_file, tss_file, mito_chromosome,
6868
r_path, bedtools_path, samtools_path, bgzip_path, tabix_path, snakemake_path,
6969
drop_tag, bead_tag, speciesMix):

bap/bin/snake/Snakefile.bap2.chr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ rule final_frag_merge:
287287
raw_out = output.finalfrags[:-3]
288288
os.system("cat " + infiles + " | cut -f 1,2,3,4 > " + raw_out)
289289
os.system(bgzip + " " + raw_out)
290-
os.system(tabix + " " + raw_out + ".gz + -p bed")
290+
os.system(tabix + " -p bed " + raw_out + ".gz" )
291291

292292
rule assemble_basic_QC:
293293
input:

bap/cli_bap2.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646

4747
@click.option('--extract-mito', '-em', is_flag=True, help='Extract mitochondrial DNA and annotate with droplet barcodes.')
4848
@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+
4951
@click.option('--mapq', '-mq', default = 30, help='Minimum mapping quality to keep read for downstream analyses')
5052
@click.option('--max-insert', '-mi', default = 2000, help='Max insert size to keep fragment for downstream analysis')
5153
@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,15 +64,15 @@
6264
@click.option('--tabix-path', default = "", help='Path to tabix; by default, assumes that tabix is in PATH')
6365
@click.option('--snakemake-path', default = "", help='Path to snakemake; by default, assumes that snakemake is in PATH')
6466

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).')
6769

6870

6971
def main(mode, input, output, name, ncores, reference_genome,
7072
cluster, jobs, peak_file,
7173
minimum_barcode_fragments, barcode_whitelist,
7274
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,
7476
bedtools_genome, blacklist_file, tss_file, mito_chromosome,
7577
r_path, bedtools_path, samtools_path, bgzip_path, tabix_path, snakemake_path,
7678
drop_tag, bead_tag):
@@ -125,7 +127,7 @@ def main(mode, input, output, name, ncores, reference_genome,
125127
cluster, jobs, peak_file,
126128
minimum_barcode_fragments, barcode_whitelist,
127129
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,
129131
bedtools_genome, blacklist_file, tss_file, mito_chromosome,
130132
r_path, bedtools_path, samtools_path, bgzip_path, tabix_path, snakemake_path,
131133
drop_tag, bead_tag, speciesMix)
@@ -206,7 +208,14 @@ def main(mode, input, output, name, ncores, reference_genome,
206208
# Assemble some log files for the snake file
207209
snake_stats = logs + "/" + p.name + ".snakemake.stats"
208210
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
210219
os.system(snakecmd_chr)
211220

212221
# Check to make sure snakemake Processing worked

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name='bap',
11-
version='0.5.9i',
11+
version='0.6.0',
1212
url='https://github.com/caleblareau/bap',
1313
license='MIT',
1414
author='Caleb Lareau',
@@ -34,8 +34,8 @@
3434
# As from http://pypi.python.org/pypi?%3Aaction=list_classifiers
3535
# 'Development Status :: 1 - Planning',
3636
# 'Development Status :: 2 - Pre-Alpha',
37-
'Development Status :: 3 - Alpha',
38-
# 'Development Status :: 4 - Beta',
37+
# 'Development Status :: 3 - Alpha',
38+
'Development Status :: 4 - Beta',
3939
# 'Development Status :: 5 - Production/Stable',
4040
# 'Development Status :: 6 - Mature',
4141
# 'Development Status :: 7 - Inactive',

0 commit comments

Comments
 (0)