/*************************************************************************** pdbsegment.cpp - description ------------------- begin : Sun Jun 2 22:47:19 2002 copyright : (C) 2002 by Cavalli Andrea email : cavalli@bioc.unizh.ch **************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include using namespace Almost; PDBSegment::PDBSegment(const PDBSegment & segment){ _name = segment._name; _chainID = segment._chainID; for(size_t i=0;ifragment.size())) { cout<<"\t>> Wrong PDBSegment boudarries\n"; return res; } for(int i=b-1;i tags; bool dup = false; for(int i=0; ifragSeq())!=tags.end()){ dup = true; break; } else tags.insert(fragment[i]->fragSeq()); } if(!dup) return; int b = fragment[0]->fragSeq(); if(size()==1) return; int msg = 0; for(int i=1; ifragSeq()!=i+b){ if(msg<5){ cout<<"Warning renumbering fragment "<fragSeq()<<" to " <set_fragSeq(b+i); } } } void swap__frag(PDBFragment & frag, string a1, string a2){ int ipos=-1,jpos=-1; for(int i=0;i-1)&&(jpos>-1)){ string t = frag[ipos].name; frag[ipos].name = frag[jpos].name; frag[jpos].name = t; } } void PDBSegment::swap_atom(string r1, string a1, string a2){ bool num = false; PDBSegment & seg = *this; if(r1.find("_")!=string::npos) num = 1; for(int i=0;i PDBSegment::sequence(int TYPE) const { vector sVect; if(TYPE==LONG){ for(int i=0;iname().c_str(), fragment[i]->fragSeq()); sVect.push_back(buff); } } else if(TYPE==ICODE){ for(int i=0;iname().c_str(), fragment[i]->fragSeq()); string b = buff; if(fragment[i]->iCode()!=' ') b += fragment[i]->iCode(); sVect.push_back(b); } } else { for(int i=0;iname()); } return sVect; }