-
Notifications
You must be signed in to change notification settings - Fork 4
/
run_meth.py
92 lines (72 loc) · 2.4 KB
/
run_meth.py
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
#-*- coding:utf-8 -*-
from __future__ import division
import re,sys,os
import cPickle as pickle
import numpy as np
from optparse import OptionParser
import MethGC.frame.module01_mapping_from_raw as m01
import MethGC.frame.module02_chromatinNetwork2 as m02
import MethGC.utils.module_create_database as m_db
def prepare_optparser():
usage ="""usage: %s [options] sample_input_information_xls
Reference fasta file and refGene file should be all put in dictionary
self.Database, which were defined in settings/projpath.py
If not put in self.Database, this program will downloading from UCSC.
Detail information could be reached in utils/module_create_database.py
Suport genome includes:
http://hgdownload.soe.ucsc.edu/goldenPath
Using -h or --help for more information
Example:
python %s --ref hg19 --cutSites GCA.GCC.GCT,ACG.TCG samp_test.xls
""" % (sys.argv[0],sys.argv[0])
description = " NOM-seq analysis pipeline "
optparser = OptionParser(
version="%s v0.1 2015.7" % (sys.argv[0]),
description=description,
usage=usage,
add_help_option=False
)
optparser.add_option(
"-r", "--ref", default="hg19",
help="\nReference genome. [default: %default]"
)
optparser.add_option(
"-c", "--cutSites", default="GCA.GCC.GCT,ACG.TCG",
help="\nMethylation sites. [default: %default]"
)
return optparser
def main():
prepare_optparser()
(options,args) = prepare_optparser().parse_args()
try:
sam_Info = args[0]
ref = options.ref
l_cut_sites= options.cutSites.split(",")
except IndexError:
prepare_optparser().print_help()
sys.exit(1)
# part0 = m_db.DataBaseInit(ref, sam_Info, is_debug = 0)
# part0.check_files(l_cut_sites)
part1 = m01.MapFromRaw(ref, sam_Info, l_cut_sites, is_debug = 0)
Depth_Pos = 3
part1.s01_Trim()
part1.s02_Bismark()
part1.s03_Bam2SingleC()
part1.s04_statMeth(Depth_Pos)
part1.s05_NDR()
part1.s06_merge_singleC()
part1.s07_mergeSample(Depth_Pos)
part1.s08_plotDist()
part1.s09_NDR_IGV()
part1.s10_NDR_flanking()
part1.s11_NDR_motif()
Depth_Pos = 1
part1.s01_Trim()
part1.s02_Bismark()
part1.s03_Bam2SingleC()
part1.s04_statMeth(Depth_Pos)
part1.s05_NDR()
part1.s06_merge_singleC()
part1.s07_mergeSample(Depth_Pos)
if __name__ == '__main__':
main()