-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPSSP
122 lines (101 loc) · 5.21 KB
/
PSSP
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env python
'''
# =============================================================================
# FileName: PSSP
# Author: Chu Yanshuo
# Email: [email protected]
# HomePage: http://yanshuo.name
# Version: 0.0.1
# LastChange: 2017-04-10 16:50:28
# History: Author : Andrew Roth
# =============================================================================
'''
import argparse
from mixclone.PSSP.run import run_dp_model
from mixclone.preprocess.run_preprocess import run_preprocess_MixClone
parser = argparse.ArgumentParser(prog='PSSP')
parser.add_argument('--version', action='version', version='PSSP-0.0.0')
subparsers = parser.add_subparsers()
# -------------------------------------------------------------------------
analyse_parser = subparsers.add_parser(
'analyse', help='''Start a new PSSP analysis.''')
analyse_parser.add_argument(
'inputFilePath',
help='Path to tab separated input file. See examples for format.')
analyse_parser.add_argument(
'out_dir',
help='Path where trace file for MCMC sampler will be written.')
analyse_parser.add_argument(
'--num_iters', default=10000, type=int,
help='''How many iterations of the MCMC chain will run. Default 10,000.''')
analyse_parser.add_argument(
'--concentration', default=None, type=int,
help='''Concentration (alpha) value for DP sampler. If not set it will be
estimated. Default estimated.''')
analyse_parser.add_argument(
'--concentration_prior_shape', default=1, type=float,
help='''Prior on the shape parameter in the prior for the concentration
parameter. Default 1.''')
analyse_parser.add_argument(
'--concentration_prior_rate', default=1, type=float,
help='''Prior on the rate parameter in the prior for the concentration
parameter. Default 1.''')
analyse_parser.set_defaults(func=run_dp_model)
args = parser.parse_args()
args.func(args)
# ==============================================================================
# Add MixClone type
# ==============================================================================
parser_MixClone = subparsers.add_parser('MixClone',
help='''Out put MixClone format''')
parser_MixClone.add_argument('normal_bam',
help='''BAM file for normal sample.''')
parser_MixClone.add_argument('tumor_bam',
help='''BAM file for tumor sample.''')
parser_MixClone.add_argument('reference_genome',
help='''FASTA file for reference genome.''')
parser_MixClone.add_argument('input_filename_base',
help='''Base name of the preprocessed input
file to be created.''')
parser_MixClone.add_argument('segments_bed',
help='''BED file for segments.''')
parser_MixClone.add_argument(
'BICseq_bed_corrected',
help='''The name of corrected BICseq result file''')
parser_MixClone.add_argument('--pkl_path',
help='''Load the pkl path''')
parser_MixClone.add_argument('--max_copynumber', default=6, type=int,
help='''Set the maximum copy number''')
parser_MixClone.add_argument('--subclone_num', default=2, type=int,
help='''Set the subclone number''')
parser_MixClone.add_argument('--baseline_thred_LOH', default=0.16, type=float,
help='''The threshold of LOH sites fraction
within each segment to
define the segment is LOH, the range is
[baseline_thred_LOH, 1]. Default is
0.16.''')
parser_MixClone.add_argument('--baseline_thred_APM',
default=0.2, type=float,
help='''The threshold of average P and M SNP sites
fraction within each segment to
define the segment as baseline, the range is
[baseline_thred_APM, 1]. Default is
0.2.''')
parser_MixClone.add_argument('--pkl_flag', default=False, type=bool,
help='''The pkl flag''')
parser_MixClone.add_argument('--min_depth', default=20, type=int,
help='''Minimum reads depth required for both
normal and tumor samples. Default is 20.''')
parser_MixClone.add_argument('--min_base_qual', default=10, type=int,
help='''Minimum base quality required.
Default is 10.''')
parser_MixClone.add_argument('--min_map_qual', default=10, type=int,
help='''Minimum mapping quality required.
Default is 10.''')
parser_MixClone.add_argument('--process_num', default=1, type=int,
help='''Number of processes to launch for
preprocessing. Default is 1.''')
parser_MixClone.add_argument('--gc_correction_method', default="auto",
help='''The gc correction method, one of auto and
visual''')
parser_MixClone.set_defaults(func=run_preprocess_MixClone)