Writing a QTL-mapping plugin

QGene allows you to make your own plugin of any type. Usually you will want to make a QTL-mapping plugin.


We assume that you know the Java programming language well enough. We use and recommend the Eclipse development environment. Also, you may find QGene's Javadoc valuable.


In QGene, all QTL analysis plugins must inherit from QGeneticStatsPlugin. You will need to override the following methods:

  1. calculate(List<QChromosome> chroms, List<QTrait> traits, IStatistic<? extends QStatsPlugin<QMultiChromValues[]>> stat)
    This method is the main calculation method. The parameters List<QChromosome> and List<QTrait> are the list of chromosomes and list of traits. IStatistic is the requested statistic, such as F or R2. If this is a multiple-trait QTL-analysis plugin, the specified list of t traits is treated as one correlated trait input to your plugin. In this case, the plugin needs to output only one set of output. If this is a single-trait plugin, the plugin will need to output t sets, one for each trait.
  2. initData()
    This method allows you to check whether the dataset is compatible with your plugin. Return true if it is, and false otherwise. For example, although QGene has the capability to handle various mating designs, you may want to allow only backcross designs. Also, you may want to return false for datasets that contain no trait data, which are useful only for checking genotypic segregation.
  3. getOutputType()
    In most cases, you will want QGene to handle the display of your output. So the only statement you need to put is:
    return QMultiChromValues[].class;
  4. getInteractionOutputType()
    This is the analog of getOutputType() for QTL interaction output. If you want QGene to handle the display of the QTL interaction output, you need to put:
    return QMultiChromInteractionValues[].class;
    Note that QGene still does not handle QTL-interaction computation. So please don't override this method yet since we may change the specification.
  5. getAvailableStatistics()
    Returns the array of statistics that your plugin can handle.
  6. needsExpectationCalculator()
    If you are building an interval-mapping method and you would like to let QGene calculate genotypic expectation as specified in Jiang and Zeng (1997), return true here.
  7. isMultiTraitAnalysis()
    Return true if your plugin is a multiple-trait analysis plugin.


Sample code