+ return setMapping(true, sequence, targetChains, pdbFile, protocol);
+ }
+
+ /**
+ * create sequence structure mappings between each sequence and the given
+ * pdbFile (retrieved via the given protocol).
+ *
+ * @param forStructureView
+ * when true, record the mapping for use in mouseOvers
+ *
+ * @param sequenceArray
+ * - one or more sequences to be mapped to pdbFile
+ * @param targetChainIds
+ * - optional chain specification for mapping each sequence to pdb
+ * (may be nill, individual elements may be nill)
+ * @param pdbFile
+ * - structure data resource
+ * @param protocol
+ * - how to resolve data from resource
+ * @return null or the structure data parsed as a pdb file
+ */
+ synchronized public PDBfile setMapping(boolean forStructureView,
+ SequenceI[] sequenceArray, String[] targetChainIds,
+ String pdbFile,
+ String protocol)
+ {
+ /*
+ * There will be better ways of doing this in the future, for now we'll use
+ * the tried and tested MCview pdb mapping
+ */
+ boolean parseSecStr = processSecondaryStructure;
+ if (isPDBFileRegistered(pdbFile))
+ {
+ for (SequenceI sq : sequenceArray)
+ {
+ SequenceI ds = sq;
+ while (ds.getDatasetSequence() != null)
+ {
+ ds = ds.getDatasetSequence();
+ }
+ ;
+ if (ds.getAnnotation() != null)
+ {
+ for (AlignmentAnnotation ala : ds.getAnnotation())
+ {
+ // false if any annotation present from this structure
+ // JBPNote this fails for jmol/chimera view because the *file* is
+ // passed, not the structure data ID -
+ if (PDBfile.isCalcIdForFile(ala, findIdForPDBFile(pdbFile)))
+ {
+ parseSecStr = false;
+ }
+ }
+ }
+ }
+ }
+ PDBfile pdb = null;
+ boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts();
+ SiftsClient siftsClient = null;