Spaces:
Running
Running
Commit
·
8d9a296
1
Parent(s):
741ead2
Update code/alphafold_featureVector.py
Browse files
code/alphafold_featureVector.py
CHANGED
@@ -57,6 +57,7 @@ import shutil
|
|
57 |
import streamlit as st
|
58 |
|
59 |
|
|
|
60 |
def run_freesasa(infile, outfile, include_hetatms=True, outdir=None, force_rerun=False, file_type = 'gzip'):
|
61 |
if not outdir:
|
62 |
outdir = ''
|
@@ -697,6 +698,7 @@ def alphafold(input_set, mode, impute):
|
|
697 |
st.write('Calculated')
|
698 |
#calculate_freesasa(uniprotID, mod, existing_free_sasa, alphafold_path, path_to_output_files)
|
699 |
if (mutationPositionOnPDB != 'nan'):
|
|
|
700 |
if (int(mutationPositionOnPDB) <= 1400):
|
701 |
try:
|
702 |
coordMut = get_coords(mutationPositionOnPDB, alignments, coords, resnums_for_sasa, mode)[0]
|
@@ -707,8 +709,30 @@ def alphafold(input_set, mode, impute):
|
|
707 |
coordMut = np.NaN
|
708 |
|
709 |
sasa_pos = get_coords(mutationPositionOnPDB, alignments, coords, resnums_for_sasa, mode)[2]
|
710 |
-
|
711 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
712 |
|
713 |
if sasa_val != None:
|
714 |
uniprot_matched.at[i, 'sasa'] = sasa_val
|
@@ -716,7 +740,7 @@ def alphafold(input_set, mode, impute):
|
|
716 |
coordMut = 'nan'
|
717 |
sasa_val = 'nan'
|
718 |
uniprot_matched.at[i, 'sasa'] = sasa_val
|
719 |
-
|
720 |
domainPositionOnPDB_list = list(
|
721 |
range(int(uniprot_matched.at[i, 'domStart']), int(uniprot_matched.at[i, 'domEnd'])))
|
722 |
domain_distances = []
|
|
|
57 |
import streamlit as st
|
58 |
|
59 |
|
60 |
+
|
61 |
def run_freesasa(infile, outfile, include_hetatms=True, outdir=None, force_rerun=False, file_type = 'gzip'):
|
62 |
if not outdir:
|
63 |
outdir = ''
|
|
|
698 |
st.write('Calculated')
|
699 |
#calculate_freesasa(uniprotID, mod, existing_free_sasa, alphafold_path, path_to_output_files)
|
700 |
if (mutationPositionOnPDB != 'nan'):
|
701 |
+
st.write('Here1')
|
702 |
if (int(mutationPositionOnPDB) <= 1400):
|
703 |
try:
|
704 |
coordMut = get_coords(mutationPositionOnPDB, alignments, coords, resnums_for_sasa, mode)[0]
|
|
|
709 |
coordMut = np.NaN
|
710 |
|
711 |
sasa_pos = get_coords(mutationPositionOnPDB, alignments, coords, resnums_for_sasa, mode)[2]
|
712 |
+
st.write('sasa_pos', sasa_pos)
|
713 |
+
if sasa_pos != np.NaN:
|
714 |
+
sasa = 'nan'
|
715 |
+
for filename in list(Path(path_to_output_files / 'freesasa_files').glob("*")):
|
716 |
+
st.write('xdfkjlxdjf', filename)
|
717 |
+
fname = list(filter(None, str(filename).split('.')))[0].split('/')[-1].split('-')[1].upper()
|
718 |
+
|
719 |
+
if uniprotID == fname:
|
720 |
+
files = open(filename, 'r')
|
721 |
+
file = files.readlines()
|
722 |
+
for k in file:
|
723 |
+
if str(k.strip()[10:13]) == str(sasa_pos):
|
724 |
+
residue = str(k[4:7].strip())
|
725 |
+
if wt == threeToOne(residue):
|
726 |
+
sasa = str(k[22:28]).strip('\n')
|
727 |
+
elif wt != threeToOne(residue):
|
728 |
+
sasa = str(k[22:28]).strip('\n') + '*'
|
729 |
+
else:
|
730 |
+
sasa = 'nan'
|
731 |
+
|
732 |
+
else:
|
733 |
+
sasa = 'nan'
|
734 |
+
#sasa_val = sasa('alphafold', 'nan', uniprotID, sasa_pos, uniprot_matched.at[i, 'wt'], mode,
|
735 |
+
# path_to_output_files, file_type='gzip')
|
736 |
|
737 |
if sasa_val != None:
|
738 |
uniprot_matched.at[i, 'sasa'] = sasa_val
|
|
|
740 |
coordMut = 'nan'
|
741 |
sasa_val = 'nan'
|
742 |
uniprot_matched.at[i, 'sasa'] = sasa_val
|
743 |
+
st.write('IDK')
|
744 |
domainPositionOnPDB_list = list(
|
745 |
range(int(uniprot_matched.at[i, 'domStart']), int(uniprot_matched.at[i, 'domEnd'])))
|
746 |
domain_distances = []
|