Last commit

Genetic-Programming-like parameters optimizer


Usage: optimizer [options] Files
    -A, --all
      Run all possible combinations
      Default: false
    -h, --help
      print help and exit
      What kind of help. One of [usage,markdown,xml].
    -seed, --random
      Random seed. -1 == current time
      Default: -1
  * -c, --code, --source
      User's code.
      print version and exit



Requirements / Dependencies

Download and Compile

$ git clone "https://github.com/lindenb/jvarkit.git"
$ cd jvarkit
$ ./gradlew optimizer

The java jar file will be installed in the dist directory.

Source code




The project is licensed under the MIT license.


Should you cite optimizer ? https://github.com/mr-c/shouldacite/blob/master/should-I-cite-this-software.md

The current reference is:


Lindenbaum, Pierre (2015): JVarkit: java-based utilities for Bioinformatics. figshare. http://dx.doi.org/10.6084/m9.figshare.1425030

This is a Genetic-Programming-like parameters optimizer.

use must provide the scafold of a java code that will override Solution and a JSON file describing the parameters.

An example of json config

	"min": 1,
	"min": 0.01,
	"max": 0.1,

The base class Solution

public static abstract class Solution implements Comparable<Solution>
	protected long generation =  -1L;
	protected final Map<String,Object> params;
	public Solution(final Map<String,Object> params)
		this.params = Collections.unmodifiableMap(params);
	// eval the result. Must be implemented by the user
	public abstract int execute() throws Exception;
	// delete any file associated to this solution 
	public void delete() {}
	//mate a Solution with another, returns null if mating is not possible
	public Solution mate(final Solution another) {
		return null;
	public boolean equals(final Object obj) {
		if(obj==this) return true;
		if(obj ==null || !(obj instanceof Solution)) return false;
		final Solution other=Solution.class.cast(obj);
		return this.params.equals(other.params);
	public int hashCode() {
		return this.params.hashCode();

An example of custom class extending Solution

__BASE__ will be replaced by the base class name Solution. __CLASS__ will be replaced by the current generated class name.

The user’s code will be inserted in the following template:

 1  import java.util.*;
 2  import java.io.*;
 3  import java.util.stream.*;
 4  import java.util.function.*;
 5  import htsjdk.samtools.util.*;
 6  import htsjdk.variant.variantcontext.*;
 7  import htsjdk.variant.vcf.*;
 8  import javax.annotation.processing.Generated;
 9  @Generated(value="Optimizer",date="2017-07-10T11:20:07+0200")
10  public class __CLASS__ extends  __BASE__ {
11  public __CLASS__(final Map<String,Object> params) {
12  super(params);
13  }
14      // user's code starts here 
93     // user's code ends here 
94  }

in CLASS User must implement: