Jacob Gershon commited on
Commit
5337c38
1 Parent(s): 82b9591

added new func

Browse files
Files changed (1) hide show
  1. utils/potentials.py +17 -1
utils/potentials.py CHANGED
@@ -670,6 +670,22 @@ class ChargeBias(Potential):
670
  # print(seq)
671
  return -self.gradients*self.potential_scale
672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
673
 
674
  ### ADD NEW POTENTIALS INTO LIST DOWN BELOW ###
675
- POTENTIALS = {'aa_bias':AACompositionalBias, 'charge':ChargeBias, 'hydrophobic':HydrophobicBias}
 
670
  # print(seq)
671
  return -self.gradients*self.potential_scale
672
 
673
+ class PSSMbias(Potential):
674
+
675
+ def __init__(self, args, features, potential_scale, DEVICE):
676
+
677
+ self.features = features
678
+ self.args = args
679
+ self.potential_scale = potential_scale
680
+ self.DEVICE = DEVICE
681
+ self.PSSM = np.loadtxt(args['PSSM'], delimiter=",", dtype=float)
682
+ self.PSSM = torch.from_numpy(self.PSSM).to(self.DEVICE)
683
+
684
+ def get_gradients(self, seq):
685
+ print(seq.shape)
686
+
687
+
688
+ return self.PSSM*self.potential_scale
689
 
690
  ### ADD NEW POTENTIALS INTO LIST DOWN BELOW ###
691
+ POTENTIALS = {'aa_bias':AACompositionalBias, 'charge':ChargeBias, 'hydrophobic':HydrophobicBias, 'PSSM':PSSMbias}