MCPcopy Create free account
hub / github.com/RosettaCommons/RFdiffusion / get_seqsep

Function get_seqsep

rfdiffusion/util_module.py:94–107  ·  view source on GitHub ↗

Input: - idx: residue indices of given sequence (B,L) Output: - seqsep: sequence separation feature with sign (B, L, L, 1) Sergey found that having sign in seqsep features helps a little

(idx)

Source from the content-addressed store, hash-verified

92 return RBF
93
94def get_seqsep(idx):
95 '''
96 Input:
97 - idx: residue indices of given sequence (B,L)
98 Output:
99 - seqsep: sequence separation feature with sign (B, L, L, 1)
100 Sergey found that having sign in seqsep features helps a little
101 '''
102 seqsep = idx[:,None,:] - idx[:,:,None]
103 sign = torch.sign(seqsep)
104 neigh = torch.abs(seqsep)
105 neigh[neigh > 1] = 0.0 # if bonded -- 1.0 / else 0.0
106 neigh = sign * neigh
107 return neigh.unsqueeze(-1)
108
109def make_full_graph(xyz, pair, idx, top_k=64, kmin=9):
110 '''

Callers 1

forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected