-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_chesca.py
33 lines (29 loc) · 1.24 KB
/
run_chesca.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
import cluster
import plots
import svd
import pandas as pd
# This is intended to give the option to run chesca interactively.
# output the dendrogram, svd, chespa (if reference state is available), and input parameters used
# provide option to list the cluster ids you want to remove and run again (with new parameters potentially)
# if pymol (try: pymol -r) and structure is available, automatically generate the clusters
# in the viewer.
run = True
while run == True:
file_path = input('Enter the path to your combined chemical shift file: ')
try:
df = pd.read_csv(file_path)
if df.columns[0].upper() != 'RESI':
print('The index column should be named "RESI".')
else:
index_col = df.columns[0]
df = pd.read_csv(file_path, index_col=index_col)
# TODO - this isn't updating the column name
df.rename(columns={index_col:'RESI'},inplace=True)
except ValueError:
print('Make sure that your index column is named "RESI" in all caps.')
except FileNotFoundError:
print("Can't find that file.")
print(df.head())
# SVD object
dims = svd.SVD(df)
cutoff = input("Enter the correlation coefficient cutoff for agglomerative clustering: ")