+
+ if (tok.startsWith("format"))
+ {
+ for (FileFormatI fmt : FileFormats.getInstance().getFormats())
+ {
+ if (fmt.isWritable() && val.equalsIgnoreCase(fmt.getName()))
+ {
+ format = fmt;
+ return true;
+ }
+ }
+ warnings.append(
+ "Invalid alignment format '" + val + "'. Must be one of (");
+ for (String fmt : FileFormats.getInstance().getWritableFormats(true))
+ {
+ warnings.append(" ").append(fmt);
+ }
+ warnings.append(")\n");
+ }
+ if (tok.startsWith("type"))
+ {
+ try
+ {
+ type = molType.valueOf(val);
+ return true;
+ } catch (Exception x)
+ {
+ warnings.append(
+ "Invalid molecule type '" + val + "'. Must be one of (");
+ for (molType v : molType.values())
+ {
+ warnings.append(" " + v);
+ }
+ warnings.append(")\n");
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public List<OptionI> getOptions()
+ {
+ List<OptionI> lst = getBaseOptions();
+ lst.add(new BooleanOption("jvsuffix",
+ "Append jalview style /start-end suffix to ID", false, false,
+ jvsuffix, null));
+ lst.add(new BooleanOption("writeasfile",
+ "Append jalview style /start-end suffix to ID", false, false,
+ writeAsFile, null));
+
+ List<String> writable = FileFormats.getInstance()
+ .getWritableFormats(true);
+ lst.add(new Option("format", "Alignment upload format", true,
+ FileFormat.Fasta.toString(), format.getName(), writable, null));
+ lst.add(createMolTypeOption("type", "Sequence type", false, type,
+ null));
+
+ return lst;