def read_range(self): condition = self.condition_menu.condition() residue_range = (pyutil.string_to_int(self.range_variables[0].get()), pyutil.string_to_int(self.range_variables[1].get())) if residue_range[0] == None or residue_range[1] == None: self.progress_report('Must select residue range.') return 0 reslist = self.range_resonances(condition, residue_range) if len(reslist) == 0: self.progress_report('No residues in selected range.') return 0 seq = sequence.molecule_sequence(condition.molecule) if seq == None: self.progress_report('Molecule sequence unknown.') return 0 self.residue_range = residue_range self.resonances = reslist self.sequence = seq return 1
def read_range(self): condition = self.condition_menu.condition() residue_range = (pyutil.string_to_int(self.range_variables[0].get()), pyutil.string_to_int(self.range_variables[1].get())) if residue_range[0] == None or residue_range[1] == None: self.progress_report('Must select residue range.') return 0 reslist = self.range_resonances(condition, residue_range) if len(reslist) == 0: self.progress_report('No residues in selected range.') return 0 seq = sequence.molecule_sequence(condition.molecule) if seq == None: self.progress_report('Molecule sequence unknown.') return 0 self.residue_range = residue_range self.resonances = reslist self.sequence = seq # Compute global ncIDP-based random coil chemical shifts self.RC_prediction = shiftstats_ncIDP.resonance_statistics(reslist) return 1
def write_spectrum_table(self, asys, molecule, tolerances, temp_directory): table_path = os.path.join(temp_directory, 'table.aat') f = open(table_path, 'w') f.write('#\n' + '# %s table file for AutoAssign\n' % molecule.name + '#\n') f.write('Protein: %s\n' % molecule.name) f.write('\n') seq = sequence.molecule_sequence(molecule) f.write('Sequence: %d %s*\n' % (seq.first_residue_number, seq.one_letter_codes)) f.write('\n') toltext = '' for atom_name in ('HN', 'N15', 'CA', 'CB', 'HA', 'CO'): toltext = toltext + ' %s %.3f' % (atom_name, tolerances[atom_name]) f.write('Tolerances: %s\n' % toltext) f.write('\n') f.write('Spectra:\n') for asp in asys.assignable_spectra: self.write_spectrum_table_entry(asp, f) f.write('$\n') f.close()
def single_resonance_statistics(r): """ Compute global, sequence-specific ncIDP-based chemical shifts using resonance list """ seq = sequence.molecule_sequence(r.condition.molecule).one_letter_codes path = get_sparky_home()+'/Python' prediction = compute_RC(path+'/ncIDP-cs.tab', path+'/ncIDP-dev.tab', seq) return prediction
def assignable_spectrum_from_pattern(spectrum, tolerances, pattern_name, pattern_axes, stoppable): remember_pattern(spectrum, pattern_name, pattern_axes) seq = sequence.molecule_sequence(spectrum.molecule) pattern_list = expected_peak_descriptions[pattern_name] epeaks = [] for pat in pattern_list: stoppable.progress_report(pattern_name + ' pattern ' + pat) patpeaks = expected_peaks_from_pattern(pat, pattern_axes, seq) epeaks = epeaks + patpeaks asp = assignable_spectrum(spectrum, seq, epeaks, tolerances) asp.expected_peak_pattern_name = pattern_name asp.pattern_axis_order = pattern_axes return asp