- for (int sp, m = 0; m < mapping.length; m++)
- {
- final SequenceI theSequence = getSequence()[pdbfnum][s];
- if (mapping[m].getSequence() == theSequence
- && (sp = alignment.findIndex(theSequence)) > -1)
- {
- if (refStructure == -1)
- {
- refStructure = pdbfnum;
- }
- SequenceI asp = alignment.getSequenceAt(sp);
- for (int r = 0; r < matched.length; r++)
- {
- if (!matched[r])
- {
- continue;
- }
- matched[r] = false; // assume this is not a good site
- if (r >= asp.getLength())
- {
- continue;
- }
-
- if (Comparison.isGap(asp.getCharAt(r)))
- {
- // no mapping to gaps in sequence
- continue;
- }
- int t = asp.findPosition(r); // sequence position
- int apos = mapping[m].getAtomNum(t);
- int pos = mapping[m].getPDBResNum(t);
-
- if (pos < 1 || pos == lastPos)
- {
- // can't align unmapped sequence
- continue;
- }
- matched[r] = true; // this is a good ite
- lastPos = pos;
- // just record this residue position
- commonrpositions[pdbfnum][r] = pos;
- }
- // create model selection suffix
- isel[pdbfnum] = "#" + pdbfnum;
- if (mapping[m].getChain() == null
- || mapping[m].getChain().trim().length() == 0)
- {
- targetC[pdbfnum] = "";
- }
- else
- {
- targetC[pdbfnum] = "." + mapping[m].getChain();
- }
- chainNames[pdbfnum] = mapping[m].getPdbId()
- + targetC[pdbfnum];
- atomSpec[pdbfnum] = asp.getRNA() != null ? PHOSPHORUS : ALPHACARBON;
- // move on to next pdb file
- s = seqCountForPdbFile;
- break;
- }
- }