MCPcopy Index your code
hub / github.com/DeepGraphLearning/DiffPack / get_chi_mask

Function get_chi_mask

diffpack/rotamer.py:659–671  ·  view source on GitHub ↗
(protein, chi_id=None)

Source from the content-addressed store, hash-verified

657
658
659def get_chi_mask(protein, chi_id=None):
660 chi_atom14_index = chi_atom14_index_map.to(protein.device)[protein.residue_type] # (num_residue, 4, 4) 0~13
661 chi_atom14_mask = chi_atom14_index != -1
662 chi_mask = chi_atom14_mask.all(dim=-1) # (num_residue, 4)
663
664 chi_atom_position = get_chi_atom_position(protein) # (num_residue, 4, 4, 3)
665 has_atom_mask = ~torch.isnan(chi_atom_position).any(dim=-1).any(dim=-1) # (num_residue, 4)
666 chi_mask = chi_mask & has_atom_mask
667
668 if chi_id is not None:
669 chi_mask[:, :chi_id] = False
670 chi_mask[:, chi_id + 1:] = False
671 return chi_mask
672
673
674def get_chis(protein, node_position=None):

Callers 2

get_itemMethod · 0.90
get_chi_periodic_maskFunction · 0.85

Calls 1

get_chi_atom_positionFunction · 0.85

Tested by

no test coverage detected