Skip to content
Snippets Groups Projects
Commit 08ee672e authored by Augustin Zidek's avatar Augustin Zidek
Browse files

Silence redundant warnings and report missing templates

PiperOrigin-RevId: 697637011
parent 83c4be2e
No related branches found
No related tags found
1 merge request!1Cloned AlphaFold 3 repo into this one
......@@ -696,6 +696,7 @@ def _parse_hit_metadata(
try:
cif = mmcif.from_string(structure_store.get_mmcif_str(pdb_id))
except structure_stores.NotFoundError:
logging.warning('Failed to get mmCIF for %s.', pdb_id)
return None, None, None
release_date = mmcif.get_release_date(cif)
......
......@@ -525,9 +525,12 @@ def pae_metrics(
ichain, xchain_row_agg = inner(False)
_, xchain_col_agg = inner(True)
xchain = np.nanmean(
np.stack([xchain_row_agg, xchain_col_agg], axis=0), axis=0
)
with warnings.catch_warnings():
# Mean of empty slice is ok and should return a NaN.
warnings.filterwarnings(action='ignore', message='Mean of empty slice')
xchain = np.nanmean(
np.stack([xchain_row_agg, xchain_col_agg], axis=0), axis=0
)
return ichain, xchain
pae_ichain, pae_xchain = reduce_chain_pair_fn(chain_pair_contact_weighted)
......@@ -551,7 +554,13 @@ def get_iptm_xchain(chain_pair_iptm: np.ndarray) -> np.ndarray:
weight -= np.eye(num_chains, dtype=float)
xchain_row_agg = weighted_nanmean(chain_pair_iptm, mask=weight, axis=-2)
xchain_col_agg = weighted_nanmean(chain_pair_iptm, mask=weight, axis=-1)
return np.nanmean(np.stack([xchain_row_agg, xchain_col_agg], axis=0), axis=0)
with warnings.catch_warnings():
# Mean of empty slice is ok and should return a NaN.
warnings.filterwarnings(action='ignore', message='Mean of empty slice')
iptm_xchain = np.nanmean(
np.stack([xchain_row_agg, xchain_col_agg], axis=0), axis=0
)
return iptm_xchain
def predicted_tm_score(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment