* @param ssm
* @param pdbentry
* @param sequenceIs
- * @param chains
* @param protocol
*/
public AAStructureBindingModel(StructureSelectionManager ssm,
this.nucleotide = Comparison.isNucleotide(sequenceIs);
this.pdbEntry = pdbentry;
this.protocol = protocol;
+ resolveChains();
}
+ private boolean resolveChains()
+ {
+ /**
+ * final count of chain mappings discovered
+ */
+ int chainmaps = 0;
+ String[][] newchains = new String[pdbEntry.length][];
+ int pe = 0;
+ for (PDBEntry pdb : pdbEntry)
+ {
+ SequenceI[] seqsForPdb = sequence[pe];
+ if (seqsForPdb != null)
+ {
+ newchains[pe] = new String[seqsForPdb.length];
+ int se = 0;
+ for (SequenceI asq : seqsForPdb)
+ {
+ String chain = (chains != null && chains[pe] != null)
+ ? chains[pe][se]
+ : null;
+ SequenceI sq = asq.getDatasetSequence();
+ if (sq.getAllPDBEntries() != null)
+ {
+ for (PDBEntry pdbentry : sq.getAllPDBEntries())
+ {
+ if (pdb.getFile() != null && pdbentry.getFile() != null
+ && pdb.getFile().equals(pdbentry.getFile()))
+ {
+ String chaincode = pdbentry.getChainCode();
+ if (chaincode != null && chaincode.length() > 0)
+ {
+ chain = chaincode;
+ chainmaps++;
+ break;
+ }
+ }
+ }
+ }
+ newchains[pe][se] = chain;
+ se++;
+ }
+ pe++;
+ }
+ }
+
+ chains = newchains;
+ return chainmaps > 0;
+ }
public StructureSelectionManager getSsm()
{
return ssm;