forked from broadgsa/gatk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'unstable/master'
- Loading branch information
Showing
549 changed files
with
11,796 additions
and
2,930 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#include "MainTools.h" | ||
#include "Basevector.h" | ||
#include "lookup/LookAlign.h" | ||
#include "lookup/SerialQltout.h" | ||
|
||
unsigned int MatchingEnd(look_align &la, vecbasevector &candidates, vecbasevector &ref) { | ||
//la.PrintParseable(cout); | ||
|
||
for (int i = 0; i < candidates.size(); i++) { | ||
look_align newla = la; | ||
|
||
if (newla.rc1) { candidates[i].ReverseComplement(); } | ||
newla.ResetFromAlign(newla.a, candidates[i], ref[la.target_id]); | ||
|
||
//newla.PrintParseable(cout, &candidates[i], &ref[newla.target_id]); | ||
//cout << newla.Errors() << " " << la.Errors() << endl; | ||
|
||
if (newla.Errors() == la.Errors()) { | ||
return i; | ||
} | ||
} | ||
|
||
//FatalErr("Query id " + ToString(la.query_id) + " had no matches."); | ||
|
||
return candidates.size() + 1; | ||
} | ||
|
||
int main(int argc, char **argv) { | ||
RunTime(); | ||
|
||
BeginCommandArguments; | ||
CommandArgument_String(ALIGNS); | ||
CommandArgument_String(FASTB_END_1); | ||
CommandArgument_String(FASTB_END_2); | ||
CommandArgument_String(REFERENCE); | ||
|
||
CommandArgument_String(ALIGNS_END_1_OUT); | ||
CommandArgument_String(ALIGNS_END_2_OUT); | ||
EndCommandArguments; | ||
|
||
vecbasevector ref(REFERENCE); | ||
vecbasevector reads1(FASTB_END_1); | ||
vecbasevector reads2(FASTB_END_2); | ||
|
||
ofstream aligns1stream(ALIGNS_END_1_OUT.c_str()); | ||
ofstream aligns2stream(ALIGNS_END_2_OUT.c_str()); | ||
|
||
basevector bv; | ||
|
||
SerialQltout sqltout(ALIGNS); | ||
look_align la; | ||
while (sqltout.Next(la)) { | ||
vecbasevector candidates(2); | ||
candidates[0] = reads1[la.query_id]; | ||
candidates[1] = reads2[la.query_id]; | ||
|
||
unsigned int matchingend = MatchingEnd(la, candidates, ref); | ||
if (matchingend < 2) { | ||
bv = (matchingend == 0) ? reads1[la.query_id] : reads2[la.query_id]; | ||
|
||
//la.PrintParseable(cout, &bv, &ref[la.target_id]); | ||
la.PrintParseable(((matchingend == 0) ? aligns1stream : aligns2stream), &bv, &ref[la.target_id]); | ||
} | ||
} | ||
|
||
aligns1stream.close(); | ||
aligns2stream.close(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
CXX=g++ | ||
CXXFLAGS=-g -Wall -O2 -m64 -fPIC | ||
|
||
.cpp.o: | ||
$(CXX) -c $(CXXFLAGS) -I$(BWA_HOME) -I$(JAVA_INCLUDE) $< -o $@ | ||
|
||
all: init lib | ||
|
||
init: | ||
@echo Please make sure the following platforms are set correctly on your machine. | ||
@echo BWA_HOME=$(BWA_HOME) | ||
@echo JAVA_INCLUDE=$(JAVA_INCLUDE) | ||
@echo TARGET_LIB=$(TARGET_LIB) | ||
@echo EXTRA_LIBS=$(EXTRA_LIBS) | ||
@echo LIBTOOL_COMMAND=$(LIBTOOL_COMMAND) | ||
|
||
lib: org_broadinstitute_sting_alignment_bwa_c_BWACAligner.o bwa_gateway.o | ||
$(LIBTOOL_COMMAND) $? -o $(TARGET_LIB) -L$(BWA_HOME) -lbwacore $(EXTRA_LIBS) | ||
|
||
clean: | ||
rm *.o libbwa.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
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" | ||
export LIBTOOL_COMMAND="g++ -shared -Wl,-soname,libbwa.so" | ||
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
export BWA_HOME="/Users/mhanna/src/bwa" | ||
export JAVA_INCLUDE="/System/Library/Frameworks/JavaVM.framework/Headers" | ||
export TARGET_LIB="libbwa.dylib" | ||
export EXTRA_LIBS="-lc -lz -lsupc++" | ||
export LIBTOOL_COMMAND="libtool -dynamic" | ||
make |
Oops, something went wrong.