IProgressIndicator progress)
{
long progressSessionId = System.currentTimeMillis() * 3;
+
+ /**
+ * do we extract and transfer annotation from 3D data ?
*/
- 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;
- }
- }
- }
- }
- }
+ // FIXME: possibly should just delete
+
+ boolean parseSecStr = processSecondaryStructure
+ ? isStructureFileProcessed(pdbFile, sequenceArray)
+ : false;
+
StructureFile pdb = null;
boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts();
try
return pdb;
}
+ /**
+ * check if we need to extract secondary structure from given pdbFile and
+ * transfer to sequences
+ *
+ * @param pdbFile
+ * @param sequenceArray
+ * @return
+ */
+ private boolean isStructureFileProcessed(String pdbFile,
+ SequenceI[] sequenceArray)
+ {
+ boolean parseSecStr = true;
+ 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;
+ }
+ }
+ }
+ }
+ }
+ return parseSecStr;
+ }
+
public void addStructureMapping(StructureMapping sm)
{
mappings.add(sm);