Skip to content

Writing Expression Counter

Laurent Jourdren edited this page Mar 26, 2015 · 2 revisions

Writing a wrapper on an expression counter.

WARNING: This documentation is outdated and will soon be updated.

Eoulsan defines an ExpressionCounter interface that allows to integrate an expression counter in the expression step.

Available ExpressionCounter implementations

The following ExpressionCounter implementations are available:

  • EoulsanCounter, a homemade algorithme (only on single-end reads),
  • HTSeqCounter, the re-implementation of the HTSeq-count program, version 0.5.3p7 (single-end and paired-end reads).

Writing a plug-in for the expression step of Eoulsan

It is very easy to write a plug-in for the expression step of Eoulsan. In this section, we will write a MyToolExpressionCounter class that runs the program MyTool. This one must be already installed.

  • First, you can add the init() method to the new class (it is in the AbstractExpressionCounter abstract class so it is not necessary) :

package com.example;

// the AbstractExpressionCounter class implements the ExpressionCounter interface
public class MyToolExpressionCounter extends AbstractExpressionCounter {

  @Override
  public void init(final String genomicType, final Reporter reporter, final String counterGroup) {
  
    // call to the super-methode, implemented in the AbstractExpressionCounter abstract class
    super.init(genomicType, reporter, counterGroup);
  }

}

To have informations on the Reporter object, see the page.

  • Then, add the getCounterName() method:

  private static final String COUNTER_NAME = "mytool";
  
  @Override
  public String getCounterName() {

    return COUNTER_NAME;
  }

  • Finally, add the internalCount() method:

  @Override
  protected void internalCount(final File alignmentFile, final File annotationFile,
      final File expressionFile, final File GenomeDescFile, Reporter reporter,
      String counterGroup) throws IOException, EoulsanException,
      BadBioEntryException {
  
    // add here all instructions that are necessary to run the program MyTool
  
  }

More informations about Java Exceptions are available here.