+ commandArgsProvided = true;
+ for (ArgValue av : avm.getArgValueList(Arg.STRUCTURE))
+ {
+ String val = av.getValue();
+ SubVals subId = new SubVals(val);
+ SequenceI seq = getSpecifiedSequence(af, subId);
+ if (seq == null)
+ {
+ Console.warn("Could not find sequence for argument --"
+ + Arg.STRUCTURE + "=" + val);
+ // you probably want to continue here, not break
+ // break;
+ continue;
+ }
+ File structureFile = null;
+ if (subId.getContent() != null
+ && subId.getContent().length() != 0)
+ {
+ structureFile = new File(subId.getContent());
+ Console.debug("Using structure file (from argument) '"
+ + structureFile.getAbsolutePath() + "'");
+ }
+
+ // TRY THIS
+ /*
+ PDBEntry fileEntry = new AssociatePdbFileWithSeq()
+ .associatePdbWithSeq(selectedPdbFileName,
+ DataSourceType.FILE, selectedSequence, true,
+ Desktop.instance);
+
+ sViewer = launchStructureViewer(ssm, new PDBEntry[] { fileEntry },
+ ap, new SequenceI[]
+ { selectedSequence });
+
+ */
+
+ /* THIS DOESN'T WORK */
+ else if (seq.getAllPDBEntries() != null
+ && seq.getAllPDBEntries().size() > 0)
+ {
+ structureFile = new File(
+ seq.getAllPDBEntries().elementAt(0).getFile());
+ Console.debug("Using structure file (from sequence) '"
+ + structureFile.getAbsolutePath() + "'");
+ }
+
+ if (structureFile == null)
+ {
+ Console.warn("Not provided structure file with '" + val + "'");
+ continue;
+ }
+
+ if (!structureFile.exists())
+ {
+ Console.warn("Structure file '"
+ + structureFile.getAbsoluteFile() + "' not found.");
+ continue;
+ }
+
+ Console.debug("Using structure file "
+ + structureFile.getAbsolutePath());
+
+ PDBEntry fileEntry = new AssociatePdbFileWithSeq()
+ .associatePdbWithSeq(structureFile.getAbsolutePath(),
+ DataSourceType.FILE, seq, true, Desktop.instance);
+
+ // open structure view
+ AlignmentPanel ap = af.alignPanel;
+ if (headless)
+ {
+ Cache.setProperty(Preferences.STRUCTURE_DISPLAY,
+ StructureViewer.ViewerType.JMOL.toString());
+ }