Reinitialize random seed in the bwa bindings from the fixed seed stored in the
BWA support files every time the support files are loaded.
This commit is contained in:
parent
3d0853149b
commit
f50145b872
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
export BWA_HOME="/humgen/gsa-scr1/hanna/src/bwa"
|
||||
export BWA_HOME="/humgen/gsa-scr1/hanna/src/bwa-trunk/bwa"
|
||||
export JAVA_INCLUDE="/broad/tools/Linux/x86_64/pkgs/jdk_1.6.0_12/include -I/broad/tools/Linux/x86_64/pkgs/jdk_1.6.0_12/include/linux"
|
||||
export TARGET_LIB="libbwa.so"
|
||||
export EXTRA_LIBS="-lc -lz -lstdc++ -lpthread"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "bwase.h"
|
||||
#include "bwa_gateway.h"
|
||||
|
|
@ -27,6 +28,9 @@ BWA::BWA(const char* ann_filename,
|
|||
bwt_restore_sa(reverse_sa_filename, bwts[1]);
|
||||
load_default_options();
|
||||
|
||||
// Always reinitialize the random seed whenever a new set of files are loaded.
|
||||
initialize_random_seed();
|
||||
|
||||
// initialize the bwase subsystem
|
||||
bwase_initialize();
|
||||
}
|
||||
|
|
@ -207,6 +211,11 @@ void BWA::load_default_options()
|
|||
options.trim_qual = 0;
|
||||
}
|
||||
|
||||
void BWA::initialize_random_seed()
|
||||
{
|
||||
srand48(bns->seed);
|
||||
}
|
||||
|
||||
void BWA::set_max_edit_distance(float edit_distance) {
|
||||
if(edit_distance > 0 && edit_distance < 1) {
|
||||
options.fnr = edit_distance;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class BWA {
|
|||
gap_opt_t options;
|
||||
|
||||
void load_default_options();
|
||||
void initialize_random_seed();
|
||||
bwa_seq_t* create_sequence(const char* bases, const unsigned read_length);
|
||||
void copy_bases_into_sequence(bwa_seq_t* sequence, const char* bases, const unsigned read_length);
|
||||
Alignment generate_final_alignment_from_sequence(bwa_seq_t* sequence);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
public class AlignerIntegrationTest extends WalkerTest {
|
||||
@Test
|
||||
public void testBasicAlignment() {
|
||||
String md5 = "34eb4323742999d6d250a0aaa803c6d5";
|
||||
String md5 = "a2bdf907b18114a86ca47f9fc23791bf";
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
"-R " + GATKDataLocation + "bwa/human_b36_both.fasta" +
|
||||
" -T Align" +
|
||||
|
|
|
|||
Loading…
Reference in New Issue