Skip to content

Commit

Permalink
v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
caleblareau committed Jan 16, 2024
1 parent 6167d1b commit 8ffeac8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

# 0.7.0
- Fix deprecation error in yaml
- Fix deprecation error in snakemake

# 0.6.9
- UMI parsing fix for `tenx` mode thanks to @yaniv-el

Expand Down
19 changes: 10 additions & 9 deletions mgatk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pkg_resources import get_distribution
from subprocess import call, check_call
from .mgatkHelp import *
from ruamel import yaml
from ruamel.yaml import YAML
from itertools import repeat
from ruamel.yaml.scalarstring import SingleQuotedScalarString as sqs
from multiprocessing import Pool
Expand Down Expand Up @@ -362,35 +362,35 @@ def main(mode, input, output, name, mito_genome, ncores,

y_s = of + "/.internal/parseltongue/snake.scatter.yaml"
with open(y_s, 'w') as yaml_file:
yaml.dump(dict1, yaml_file, default_flow_style=False, Dumper=yaml.RoundTripDumper)
yaml=YAML()
yaml.default_flow_style = False
yaml.dump(dict1, yaml_file)

cp_call = "cp " + y_s + " " + logs + "/" + name + ".parameters.txt"
os.system(cp_call)

if(mode == "call"):

# Execute snakemake
snake_stats = logs + "/" + name + ".snakemake_scatter.stats"
snake_log = logs + "/" + name + ".snakemake_scatter.log"

snake_log_out = ""
if not snake_stdout:
snake_log_out = ' &>' + snake_log

snakecmd_scatter = 'snakemake'+snakeclust+' --snakefile ' + script_dir + '/bin/snake/Snakefile.Scatter --cores '+ncores+' --config cfp="' + y_s + '" --stats '+snake_stats + snake_log_out
snakecmd_scatter = 'snakemake'+snakeclust+' --snakefile ' + script_dir + '/bin/snake/Snakefile.Scatter --cores '+ncores+' --config cfp="' + y_s + '"' + snake_log_out
os.system(snakecmd_scatter)

elif(mode == "tenx"):

# Execute snakemake
snake_stats = logs + "/" + name + ".snakemake_tenx.stats"
snake_log = logs + "/" + name + ".snakemake_tenx.log"

snake_log_out = ""
if not snake_stdout:
snake_log_out = ' &>' + snake_log

snakecmd_tenx = 'snakemake'+snakeclust+' --snakefile ' + script_dir + '/bin/snake/Snakefile.tenx --cores '+ncores+' --config cfp="' + y_s + '" --stats '+snake_stats + snake_log_out
snakecmd_tenx = 'snakemake'+snakeclust+' --snakefile ' + script_dir + '/bin/snake/Snakefile.tenx --cores '+ncores+' --config cfp="' + y_s + '"'+ snake_log_out
os.system(snakecmd_tenx)

click.echo(gettime() + "mgatk successfully processed the supplied .bam files", logf)
Expand All @@ -406,17 +406,18 @@ def main(mode, input, output, name, mito_genome, ncores,
'script_dir' : sqs(script_dir)}
y_g = mgatk_directory + "/.internal/parseltongue/snake.gather.yaml"
with open(y_g, 'w') as yaml_file:
yaml.dump(dict2, yaml_file, default_flow_style=False, Dumper=yaml.RoundTripDumper)
yaml=YAML()
yaml.default_flow_style = False
yaml.dump(dict2, yaml_file)

# Snakemake gather
snake_stats = logs + "/" + name + ".snakemake_gather.stats"
snake_log = logs + "/" + name + ".snakemake_gather.log"

snake_log_out = ""
if not snake_stdout:
snake_log_out = ' &>' + snake_log

snakecmd_gather = 'snakemake --snakefile ' + script_dir + '/bin/snake/Snakefile.Gather --cores 1 --config cfp="' + y_g + '" --stats '+snake_stats + snake_log_out
snakecmd_gather = 'snakemake --snakefile ' + script_dir + '/bin/snake/Snakefile.Gather --cores 1 --config cfp="' + y_g + '"' + snake_log_out
os.system(snakecmd_gather)

if(mode == "call" or mode == "tenx"):
Expand Down
6 changes: 4 additions & 2 deletions mgatk/deletioncalling/clidel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pkg_resources import get_distribution
from subprocess import call, check_call
from mgatk.mgatkHelp import *
from ruamel import yaml
from ruamel.yaml import YAML
from ruamel.yaml.scalarstring import SingleQuotedScalarString as sqs
from multiprocessing import Pool

Expand Down Expand Up @@ -158,7 +158,9 @@ def main(input, output, name, mito_chromosome, ncores,

y_s = of + "/.internal/parseltongue/snake.dels.yaml"
with open(y_s, 'w') as yaml_file:
yaml.dump(dict1, yaml_file, default_flow_style=False, Dumper=yaml.RoundTripDumper)
yaml=YAML()
yaml.default_flow_style = False
yaml.dump(dict1, yaml_file)

cp_call = "cp " + y_s + " " + logs + "/" + name + ".parameters_del.txt"
os.system(cp_call)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='mgatk',
version='0.6.9',
version='0.7.0',
url='https://github.com/caleblareau/mgatk',
license='MIT',
author='Caleb Lareau',
Expand Down

0 comments on commit 8ffeac8

Please sign in to comment.