Set amino acid change and position.
161895
def set_amino_acid(self, aa):
        """"""
        aa = aa.upper()  # make sure it is upper case
        aa = aa[2:] if aa.startswith('P.') else aa  # strip "p."
        self.__set_mutation_status()  # set flags detailing the type of mutation
        self.__parse_hgvs_syntax(aa)
245706
def parseFullScan(self, i, modifications=False):
        
        scanObj = PeptideObject()
        peptide = str(i[1])
        pid=i[2]
        scanObj.acc = self.protein_map.get(i[4], i[4])
        if pid is None:
            return None
        if modifications:
            sql = 'select aam.ModificationName,pam.Position,aam.DeltaMass from peptidesaminoacidmodifications pam left join aminoacidmodifications aam on (aam.AminoAcidModificationID=pam.AminoAcidModificationID) where pam.PeptideID=%s'%pid
            for row in self.conn.execute(sql):
                scanObj.addModification(peptide[row[1]], str(row[1]), str(row[2]), row[0])
        else:
            mods = self.mods.get(int(pid))
            if mods is not None:
                for modId, modPosition in zip(mods[0].split(','),mods[1].split(',')):
                    modEntry = self.modTable[str(modId)]
                    scanObj.addModification(peptide[int(modPosition)], modPosition, modEntry[1], modEntry[0])
            tmods = self.tmods.get(int(pid))
            if tmods is not None:
                for modIds in tmods:
                    for modId in modIds.split(','):
                        modEntry = self.modTable[str(modId)]
                        scanObj.addModification('[', 0, modEntry[1], modEntry[0])
        scanObj.peptide = peptide
        if self.decompressScanInfo(scanObj, i[0]):
            return scanObj
        return None
143655
def change_octave(self, diff):
        """"""
        self.octave += diff
        if self.octave < 0:
            self.octave = 0
250309
def _assemble_transphosphorylation(self, stmt):
        """"""
        # Check our assumptions about the bound condition of the enzyme
        assert len(stmt.enz.bound_conditions) == 1
        assert stmt.enz.bound_conditions[0].is_bound
        # Create a modified protein node for the bound target
        sub_agent = deepcopy(stmt.enz.bound_conditions[0].agent)
        sub_agent.mods.append(stmt._get_mod_condition())
        self._add_nodes_edges(stmt.enz, sub_agent, pc.DIRECTLY_INCREASES,
                              stmt.evidence)
214272
def set_instrument(self, channel, instr, bank=1):
        """"""
        self.track_data += self.select_bank(channel, bank)
        self.track_data += self.program_change_event(channel, instr)
24452
def t(self, value):
        """"""
        assert (isinstance(value, scipy.ndarray) and (value.dtype ==
                'float') and (value.shape == self.t.shape))
        if (self._t != value).any():
            self._t = value.copy()
            self._updateInternals()
413107
def set_position(self, decl_pos):
        """"""
        if decl_pos["typehint"] == "LineSourcePosition":
            self.editor.set_cursor(decl_pos['line'], 0)
        else:  # OffsetSourcePosition
            point = decl_pos["offset"]
            row, col = self.editor.point2pos(point + 1)
            self.editor.set_cursor(row, col)
290039
def _update_pi_vars(self):
        """"""
        with scipy.errstate(divide='raise', under='raise', over='raise',
                invalid='raise'):
            for r in range(self.nsites):
                self.pi_codon[r] = self.pi[r][CODON_TO_AA]
                pim = scipy.tile(self.pi_codon[r], (N_CODON, 1)) # [x][y] is piAy
                self.piAx_piAy[r] = pim.transpose() / pim
            self.ln_pi_codon = scipy.log(self.pi_codon)
            self.piAx_piAy_beta = self.piAx_piAy**self.beta
            self.ln_piAx_piAy_beta = scipy.log(self.piAx_piAy_beta)
805736
def update_cursor_position(self, line, index):
        """"""
        value = 'Line {}, Col {}'.format(line + 1, index + 1)
        self.set_value(value)
604244
def set(self, r, g, b, intensity=None):
        """"""
        self.r = r
        self.g = g
        self.b = b
        if intensity:
            self.intensity = intensity
1221741
public void setPosition (float x, float y, float z)
    {
        if (_px != x || _py != y || _pz != z) {
            AL10.alSource3f(_id, AL10.AL_POSITION, _px = x, _py = y, _pz = z);
        }
    }
843182
def _update_Pxy(self):
        """"""
        scipy.copyto(self.Pxy_no_omega, self.Phi_x.transpose(),
                where=CODON_SINGLEMUT)
        self.Pxy_no_omega[0][CODON_TRANSITION] *= self.kappa
        self.Pxy = self.Pxy_no_omega.copy()
        self.Pxy[0][CODON_NONSYN] *= self.omega
        _fill_diagonals(self.Pxy, self._diag_indices)
976514
def _set(self, pos):
        """"""
        assert 0 <= pos < self.len
        self._datastore.setbit(pos)
1366423
@Override
    public void setAtom(IAtom atom, int position) {
        if (atoms[position] == null && atom != null) atomCount++;
        if (atoms[position] != null && atom == null) atomCount--;
        atoms[position] = atom;
    }
1110160
def set(self, value, start=None, stop=None):
		""""""
		_check_start_stop(start, stop)
		# start_index, stop_index will denote the sections we are replacing
		start_index = self._bisect_left(start)
		if start is not None:  # start_index == 0
			prev_value = self._values[start_index - 1]
			if prev_value == value:
				# We're setting a range where the left range has the same
				# value, so create one big range
				start_index -= 1
				start = self._keys[start_index]
		if stop is None:
			new_keys = [start]
			new_values = [value]
			stop_index = len(self._keys)
		else:
			stop_index = self._bisect_right(stop)
			stop_value = self._values[stop_index - 1]
			stop_key = self._keys[stop_index - 1]
			if stop_key == stop and stop_value == value:
				new_keys = [start]
				new_values = [value]
			else:
				new_keys = [start, stop]
				new_values = [value, stop_value]
		self._keys[start_index:stop_index] = new_keys
		self._values[start_index:stop_index] = new_values
822285
def _on_change(self):
        """"""
        font = self.__generate_font_tuple()
        self._example_label.configure(font=font)
1221705
def set_text(self, text):
        """"""
        text = text.strip()
        new_text = self.text() + text
        self.setText(new_text)