String cls = commandLine.getOptionValue('c');
if (cls == null) {
throw new MissingParameterException("class");
}
Filter filter;
if (cls.equals("galechurch")) {
filter = new GaleAndChurchMacro();
} else if (cls.equals("moore")) {
filter = new MooreMacro();
} else if (cls.equals("poisson")) {
filter = new PoissonMacro();
} else if (cls.equals("translation")) {
filter = new TranslationMacro();
} else if (cls.equals("poisson-translation")) {
filter = new PoissonTranslationMacro();
} else {
throw new UnknownParameterException("class");
}
filter = FilterDecorators.decorate(filter);
Parser parser = new AlParser(getIn());
Formatter formatter = new AlFormatter(getOut());
List<Alignment> alignmentList = parser.parse();
alignmentList = filter.apply(alignmentList);
formatter.format(alignmentList);
}