-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrunDenovo.py
53 lines (37 loc) · 1.47 KB
/
runDenovo.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
#!/usr/bin/python
__author__ = "Donghoon Lee"
__copyright__ = "Copyright 2017, Gerstein Lab"
__credits__ = ["Donghoon Lee"]
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "Donghoon Lee"
__email__ = "[email protected]"
###
### Denovo Disruption Score (d-score) Analysis
### For a given peak regions, it will test all three possible variants at each base
###
import argparse, procMotif
### LOAD ARGs ###
parser = argparse.ArgumentParser(description='Calculate TFBS/RBPBS D-score')
parser.add_argument('-n', '--name', help='Name', required=True)
parser.add_argument('-b', '--bed', help='BED File', required=True)
parser.add_argument('-m', '--motif', help='Motif File', required=True)
parser.add_argument('-f', '--format', help='Motif Format (default: jaspar) [Currently supported formats (case is ignored): AlignAce, MEME, MAST, TRANSFAC, pfm, jaspar, sites, ppm]', required=False, default="jaspar")
parser.add_argument('-r', '--ref', help='REF Genome FASTA File', required=True)
args = parser.parse_args()
###
def main():
name = args.name
# getfasta
print "Get FASTA"
procMotif.getFasta(args.ref, args.bed, "BEDFA_"+name+".fa")
print "DONE"
# calculate D-score
print "Calculate D-score"
procMotif.denovoAnalysis(name, args.motif, args.format, "BEDFA_"+name+".fa", "D-SCORE_"+name+".bed")
print "DONE"
# sort & uniq
print "sort & uniq"
procMotif.sortUniq("D-SCORE_"+name+".bed","D-SCORE_"+name+"_uniq.bed")
print "DONE"
main()