Calculate the molecular weight.

        :returns: The molecular weight of the current sequence in amu.
        :rtype: float
194472
def mw(self):
        '''

        '''
        counter = collections.Counter(self.seq.lower())
        mw_a = counter['a'] * 313.2
        mw_t = counter['t'] * 304.2
        mw_g = counter['g'] * 289.2
        mw_c = counter['c'] * 329.2
        mw_u = counter['u'] * 306.2

        if self.material == 'dna':
            return mw_a + mw_t + mw_g + mw_c + 79.0
        else:
            return mw_a + mw_u + mw_g + mw_c + 159.0
570768
def decayWeights(self, decayConst=60):
    
    self.weightsII -= self.weightsII*self.dt/decayConst
    self.weightsELI -= self.weightsELI*self.dt/decayConst
    self.weightsERI -= self.weightsERI*self.dt/decayConst
    self.weightsIEL -= self.weightsIEL*self.dt/decayConst
    self.weightsIER -= self.weightsIER*self.dt/decayConst
425782
def value(self):
        

        if self.scores.numel() == 0:
            return 0
        ap = torch.zeros(self.scores.size(1))
        rg = torch.arange(1, self.scores.size(0)).float()

        # compute average precision for each class
        for k in range(self.scores.size(1)):
            # sort scores
            scores = self.scores[:, k]
            targets = self.targets[:, k]

            # compute average precision
            ap[k] = AveragePrecisionMeter.average_precision(scores, targets, self.difficult_examples)
        return ap
563618
def weight2codon(self, weight, length=None):
        
        if length is None:
            length = self.clen
        retval = 0
        weight = min(max(weight + 5.0, 0), 10.0) * (10 ** (length - 1))
        for i in range(length):
            if i == length - 1: # last one
                d = int(round(weight / (10 ** (length - i - 1))))
            else:
                d = int(weight / (10 ** (length - i - 1)))
            weight = weight % (10 ** (length - i - 1))
            retval += d * (10 ** (length - i - 1))
        return ("%0" + str(length) + "d") % retval
334254
def units(self):
        
        self._units, value = self.get_attr_string(self._units, 'units')
        return value
561496
private static double calculateMolecularWeight(List<AbstractMolecule> molecules) throws BuilderMoleculeException, CTKException, ChemistryException {
    Double result = 0.0;
    for (AbstractMolecule molecule : molecules) {
      molecule = BuilderMolecule.mergeRgroups(molecule);
      result += Chemistry.getInstance().getManipulator().getMoleculeInfo(molecule).getMolecularWeight();
    }
    return result;
  }
1231356
def enumValue(self):
        
        try:
            return self.properties.units_state[int(self.lastValue) - 1]
        except IndexError:
            value = "unknown"
        except ValueError:
            value = "NaN"
        return value
752624
def data(self) -> Sequence[Tuple[int, float]]:
        
        return [(num, prob) for num, prob in zip(self._num_cfds_seq,
                                                 self._gnd_state_probs)]
31972
def mol(self):
        
        if self._mol is None:
            apiurl = 'http://www.chemspider.com/MassSpecAPI.asmx/GetRecordMol?csid=%s&calc3d=false&token=%s' % (self.csid,TOKEN)
            response = urlopen(apiurl)
            tree = ET.parse(response)
            self._mol = tree.getroot().text
        return self._mol
141149
def _compute_weights(self):
        

        n = self.n
        k = self.kappa

        self.Wm = np.full(2*n+1, .5 / (n + k))
        self.Wm[0] = k / (n+k)
        self.Wc = self.Wm
546269
def value(self):
        
        if self.buffer:
            return np.mean([ep['l'] for ep in self.buffer])
        else:
            return 0
1022779
def weight(self, context):
        
        lrow, urow = MS.row_extents(context)

        weight = self._manager.ordered_main_table.getcol(
            MS.WEIGHT, startrow=lrow, nrow=urow-lrow)

        # WEIGHT is applied across all channels
        weight = np.repeat(weight, self._manager.channels_per_band, 0)
        return weight.reshape(context.shape).astype(context.dtype)
1016890
def get_total_mass(self):
        
        try:
            mass = self.loc[:, 'mass'].sum()
        except KeyError:
            mass_molecule = self.add_data('mass')
            mass = mass_molecule.loc[:, 'mass'].sum()
        return mass
32699
def calculate_current_value(self):
        
        # must be recursive
        total = Decimal(0)
        for ac in self.classes:
            self.__calculate_current_value(ac)
            total += ac.curr_value
        self.total_amount = total
825101
def getImemb(self):
        """"""
        self.imembPtr.gather(self.imembVec)
        return self.imembVec.as_numpy()
1274979
def value(self):
        
        with self.lock:
            now = time.time()
            dt = now - self.t0
            self.t0 = now
            self.p = self.p * (math.pow(self.e, self.r * dt))
            return self.p
1254270
def getBottomLeft(self):
        
        return (float(self.get_cx()) - float(self.get_r()), float(self.get_cy()) - float(self.get_r()))