From 4bab15c684ea049c55825f795d47f02ac7d57358 Mon Sep 17 00:00:00 2001 From: Luca Santuari <25436836+lsantuari@users.noreply.github.com> Date: Thu, 10 Feb 2022 16:01:10 +0100 Subject: [PATCH] #95: add predict.py with helpers functions --- svchannels/model_functions.py | 1 - svchannels/predict.py | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/svchannels/model_functions.py b/svchannels/model_functions.py index 8a97fdd0..a75433cb 100644 --- a/svchannels/model_functions.py +++ b/svchannels/model_functions.py @@ -40,7 +40,6 @@ def filter_labels(X, y, win_ids): with gzip.GzipFile(l, 'r') as fin: labels = json.loads(fin.read().decode('utf-8')) - labels = labels.item() y.extend(labels.values()) win_ids.extend(labels.keys()) logging.info('Data from {} loaded'.format(t)) diff --git a/svchannels/predict.py b/svchannels/predict.py index 738789c6..824d9a20 100644 --- a/svchannels/predict.py +++ b/svchannels/predict.py @@ -53,7 +53,7 @@ def main(): default='sv_chan.zarr', help="Specify list of windows" ) - parser.add_argument('-i', + parser.add_argument('-lab', '--labels', type=str, default='labels/labels.json.gz', @@ -90,6 +90,11 @@ def main(): type=str, default='results', help="Output folder") + parser.add_argument('-svc', + '--sv_channels', + type=str, + default='sv_channels', + help="Output folder") args = parser.parse_args() mapclasses = {args.svtype: 0, 'no' + args.svtype: 1} # Parameters @@ -101,8 +106,8 @@ def main(): windows_list = args.input.split(',') labels_list = args.labels.split(',') predict(windows_list, labels_list, args.sample_name, args.svtype, - args.model, args.model_name, os.path.join(args.output, args.svtype)) - out_prefix = os.path.join(args.output, "sv-channels") + args.model, args.model_name, args.output) + out_prefix = args.sv_channels merge_sv_calls = ' '.join([ "cd ../R; " "Rscript merge_sv_calls.R",