4 import java.io.IOException;
5 import java.net.URISyntaxException;
6 import java.util.ArrayList;
7 import java.util.Arrays;
8 import java.util.Collections;
9 import java.util.EnumSet;
10 import java.util.HashMap;
11 import java.util.Iterator;
12 import java.util.List;
13 import java.util.Locale;
16 import jalview.analysis.AlignmentUtils;
17 import jalview.bin.argparser.Arg;
18 import jalview.bin.argparser.ArgParser;
19 import jalview.bin.argparser.ArgParser.Position;
20 import jalview.bin.argparser.ArgValue;
21 import jalview.bin.argparser.ArgValues;
22 import jalview.bin.argparser.ArgValuesMap;
23 import jalview.bin.argparser.SubVals;
24 import jalview.datamodel.AlignmentI;
25 import jalview.datamodel.SequenceI;
26 import jalview.datamodel.annotations.AlphaFoldAnnotationRowBuilder;
27 import jalview.gui.AlignFrame;
28 import jalview.gui.AlignmentPanel;
29 import jalview.gui.Desktop;
30 import jalview.gui.Preferences;
31 import jalview.gui.StructureChooser;
32 import jalview.gui.StructureViewer;
33 import jalview.gui.StructureViewer.ViewerType;
34 import jalview.io.AppletFormatAdapter;
35 import jalview.io.BackupFiles;
36 import jalview.io.BioJsHTMLOutput;
37 import jalview.io.DataSourceType;
38 import jalview.io.FileFormat;
39 import jalview.io.FileFormatException;
40 import jalview.io.FileFormatI;
41 import jalview.io.FileFormats;
42 import jalview.io.FileLoader;
43 import jalview.io.HtmlSvgOutput;
44 import jalview.io.IdentifyFile;
45 import jalview.io.NewickFile;
46 import jalview.structure.StructureImportSettings.TFType;
47 import jalview.structure.StructureSelectionManager;
48 import jalview.util.HttpUtils;
49 import jalview.util.MessageManager;
50 import jalview.util.Platform;
56 private boolean headless;
58 private ArgParser argParser;
60 private Map<String, AlignFrame> afMap;
62 private boolean commandArgsProvided = false;
64 private boolean argsWereParsed = false;
66 public Commands(ArgParser argparser, boolean headless)
68 this(Desktop.instance, argparser, headless);
71 public Commands(Desktop d, ArgParser argparser, boolean h)
73 argParser = argparser;
76 afMap = new HashMap<String, AlignFrame>();
77 if (argparser != null)
79 processArgs(argparser, headless);
83 private boolean processArgs(ArgParser argparser, boolean h)
85 argParser = argparser;
87 boolean theseArgsWereParsed = false;
89 if (argParser != null && argParser.getLinkedIds() != null)
91 for (String id : argParser.getLinkedIds())
93 ArgValuesMap avm = argParser.getLinkedArgs(id);
94 theseArgsWereParsed = true;
95 theseArgsWereParsed &= processLinked(id);
96 processGroovyScript(id);
97 boolean processLinkedOkay = theseArgsWereParsed;
98 theseArgsWereParsed &= processImages(id);
99 if (processLinkedOkay)
100 theseArgsWereParsed &= processOutput(id);
103 if (avm.getBoolean(Arg.CLOSE))
105 AlignFrame af = afMap.get(id);
108 af.closeMenuItem_actionPerformed(true);
115 if (argParser.getBoolean(Arg.QUIT))
117 Jalview.getInstance().quit();
120 // carry on with jalview.bin.Jalview
121 argsWereParsed = theseArgsWereParsed;
122 return argsWereParsed;
125 public boolean commandArgsProvided()
127 return commandArgsProvided;
130 public boolean argsWereParsed()
132 return argsWereParsed;
135 protected boolean processUnlinked(String id)
137 return processLinked(id);
140 protected boolean processLinked(String id)
142 boolean theseArgsWereParsed = false;
143 ArgValuesMap avm = argParser.getLinkedArgs(id);
148 * // script to execute after all loading is completed one way or another String
149 * groovyscript = m.get(Arg.GROOVY) == null ? null :
150 * m.get(Arg.GROOVY).getValue(); String file = m.get(Arg.OPEN) == null ? null :
151 * m.get(Arg.OPEN).getValue(); String data = null; FileFormatI format = null;
152 * DataSourceType protocol = null;
154 if (avm.containsArg(Arg.APPEND) || avm.containsArg(Arg.OPEN))
156 commandArgsProvided = true;
159 boolean first = true;
160 boolean progressBarSet = false;
162 // Combine the APPEND and OPEN files into one list, along with whether it
163 // was APPEND or OPEN
164 List<ArgValue> openAvList = new ArrayList<>();
165 openAvList.addAll(avm.getArgValueList(Arg.OPEN));
166 openAvList.addAll(avm.getArgValueList(Arg.APPEND));
167 // sort avlist based on av.getArgIndex()
168 Collections.sort(openAvList);
169 for (ArgValue av : openAvList)
172 SubVals sv = av.getSubVals();
173 String openFile = av.getValue();
174 if (openFile == null)
177 theseArgsWereParsed = true;
181 if (!headless && desktop != null)
183 desktop.setProgressBar(
184 MessageManager.getString(
185 "status.processing_commandline_args"),
186 progress = System.currentTimeMillis());
187 progressBarSet = true;
191 if (!Platform.isJS())
193 * ignore in JavaScript -- can't just file existence - could load it?
198 if (!HttpUtils.startsWithHttpOrHttps(openFile))
200 if (!(new File(openFile)).exists())
202 Console.warn("Can't find file '" + openFile + "'");
207 DataSourceType protocol = AppletFormatAdapter
208 .checkProtocol(openFile);
210 FileFormatI format = null;
213 format = new IdentifyFile().identify(openFile, protocol);
214 } catch (FileFormatException e1)
216 Console.error("Unknown file format for '" + openFile + "'");
220 // When to open a new AlignFrame
221 if (af == null || "true".equals(av.getSubVal("new"))
222 || a == Arg.OPEN || format == FileFormat.Jalview)
226 Jalview.testoutput(argParser, Arg.OPEN, "examples/uniref50.fa",
231 "Opening '" + openFile + "' in new alignment frame");
232 FileLoader fileLoader = new FileLoader(!headless);
234 af = fileLoader.LoadFileWaitTillLoaded(openFile, protocol,
238 boolean wrap = ArgParser.getFromSubValArgOrPref(avm, Arg.WRAP, sv,
239 null, "WRAP_ALIGNMENT", false);
240 af.getCurrentView().setWrapAlignment(wrap);
243 String colour = ArgParser.getFromSubValArgOrPref(avm, av,
244 Arg.COLOUR, sv, null, "DEFAULT_COLOUR_PROT", "");
247 af.changeColour_actionPerformed(colour);
248 Jalview.testoutput(argParser, Arg.COLOUR, "zappo", colour);
251 // Change alignment frame title
252 String title = ArgParser.getFromSubValArgOrPref(avm, av,
253 Arg.TITLE, sv, null, null, null);
257 Jalview.testoutput(argParser, Arg.TITLE, "test title", title);
261 String featuresfile = ArgParser.getValueFromSubValOrArg(avm, av,
263 if (featuresfile != null)
265 af.parseFeaturesFile(featuresfile,
266 AppletFormatAdapter.checkProtocol(featuresfile));
267 Jalview.testoutput(argParser, Arg.FEATURES,
268 "examples/testdata/plantfdx.features", featuresfile);
271 // Add annotations from file
272 String annotationsfile = ArgParser.getValueFromSubValOrArg(avm,
273 av, Arg.ANNOTATIONS, sv);
274 if (annotationsfile != null)
276 af.loadJalviewDataFile(annotationsfile, null, null, null);
277 Jalview.testoutput(argParser, Arg.ANNOTATIONS,
278 "examples/testdata/plantfdx.annotations",
282 // Set or clear the sortbytree flag
283 boolean sortbytree = ArgParser.getBoolFromSubValOrArg(avm,
287 af.getViewport().setSortByTree(true);
288 Jalview.testoutput(argParser, Arg.SORTBYTREE);
291 // Load tree from file
292 String treefile = ArgParser.getValueFromSubValOrArg(avm, av,
294 if (treefile != null)
298 NewickFile nf = new NewickFile(treefile,
299 AppletFormatAdapter.checkProtocol(treefile));
300 af.getViewport().setCurrentTree(
301 af.showNewickTree(nf, treefile).getTree());
302 Jalview.testoutput(argParser, Arg.TREE,
303 "examples/testdata/uniref50_test_tree", treefile);
304 } catch (IOException e)
306 Console.warn("Couldn't add tree " + treefile, e);
310 // Show secondary structure annotations?
311 boolean showSSAnnotations = ArgParser.getFromSubValArgOrPref(avm,
312 Arg.SSANNOTATIONS, av.getSubVals(), null,
313 "STRUCT_FROM_PDB", true);
314 af.setAnnotationsVisibility(showSSAnnotations, true, false);
316 // Show sequence annotations?
317 boolean showAnnotations = ArgParser.getFromSubValArgOrPref(avm,
318 Arg.SHOWANNOTATIONS, av.getSubVals(), null,
319 "SHOW_ANNOTATIONS", true);
320 af.setAnnotationsVisibility(showAnnotations, false, true);
322 // show temperature factor annotations?
323 if (avm.getBoolean(Arg.NOTEMPFAC))
325 // do this better (annotation types?)
326 List<String> hideThese = new ArrayList<>();
327 hideThese.add("Temperature Factor");
328 hideThese.add(AlphaFoldAnnotationRowBuilder.LABEL);
329 AlignmentUtils.showOrHideSequenceAnnotations(
330 af.getCurrentView().getAlignment(), hideThese, null,
335 * comment out hacky approach up to here and add this line: if
336 * (showTemperatureFactor)
340 if (avm.containsArg(Arg.TEMPFAC_LABEL))
342 AlignmentAnnotation aa = AlignmentUtils
343 .getFirstSequenceAnnotationOfType(
344 af.getCurrentView().getAlignment(),
345 AlignmentAnnotation.LINE_GRAPH);
346 String label = avm.getValue(Arg.TEMPFAC_LABEL);
354 "Could not find annotation to apply tempfac_label '"
361 // store the AlignFrame for this id
364 // is it its own structure file?
365 if (format.isStructureFile())
367 StructureSelectionManager ssm = StructureSelectionManager
368 .getStructureSelectionManager(Desktop.instance);
369 SequenceI seq = af.alignPanel.getAlignment().getSequenceAt(0);
370 ssm.computeMapping(false, new SequenceI[] { seq }, null,
371 openFile, DataSourceType.FILE, null, null, null, false);
377 "Opening '" + openFile + "' in existing alignment frame");
378 DataSourceType dst = HttpUtils.startsWithHttpOrHttps(openFile)
380 : DataSourceType.FILE;
381 FileLoader fileLoader = new FileLoader(!headless);
382 fileLoader.LoadFile(af.getCurrentView(), openFile, dst, null,
386 Console.debug("Command " + Arg.APPEND + " executed successfully!");
389 if (first) // first=true means nothing opened
393 Jalview.exit("Could not open any files in headless mode", 1);
397 Console.warn("No more files to open");
400 if (progressBarSet && desktop != null)
401 desktop.setProgressBar(null, progress);
405 // open the structure (from same PDB file or given PDBfile)
406 if (!avm.getBoolean(Arg.NOSTRUCTURE))
408 AlignFrame af = afMap.get(id);
409 if (avm.containsArg(Arg.STRUCTURE))
411 commandArgsProvided = true;
412 for (ArgValue av : avm.getArgValueList(Arg.STRUCTURE))
414 String val = av.getValue();
415 SubVals subVals = av.getSubVals();
416 SequenceI seq = getSpecifiedSequence(af, subVals);
419 // Could not find sequence from subId, let's assume the first
420 // sequence in the alignframe
421 AlignmentI al = af.getCurrentView().getAlignment();
422 seq = al.getSequenceAt(0);
427 Console.warn("Could not find sequence for argument "
428 + Arg.STRUCTURE.argString() + "=" + val);
429 // you probably want to continue here, not break
433 File structureFile = null;
434 if (subVals.getContent() != null
435 && subVals.getContent().length() != 0)
437 structureFile = new File(subVals.getContent());
438 Console.debug("Using structure file (from argument) '"
439 + structureFile.getAbsolutePath() + "'");
443 * PDBEntry fileEntry = new AssociatePdbFileWithSeq()
444 * .associatePdbWithSeq(selectedPdbFileName, DataSourceType.FILE,
445 * selectedSequence, true, Desktop.instance);
447 * sViewer = launchStructureViewer(ssm, new PDBEntry[] { fileEntry }, ap, new
448 * SequenceI[] { selectedSequence });
451 /* THIS DOESN'T WORK */
452 else if (seq.getAllPDBEntries() != null
453 && seq.getAllPDBEntries().size() > 0)
455 structureFile = new File(
456 seq.getAllPDBEntries().elementAt(0).getFile());
457 Console.debug("Using structure file (from sequence) '"
458 + structureFile.getAbsolutePath() + "'");
461 if (structureFile == null)
463 Console.warn("Not provided structure file with '" + val + "'");
467 if (!structureFile.exists())
469 Console.warn("Structure file '"
470 + structureFile.getAbsoluteFile() + "' not found.");
474 Console.debug("Using structure file "
475 + structureFile.getAbsolutePath());
477 // ##### Does this need to happen? Follow
478 // openStructureFileForSequence() below
480 PDBEntry fileEntry = new AssociatePdbFileWithSeq()
481 .associatePdbWithSeq(structureFile.getAbsolutePath(),
482 DataSourceType.FILE, seq, true, Desktop.instance);
485 // open structure view
486 AlignmentPanel ap = af.alignPanel;
489 Cache.setProperty(Preferences.STRUCTURE_DISPLAY,
490 StructureViewer.ViewerType.JMOL.toString());
493 String structureFilepath = structureFile.getAbsolutePath();
495 // get PAEMATRIX file and label from subvals or Arg.PAEMATRIX
496 String paeFilepath = subVals.getWithSubstitutions(argParser, id,
498 String paeLabel = subVals.get("paelabel");
499 ArgValue paeAv = getArgAssociatedWithStructure(Arg.PAEMATRIX, avm,
500 af, structureFilepath);
501 if (paeFilepath == null && paeAv != null)
503 SubVals sv = paeAv.getSubVals();
504 File paeFile = new File(sv.getContent());
506 paeLabel = sv.get("label");
509 paeFilepath = paeFile.getCanonicalPath();
510 } catch (IOException e)
512 paeFilepath = paeFile.getAbsolutePath();
513 Console.warn("Problem with the PAE file path: '"
514 + paeFile.getPath() + "'");
518 // showing annotations from structure file or not
519 boolean ssFromStructure = ArgParser.getFromSubValArgOrPref(avm,
520 Arg.SSANNOTATIONS, subVals, null, "STRUCT_FROM_PDB",
523 // get TEMPFAC type from subvals or Arg.TEMPFAC in case user Adds
524 // reference annotations
525 String tftString = subVals.get("tempfac");
526 TFType tft = avm.getBoolean(Arg.NOTEMPFAC) ? null
528 ArgValue tftAv = getArgAssociatedWithStructure(Arg.TEMPFAC, avm,
529 af, structureFilepath);
530 if (tftString == null && tftAv != null)
532 tftString = tftAv.getSubVals().getContent();
534 if (tftString != null)
536 // get kind of temperature factor annotation
539 tft = TFType.valueOf(tftString.toUpperCase(Locale.ROOT));
540 Console.debug("Obtained Temperature Factor type of '" + tft
541 + "' for structure '" + structureFilepath + "'");
542 } catch (IllegalArgumentException e)
544 // Just an error message!
545 StringBuilder sb = new StringBuilder().append("Cannot set ")
546 .append(Arg.TEMPFAC.argString()).append(" to '")
548 .append("', ignoring. Valid values are: ");
549 Iterator<TFType> it = Arrays.stream(TFType.values())
553 sb.append(it.next().toString().toLowerCase(Locale.ROOT));
557 Console.warn(sb.toString());
561 String sViewer = ArgParser.getFromSubValArgOrPref(avm,
562 Arg.STRUCTUREVIEWER, Position.AFTER, av, subVals, null,
564 ViewerType viewerType = null;
565 if (!"none".equals(sViewer))
567 for (ViewerType v : EnumSet.allOf(ViewerType.class))
569 String name = v.name().toLowerCase(Locale.ROOT)
570 .replaceAll(" ", "");
571 if (sViewer.equals(name))
579 boolean addTempFac = tft != null
580 || Cache.getDefault("ADD_TEMPFACT_ANN", false);
582 // TODO use ssFromStructure
583 StructureChooser.openStructureFileForSequence(null, null, ap, seq,
584 false, structureFilepath, tft, paeFilepath, false,
585 ssFromStructure, false, viewerType);
591 boolean doShading = avm.getBoolean(Arg.TEMPFAC_SHADING);
594 AlignFrame af = afMap.get(id);
595 for (AlignmentAnnotation aa : af.alignPanel.getAlignment()
596 .findAnnotation(PDBChain.class.getName().toString()))
598 AnnotationColourGradient acg = new AnnotationColourGradient(aa,
599 af.alignPanel.av.getGlobalColourScheme(), 0);
600 acg.setSeqAssociated(true);
601 af.changeColour(acg);
602 Console.info("Changed colour " + acg.toString());
607 return theseArgsWereParsed;
610 protected void processGroovyScript(String id)
612 ArgValuesMap avm = argParser.getLinkedArgs(id);
613 AlignFrame af = afMap.get(id);
617 Console.warn("Did not have an alignment window for id=" + id);
621 if (avm.containsArg(Arg.GROOVY))
623 String groovyscript = avm.getValue(Arg.GROOVY);
624 if (groovyscript != null)
626 // Execute the groovy script after we've done all the rendering stuff
627 // and before any images or figures are generated.
628 Console.info("Executing script " + groovyscript);
629 Jalview.getInstance().executeGroovyScript(groovyscript, af);
634 protected boolean processImages(String id)
636 ArgValuesMap avm = argParser.getLinkedArgs(id);
637 AlignFrame af = afMap.get(id);
641 Console.warn("Did not have an alignment window for id=" + id);
645 if (avm.containsArg(Arg.IMAGE))
647 for (ArgValue av : avm.getArgValueList(Arg.IMAGE))
649 String val = av.getValue();
650 SubVals subVal = av.getSubVals();
651 String fileName = subVal.getContent();
652 File file = new File(fileName);
653 String name = af.getName();
654 String renderer = ArgParser.getValueFromSubValOrArg(avm, av,
655 Arg.RENDERER, subVal);
656 if (renderer == null)
658 String type = "png"; // default
659 type = ArgParser.getValueFromSubValOrArg(avm, av, Arg.TYPE, subVal);
660 if (type == null && fileName != null)
662 for (String ext : new String[] { "svg", "png", "html", "eps" })
664 if (fileName.toLowerCase(Locale.ROOT).endsWith("." + ext))
670 // for moment we disable JSON export
671 Cache.setPropsAreReadOnly(true);
672 Cache.setProperty("EXPORT_EMBBED_BIOJSON", "false");
678 Console.debug("Outputting type '" + type + "' to " + fileName);
679 af.createSVG(file, renderer);
683 Console.debug("Outputting type '" + type + "' to " + fileName);
688 Console.debug("Outputting type '" + type + "' to " + fileName);
689 HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
690 htmlSVG.exportHTML(fileName, renderer);
696 BioJsHTMLOutput.refreshVersionInfo(
697 BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
698 } catch (URISyntaxException e)
702 BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
703 bjs.exportHTML(fileName);
704 Console.debug("Creating BioJS MSA Viwer HTML file: " + fileName);
708 af.createEPS(file, name);
709 Console.debug("Creating EPS file: " + fileName);
713 af.createImageMap(file, name);
714 Console.debug("Creating ImageMap file: " + fileName);
718 Console.warn(Arg.IMAGE.argString() + " type '" + type
719 + "' not known. Ignoring");
727 protected boolean processOutput(String id)
729 ArgValuesMap avm = argParser.getLinkedArgs(id);
730 AlignFrame af = afMap.get(id);
734 Console.warn("Did not have an alignment window for id=" + id);
738 if (avm.containsArg(Arg.OUTPUT))
740 for (ArgValue av : avm.getArgValueList(Arg.OUTPUT))
742 String val = av.getValue();
743 SubVals subVals = av.getSubVals();
744 String fileName = subVals.getContent();
745 File file = new File(fileName);
746 boolean overwrite = ArgParser.getFromSubValArgOrPref(avm,
747 Arg.OVERWRITE, subVals, null, "OVERWRITE_OUTPUT", false);
748 // backups. Use the Arg.BACKUPS or subval "backups" setting first,
749 // otherwise if headless assume false, if not headless use the user
750 // preference with default true.
751 boolean backups = ArgParser.getFromSubValArgOrPref(avm, Arg.BACKUPS,
753 Platform.isHeadless() ? null : BackupFiles.ENABLED,
754 !Platform.isHeadless());
756 // if backups is not true then --overwrite must be specified
757 if (file.exists() && !(overwrite || backups))
759 Console.error("Won't overwrite file '" + fileName + "' without "
760 + Arg.OVERWRITE.argString() + " or "
761 + Arg.BACKUPS.argString() + " set");
765 String name = af.getName();
766 String format = ArgParser.getValueFromSubValOrArg(avm, av,
767 Arg.FORMAT, subVals);
768 FileFormats ffs = FileFormats.getInstance();
769 List<String> validFormats = ffs.getWritableFormats(false);
771 FileFormatI ff = null;
772 if (format == null && fileName != null)
774 FORMAT: for (String fname : validFormats)
776 FileFormatI tff = ffs.forName(fname);
777 String[] extensions = tff.getExtensions().split(",");
778 for (String ext : extensions)
780 if (fileName.toLowerCase(Locale.ROOT).endsWith("." + ext))
783 format = ff.getName();
789 if (ff == null && format != null)
791 ff = ffs.forName(format);
795 StringBuilder validSB = new StringBuilder();
796 for (String f : validFormats)
798 if (validSB.length() > 0)
799 validSB.append(", ");
801 FileFormatI tff = ffs.forName(f);
802 validSB.append(" (");
803 validSB.append(tff.getExtensions());
807 Jalview.exit("No valid format specified for "
808 + Arg.OUTPUT.argString() + ". Valid formats are "
809 + validSB.toString() + ".", 1);
810 // this return really shouldn't happen
814 String savedBackupsPreference = Cache
815 .getDefault(BackupFiles.ENABLED, null);
816 Console.debug("Setting backups to " + backups);
817 Cache.applicationProperties.put(BackupFiles.ENABLED,
818 Boolean.toString(backups));
819 af.saveAlignment(fileName, ff);
820 Console.debug("Returning backups to " + savedBackupsPreference);
821 if (savedBackupsPreference != null)
822 Cache.applicationProperties.put(BackupFiles.ENABLED,
823 savedBackupsPreference);
824 if (af.isSaveAlignmentSuccessful())
826 Console.debug("Written alignment '" + name + "' in "
827 + ff.getName() + " format to " + file);
831 Console.warn("Error writing file " + file + " in " + ff.getName()
840 private SequenceI getSpecifiedSequence(AlignFrame af, SubVals subId)
844 AlignmentI al = af.getCurrentView().getAlignment();
845 if (subId.has("seqid"))
847 return al.findName(subId.get("seqid"));
849 else if (-1 < subId.getIndex()
850 && subId.getIndex() < al.getSequences().size())
852 return al.getSequenceAt(subId.getIndex());
857 // returns the first Arg value intended for the structure structFilename
858 // (in the given AlignFrame from the ArgValuesMap)
859 private ArgValue getArgAssociatedWithStructure(Arg arg, ArgValuesMap avm,
860 AlignFrame af, String structFilename)
864 for (ArgValue av : avm.getArgValueList(arg))
866 SubVals subVals = av.getSubVals();
867 String structid = subVals.get("structid");
868 String structfile = subVals.get("structfile");
870 // let's find a structure
871 if (structfile == null && structid == null)
873 ArgValue likelyStructure = avm.getClosestPreviousArgValueOfArg(av,
875 if (likelyStructure != null)
877 SubVals sv = likelyStructure.getSubVals();
878 if (sv != null && sv.has(ArgValues.ID))
880 structid = sv.get(ArgValues.ID);
884 structfile = likelyStructure.getValue();
889 if (structfile == null && structid != null)
891 StructureSelectionManager ssm = StructureSelectionManager
892 .getStructureSelectionManager(Desktop.instance);
895 structfile = ssm.findFileForPDBId(structid);
898 if (structfile != null && structfile.equals(structFilename))