-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathD3EAnalysis.py
65 lines (46 loc) · 1.35 KB
/
D3EAnalysis.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
'''
D3E-Cmd
Discrete Distributional Differential Expression Command Line Tool
Author: Mihails Delmans ([email protected])
Advisor: Martin Hemberg ([email protected])
Version: 1.0
Tested with:
scipy 0.15.1
numpy 1.8.0rc1
sympy.mpmath 0.18
Copyright 2015 Mihails Delmans, Martin Hemberg
This file is part of D3E.
D3E 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 3 of the License, or
(at your option) any later version.
D3E is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D3E. If not, see <http://www.gnu.org/licenses/>.
'''
import sys
tFileName = sys.argv[1]
cFileName = sys.argv[2]
oFileName = sys.argv[3]
k = float(sys.argv[4])
cFile = open(cFileName)
cFile.readline()
cFile.readline()
pMin = float('Inf')
for line in cFile:
p = float(line.split()[21])
if p < pMin:
pMin = p
tFile = open(tFileName)
oFile = open(oFileName,'w')
h = tFile.readline()
tFile.readline()
oFile.write(h + '\n')
for line in tFile:
tabs = line.split()
p = float(tabs[21])
if p < pMin * k:
oFile.write(line)