Skip to content

Commit

Permalink
#95: add predict.py with helpers functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lsantuari committed Feb 10, 2022
1 parent 0f0ebaa commit 4bab15c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion svchannels/model_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
11 changes: 8 additions & 3 deletions svchannels/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand All @@ -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",
Expand Down

0 comments on commit 4bab15c

Please sign in to comment.