Skip to main content

Options for consensus

Comments

2 comments

  • Richard Moir

    The consensus options are a bit fiddly. You shouldn't construct them directly because they are not in the public API and to solve your problem you can pass the alignment into the getOptions method. This should do it:

    DocumentOperation generate_consensus_operation = PluginUtilities.getDocumentOperation("Generate_Consensus");
    Options consensusOptions = generate_consensus_operation.getOptions(copyOfAnnotatedPluginDocument);

    if (!consensusOptions.setValue("thresholdPercent", "100")) {
    throw new DocumentOperationException("Failed to set threshold");
    }
    if (!consensusOptions.setValue("noConsensusGaps", Boolean.TRUE)) {
    throw new DocumentOperationException("Failed to set ignore gaps");
    }

    List<AnnotatedPluginDocument> newAnnotatedPluginDocuments=generate_consensus_operation.performOperation(ProgressListener.EMPTY, consensusOptions, copyOfAnnotatedPluginDocument);
    PluginDocument documentOrCrash = newAnnotatedPluginDocuments.get(0).getDocumentOrCrash();
    System.out.println("GENERATED CONSENSUS WITH OPTIONS:"+((SequenceDocument) documentOrCrash).getSequenceString());
    return newAnnotatedPluginDocuments.get(0);
    0
  • Adrian

    Thank you, that worked perfectly.

     

    CHeers,

    Adrian

    0

Please sign in to leave a comment.