Search in sources :

Example 1 with ArrayDesignMergeService

use of ubic.gemma.core.loader.expression.arrayDesign.ArrayDesignMergeService in project Gemma by PavlidisLab.

the class ArrayDesignMergeCli method processOptions.

@Override
protected void processOptions() {
    super.processOptions();
    if (this.hasOption('o')) {
        // required
        String otherArrayDesignName = this.getOptionValue('o');
        String[] names = StringUtils.split(otherArrayDesignName, ',');
        this.otherArrayDesigns = new HashSet<>();
        for (String string : names) {
            ArrayDesign o = this.locateArrayDesign(string, arrayDesignService);
            if (o == null) {
                throw new IllegalArgumentException("Array design " + string + " not found");
            }
            o = this.thaw(o);
            this.otherArrayDesigns.add(o);
        }
    }
    if (this.arrayDesignsToProcess.size() > 1) {
        throw new IllegalArgumentException("Cannot be applied to more than one array design given to the '-a' option");
    }
    arrayDesign = this.arrayDesignsToProcess.iterator().next();
    arrayDesign = this.thaw(arrayDesign);
    if (this.hasOption("add")) {
        if (arrayDesign.getMergees().isEmpty()) {
            throw new IllegalArgumentException("The array given must be a merged design when using -add");
        }
    } else {
        if (this.hasOption("n")) {
            this.newName = this.getOptionValue('n');
        } else {
            throw new IllegalArgumentException("You must provide a name for the new design unless using -add");
        }
        if (this.hasOption("s")) {
            this.newShortName = this.getOptionValue('s');
        } else {
            throw new IllegalArgumentException("You must provide a short name for the new design unless using -add");
        }
    }
    arrayDesignMergeService = this.getBean(ArrayDesignMergeService.class);
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) ArrayDesignMergeService(ubic.gemma.core.loader.expression.arrayDesign.ArrayDesignMergeService)

Aggregations

ArrayDesignMergeService (ubic.gemma.core.loader.expression.arrayDesign.ArrayDesignMergeService)1 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)1