void getchain(unsigned short chain_id, Residue *reslist, Residue* &nter, Residue* &cter) { nter = cter = NULL; Residue *res = reslist; while ((res != NULL) && res->chain_id() != chain_id) { res = res->next(); } nter = res; while ((res != NULL) && res->chain_id() == chain_id) { cter = res; res = res->next(); } }
void XMLArchive::WriteField(const Residue &res) { /* write a RESIDUE field */ tags.push_back("Residue"); calc_indent(); char secstr = res.secstr(); // this fixes a wierd bug - if these happen to be 0 - disaster! if (!isalpha(secstr)) { secstr = 'U'; } if (!isalpha(res.name1())) { secstr = 'X'; } f = format("%s<Residue name=\"%s\" type=\"%s\" chain=\"%d\" secstr=\"%c\" confomer=\"%d\" flags=\"%d\" linkage_type=\"%d\" name1=\"%c\" seqpos=\"%d\" >\n", indent, res.name().c_str(), res.type().c_str(), (int)res.chain_id(), secstr, (int)res.confomer(), (int)res.flags(), (int)res.linkage_type(), res.name1(), res.seqpos()); Write(f); inTag++; for (int i = 0; i < res.atomCount(); i++) { WriteField(res.atom(i)); } EndTag(); }
void LSQFitDialog::ListSource() { if (m_source) { Residue *res = m_source->residuesBegin(); QListWidget *list = sourceListWidget; QComboBox *chains = chainsChoice; list->clear(); chains->clear(); int chainid = -9921; while (res != NULL) { if (res->chain_id() != chainid) { chainid = res->chain_id(); char cid = (char) chainid; chains->addItem(QString(cid)); } list->addItem(resid(res).c_str()); res = res->next(); } } }