Spaces:
Sleeping
Sleeping
Commit
•
7d03af3
1
Parent(s):
b17699d
Update code/process_input.py
Browse files- code/process_input.py +2 -0
code/process_input.py
CHANGED
@@ -10,6 +10,7 @@ def clean_data(input_set):
|
|
10 |
for i in input_set:
|
11 |
data = data.append(pd.Series([j.strip() for j in i.split('-')]), ignore_index=True)
|
12 |
data.columns = ['uniprotID', 'wt', 'pos', 'mut']
|
|
|
13 |
if initial_len != len(data):
|
14 |
st.write(f'{initial_len- len(data)} of {initial_len} datapoints is omitted. Check your input.')
|
15 |
elif '\t' in input_set:
|
@@ -19,6 +20,7 @@ def clean_data(input_set):
|
|
19 |
for i in input_set:
|
20 |
data = data.append(pd.Series([j.strip() for j in i.split('-')]), ignore_index=True)
|
21 |
data.columns = ['uniprotID', 'wt', 'pos', 'mut']
|
|
|
22 |
if initial_len != len(data):
|
23 |
st.write(f'{initial_len- len(data)} of {initial_len} datapoints is omitted. Check your input.')
|
24 |
elif '-' in input_set:
|
|
|
10 |
for i in input_set:
|
11 |
data = data.append(pd.Series([j.strip() for j in i.split('-')]), ignore_index=True)
|
12 |
data.columns = ['uniprotID', 'wt', 'pos', 'mut']
|
13 |
+
data = data[((~data.uniprotID.isna()) & (~data.wt.isna()) & (~data.pos.isna()) & (~data.mut.isna()))]
|
14 |
if initial_len != len(data):
|
15 |
st.write(f'{initial_len- len(data)} of {initial_len} datapoints is omitted. Check your input.')
|
16 |
elif '\t' in input_set:
|
|
|
20 |
for i in input_set:
|
21 |
data = data.append(pd.Series([j.strip() for j in i.split('-')]), ignore_index=True)
|
22 |
data.columns = ['uniprotID', 'wt', 'pos', 'mut']
|
23 |
+
data = data[((~data.uniprotID.isna()) & (~data.wt.isna()) & (~data.pos.isna()) & (~data.mut.isna()))]
|
24 |
if initial_len != len(data):
|
25 |
st.write(f'{initial_len- len(data)} of {initial_len} datapoints is omitted. Check your input.')
|
26 |
elif '-' in input_set:
|