Making the GATK unpredictably random...
through an option! set -ndrs if you want the GATK to be really random (non-deterministic). Engine option, available to every walker. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5715 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
f97e7d2fb4
commit
36ac8beee1
|
|
@ -189,9 +189,9 @@ public class GenomeAnalysisEngine {
|
|||
private static final long GATK_RANDOM_SEED = 47382911L;
|
||||
private static Random randomGenerator = new Random(GATK_RANDOM_SEED);
|
||||
|
||||
public static final Random getRandomGenerator() { return randomGenerator; }
|
||||
public static Random getRandomGenerator() { return randomGenerator; }
|
||||
public static void resetRandomGenerator() { randomGenerator.setSeed(GATK_RANDOM_SEED); }
|
||||
|
||||
public static void resetRandomGenerator(long seed) { randomGenerator.setSeed(seed); }
|
||||
/**
|
||||
* Actually run the GATK with the specified walker.
|
||||
*
|
||||
|
|
@ -211,6 +211,9 @@ public class GenomeAnalysisEngine {
|
|||
if (this.walker == null)
|
||||
throw new ReviewedStingException("The walker passed to GenomeAnalysisEngine can not be null.");
|
||||
|
||||
if (this.getArguments().nonDeterministicRandomSeed)
|
||||
resetRandomGenerator(System.currentTimeMillis());
|
||||
|
||||
// Prepare the data for traversal.
|
||||
initializeDataSources();
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,11 @@ public class GATKArgumentCollection {
|
|||
@Argument(fullName = "BTI_merge_rule", shortName = "BTIMR", doc = "Indicates the merging approach the interval parser should use to combine the BTI track with other -L options", required = false)
|
||||
public IntervalSetRule BTIMergeRule = IntervalSetRule.UNION;
|
||||
|
||||
@Element(required = false)
|
||||
@Argument(fullName = "nonDeterministicRandomSeed", shortName = "ndrs", doc = "Makes the GATK behave non deterministically, that is, the random numbers generated will be different in every run", required = false)
|
||||
public boolean nonDeterministicRandomSeed = false;
|
||||
|
||||
|
||||
@Element(required = false)
|
||||
@Input(fullName = "DBSNP", shortName = "D", doc = "DBSNP file", required = false)
|
||||
public String DBSNPFile = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue