-
Venkat Malladi authoredaff20266
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Forked from
Venkat Malladi / TFSEE
50 commits behind the upstream repository.
cutoff_analysis.py 1.63 KiB
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
#!/usr/bin/env python
# -*- coding: latin-1 -*-
'''Take an TSV file make a plot graph'''
EPILOG = '''
For more details:
%(prog)s --help
'''
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import argparse
import seaborn as sns
def get_args():
parser = argparse.ArgumentParser(
description=__doc__, epilog=EPILOG,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument('-r', '--rpkm',
help="The file with RPKM values.",
required = True)
parser.add_argument('-c','--color',
help="The hex color to make the graph",
required = True)
parser.add_argument('-f','--factor',
help="Factor that is being analyzed.",
required = True)
parser.add_argument('-l','--limit',
help="The RPKM limit to plot",
type=int,
required = True)
args = parser.parse_args()
return args
def main():
sns.set_style("white")
sns.set_style("ticks")
args = get_args()
rpkm_file = pd.read_csv(args.rpkm, sep='\t')
locations = np.array(rpkm_file['ES_D0'])
locations = np.append(locations, np.array(rpkm_file['ES_D2']))
locations = np.append(locations, np.array(rpkm_file['ES_D5']))
locations = np.append(locations, np.array(rpkm_file['ES_D7']))
locations = np.append(locations, np.array(rpkm_file['ES_D10']))
sns.kdeplot(np.log2(locations[locations !=0 ] + 0.00001),color=args.color)
sns.despine()
plt.axvline(np.log2(args.limit), color='black', linestyle='dashed', linewidth=1)
plt.savefig(args.factor + '_distribution.png')
plt.clf()
if __name__ == '__main__':
main()