Spaces:
Running
Running
Commit
·
60c9dfd
1
Parent(s):
7838db7
Update code/alphafold_featureVector.py
Browse files- code/alphafold_featureVector.py +14 -11
code/alphafold_featureVector.py
CHANGED
@@ -29,6 +29,8 @@ from process_input import clean_data
|
|
29 |
from alphafold_model import *
|
30 |
def getModelInfo(uniprotID, varPos, wt, models_we_need, path_to_output_files ):
|
31 |
modelInfo = {}
|
|
|
|
|
32 |
for mod in models_we_need:
|
33 |
try:
|
34 |
pdb_path = hf_hub_download(repo_id="HuBioDataLab/AlphafoldStructures", filename=f"AF-{uniprotID}-F{mod}-model_v4.pdb.gz",repo_type = 'dataset')
|
@@ -201,19 +203,20 @@ def alphafold(input_set, mode, impute):
|
|
201 |
models_for_protein = [val for key, val in model_count.items() if uniprotID in key.split(';')] # We have this many models for the protein.
|
202 |
which_model_mutation = which_model(int(varPos)) # List of models in which the mutation can be found.
|
203 |
models_for_all_annotations = {}
|
204 |
-
for annot in annotation_list: #
|
205 |
models_for_annotations = {} # Recording which position is found in which model file.
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
models_for_that_position = {}
|
211 |
-
for key, val in models_for_that_position.items():
|
212 |
-
if key not in models_for_annotations.keys():
|
213 |
-
models_for_annotations[key] = [val]
|
214 |
else:
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
217 |
# print('models_for_annotations', models_for_annotations)
|
218 |
new_dict = {}
|
219 |
for key, val in models_for_all_annotations.items():
|
|
|
29 |
from alphafold_model import *
|
30 |
def getModelInfo(uniprotID, varPos, wt, models_we_need, path_to_output_files ):
|
31 |
modelInfo = {}
|
32 |
+
st.write(uniprotID)
|
33 |
+
st.write(f"AF-{uniprotID}-F{mod}-model_v4.pdb.gz")
|
34 |
for mod in models_we_need:
|
35 |
try:
|
36 |
pdb_path = hf_hub_download(repo_id="HuBioDataLab/AlphafoldStructures", filename=f"AF-{uniprotID}-F{mod}-model_v4.pdb.gz",repo_type = 'dataset')
|
|
|
203 |
models_for_protein = [val for key, val in model_count.items() if uniprotID in key.split(';')] # We have this many models for the protein.
|
204 |
which_model_mutation = which_model(int(varPos)) # List of models in which the mutation can be found.
|
205 |
models_for_all_annotations = {}
|
206 |
+
for annot in annotation_list: # Needs annots written one by one
|
207 |
models_for_annotations = {} # Recording which position is found in which model file.
|
208 |
+
if data.at[i, annot] != 'hit':
|
209 |
+
for annot_position in ast.literal_eval(data.at[i, annot]):
|
210 |
+
if str(annot_position) != 'nan' and annot_position != '':
|
211 |
+
models_for_that_position = which_model(int(annot_position))
|
|
|
|
|
|
|
|
|
212 |
else:
|
213 |
+
models_for_that_position = {}
|
214 |
+
for key, val in models_for_that_position.items():
|
215 |
+
if key not in models_for_annotations.keys():
|
216 |
+
models_for_annotations[key] = [val]
|
217 |
+
else:
|
218 |
+
models_for_annotations[key] += [val]
|
219 |
+
models_for_all_annotations[annot] = models_for_annotations
|
220 |
# print('models_for_annotations', models_for_annotations)
|
221 |
new_dict = {}
|
222 |
for key, val in models_for_all_annotations.items():
|