-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patho-generate-exclusive-figures
executable file
·39 lines (30 loc) · 1.34 KB
/
o-generate-exclusive-figures
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python
# -*- coding: utf-8
# Copyright (C) 2010 - 2012, A. Murat Eren
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
import os
import sys
import pickle
from Oligotyping.lib.decomposer import Decomposer
from Oligotyping.utils.utils import get_samples_dict_from_environment_file
runinfo = pickle.load(open(sys.argv[1]))
sample_mapping = sys.argv[2]
decomposer = Decomposer()
decomposer.matrix_percent_file_path = runinfo['matrix_percent_file_path']
decomposer.matrix_count_file_path = runinfo['matrix_count_file_path']
decomposer.tmp_directory = runinfo['tmp_directory']
decomposer.output_directory = runinfo['output_directory']
decomposer.figures_directory = os.path.join(os.path.dirname(runinfo['output_directory']), 'FIGURES')
if not os.path.exists(decomposer.tmp_directory):
os.makedirs(decomposer.tmp_directory)
decomposer.sample_mapping = sample_mapping
decomposer._init_logger('exclusive_figures.log')
decomposer.samples_dict = get_samples_dict_from_environment_file(runinfo['environment_file_path'])
decomposer.samples = sorted(decomposer.samples_dict.keys())
decomposer._generate_exclusive_figures()