2009-03-18 07:22:37 +08:00
|
|
|
package org.broadinstitute.sting.gatk.walkers;
|
|
|
|
|
|
2009-03-27 23:03:32 +08:00
|
|
|
import java.io.PrintStream;
|
|
|
|
|
|
2009-03-27 04:45:27 +08:00
|
|
|
import org.broadinstitute.sting.gatk.GenomeAnalysisTK;
|
|
|
|
|
|
2009-03-18 07:22:37 +08:00
|
|
|
/**
|
|
|
|
|
* Created by IntelliJ IDEA.
|
|
|
|
|
* User: hanna
|
|
|
|
|
* Date: Mar 17, 2009
|
|
|
|
|
* Time: 1:53:31 PM
|
|
|
|
|
* To change this template use File | Settings | File Templates.
|
|
|
|
|
*/
|
2009-03-27 21:44:46 +08:00
|
|
|
public abstract class Walker<ReduceType> {
|
2009-03-18 07:22:37 +08:00
|
|
|
// TODO: Can a walker be templatized so that map and reduce live here?
|
2009-03-27 04:45:27 +08:00
|
|
|
|
2009-03-27 23:03:32 +08:00
|
|
|
/**
|
|
|
|
|
* A stream for writing normal (non-error) output. System.out by default.
|
|
|
|
|
*/
|
|
|
|
|
protected PrintStream out = null;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A stream for writing error output. System.err by default.
|
|
|
|
|
*/
|
|
|
|
|
protected PrintStream err = null;
|
|
|
|
|
|
2009-03-27 04:45:27 +08:00
|
|
|
protected Walker() {
|
|
|
|
|
GenomeAnalysisTK.Instance.loadArgumentsIntoObject(this);
|
2009-03-27 23:03:32 +08:00
|
|
|
out = GenomeAnalysisTK.Instance.out;
|
|
|
|
|
err = GenomeAnalysisTK.Instance.err;
|
2009-03-27 04:45:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the toolkit, for peering into internal structures that can't
|
|
|
|
|
* otherwise be read. Use sparingly, and discuss uses with software engineering
|
|
|
|
|
* team.
|
|
|
|
|
* @return The genome analysis toolkit.
|
|
|
|
|
*/
|
|
|
|
|
protected GenomeAnalysisTK getToolkit() {
|
|
|
|
|
return GenomeAnalysisTK.Instance;
|
2009-03-27 00:22:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void initialize() { }
|
2009-03-27 21:44:46 +08:00
|
|
|
public void onTraversalDone(ReduceType result) {
|
|
|
|
|
// TODO: replace with the correct output stream
|
|
|
|
|
System.out.println("[REDUCE RESULT] Traversal result is: " + result);
|
|
|
|
|
}
|
2009-03-18 07:22:37 +08:00
|
|
|
}
|