Skip to content

Commit 8d039ae

Browse files
committed
add index correction
1 parent 121e191 commit 8d039ae

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

EnQA.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import numpy as np
66

77
from data.loader import expand_sh
8+
from data.process_label import parse_pdbfile
89
from feature import create_basic_features, get_base2d_feature
910
from data.process_alphafold import process_alphafold_target_ensemble, process_alphafold_model
1011
from network.resEGNN import resEGNN, resEGNN_with_mask, resEGNN_with_ne
@@ -22,7 +23,7 @@
2223
help='Path to alphafold prediction results.')
2324
parser.add_argument('--alphafold_feature_cache', type=str, required=False, default='')
2425
parser.add_argument('--af2_pdb', type=str, required=False, default='',
25-
help='Optional. PDBs from AlphaFold2 predcition for index correction with input pdb')
26+
help='Optional. PDBs from AlphaFold2 predcition for index correction with input pdb. Must contain all residues in input pdb.')
2627

2728
args = parser.parse_args()
2829
if args.alphafold_feature_cache == '':
@@ -65,6 +66,17 @@
6566
if args.alphafold_feature_cache is not None:
6667
pickle.dump({'plddt': plddt, 'cmap': cmap, 'dict_2d': dict_2d},
6768
open(args.alphafold_prediction_cache, 'wb'))
69+
if args.af2_pdb != '':
70+
pose_input = parse_pdbfile(args.input)
71+
input_idx = np.array([i['rindex'] for i in pose_input])
72+
pose_af2 = parse_pdbfile(args.af2_pdb)
73+
af2_idx = np.array([i['rindex'] for i in pose_af2])
74+
mask = af2_idx in input_idx
75+
af2_qa = af2_qa[:, mask]
76+
plddt = plddt[:, mask]
77+
cmap = cmap[:, mask][mask, :]
78+
for f2d_type in dict_2d.keys():
79+
dict_2d[f2d_type] = dict_2d[f2d_type][:, :, mask][:, mask, :]
6880
else:
6981
dict_2d['f2d_dan'] = get_base2d_feature(args.input, args.output)
7082
with torch.no_grad():

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,15 @@ Also, there are [binaries](https://gitlab.inria.fr/GruLab/s-gcn/-/tree/master/#s
6565
## Generating AlphaFold2 models for assisted quality assessment
6666

6767
For generating models using AlphaFold2, an installation of AlphaFold2 following its [Official Repo](https://github.com/deepmind/alphafold) is required. For our experiments, we use its original model used at CASP14 with no ensembling (--model_preset=monomer), with all genetic databases used at CASP14 (--db_preset=full_dbs), and restricts templates only to structures that were available at the start of CASP14 (--max_template_date=2020-05-14).
68+
69+
## Quick configuration
70+
71+
```
72+
pip install biopandas biopython scipy torch==1.10.1
73+
pip install dgl-cu113 -f https://data.dgl.ai/wheels/repo.html
74+
pip install packaging wandb line_profiler
75+
pip install git+https://github.com/AMLab-Amsterdam/lie_learn
76+
git clone https://github.com/FabianFuchsML/se3-transformer-public.git
77+
cd se3-transformer-public
78+
pip install -e .
79+
```

0 commit comments

Comments
 (0)