-
Notifications
You must be signed in to change notification settings - Fork 4
/
analyze_ms_data.py
56 lines (48 loc) · 1.38 KB
/
analyze_ms_data.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
import os
import protease_activity_analysis as paa
import argparse
args = paa.parsing.parse_ms_args()
""" Read data file and create data loader. """
syneos_dataset = paa.syneos.SyneosDataset(
save_dir=args.save_dir, save_name=args.save_name)
syneos_dataset.read_syneos_data(
args.data_path, args.type_path, args.stock_path, args.sheets)
# read plex/reporter file
features, renamed = syneos_dataset.set_feature_mapping(args.plex_path)
# if only want to use a subset of the features to construct the data matrix
if args.features_include != None:
features = args.features_include
""" Process and normalizations. """
syneos_dataset.process_syneos_data(
features,
args.stock,
args.type_include,
args.ID_include,
args.ID_exclude
)
syneos_dataset.mean_scale_matrix()
syneos_dataset.standard_scale_matrix()
# write data to pickle files
syneos_dataset.data_to_pkl(args.save_name)
""" volcano plot """
if args.volcano:
paa.vis.plot_volcano(
syneos_dataset.mean_scaled_matrix,
syneos_dataset.features,
args.group_key,
args.group1,
args.group2,
args.save_dir,
args.save_name
)
""" PCA """
if args.pca:
paa.vis.plot_pca(
syneos_dataset.mean_scaled_matrix,
syneos_dataset.features,
args.group_key,
args.pca_groups,
args.biplot,
args.save_dir,
args.save_name
)