Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremiah Wala committed Aug 20, 2015
1 parent c842cfd commit c224c01
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
2 changes: 2 additions & 0 deletions bwa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ bwa:libbwa.a $(AOBJS) main.o

## JEREMIAH
test: ;
dist: ;
distdir: ;

check: ;

Expand Down
3 changes: 3 additions & 0 deletions htslib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ BUILT_TEST_PROGRAMS = \

all: lib-static $(BUILT_PROGRAMS) ##$(BUILT_TEST_PROGRAMS)

##JEREMIAH
distdir: ;

HTSPREFIX =
include htslib_vars.mk

Expand Down
2 changes: 1 addition & 1 deletion src/AlignedContig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ bool AlignmentFragment::parseIndelBreak(BreakPoint &bp) {
//bp.homology = "";

int curr = 0;
int gcurrlen = -1;
int gcurrlen = 0; //-1;

bp.gr1.pos1 = -1;
bp.gr1.pos2 = -1;
Expand Down
24 changes: 16 additions & 8 deletions src/BreakPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,8 @@ namespace SnowTools {

int pos1 = gr1.pos1;
bool isdel = insertion.length() == 0;
if (isdel) // del breaks are stored as last non-deleted base. CigarMap stores as THE deleted base
pos1++;
//if (isdel) // del breaks are stored as last non-deleted base. CigarMap stores as THE deleted base
// pos1++;
std::string st = std::to_string(gr1.chr) + "_" + std::to_string(pos1) + "_" + std::to_string(this->getSpan()) + (isdel ? "D" : "I");
return st;
}
Expand Down Expand Up @@ -771,21 +771,29 @@ namespace SnowTools {
// set the allelic fraction
double af_n = -1;
double af_t = -1;
std::cerr << cname << " " << tcov_support << " " << ncov_support << std::endl;

if (isindel && tcov > 0)
af_t = static_cast<double>(/*std::max(tsplit, tcigar)*/tcov_support) / static_cast<double>(tcov);
if (isindel && ncov > 0)
af_n = static_cast<double>(/*std::max(nsplit, ncigar)*/ncov_support) / static_cast<double>(ncov);

std::string s_af_t = std::to_string(af_t);
if (s_af_t.length() > 4)
s_af_t = s_af_t.substr(0, 4);
std::string s_af_n = std::to_string(af_n);
if (s_af_n.length() > 4)
s_af_n = s_af_n.substr(0, 4);

size_t rs_t = std::count(rs.begin(), rs.end(), 'r');

if (isindel)
ss << ">>>> " << (insertion.size() ? "INSERTION" : "DELETION") << " of length " << getSpan() << " at " << gr1 << " contig " << cname
ss << ">" << (insertion.size() ? "INS: " : "DEL: ") << getSpan() << " " << gr1 /*<< " " << cname */
<< " T/N split: " << tsplit << "/" << nsplit << " T/N cigar: "
<< tcigar << "/" << ncigar << " T/N AF " << af_t << "/" << af_n << " T/N Cov " << tcov << "/" << ncov << " DBSNP " << rs;
<< tcigar << "/" << ncigar << " T/N AF " << s_af_t << "/" << s_af_n << " T/N Cov " << tcov << "/" << ncov << " DBSNP: " << rs_t;
else
ss << ">>>> STRUCTURAL VAR at " << gr1.pointString() << " to " << gr2.pointString() << " SPAN " << getSpan() << " contig " << cname
<< " T/N split: " << tsplit << "/" << nsplit << " T/N discordant: "
<< dc.tcount << "/" << dc.ncount << " evidence " << evidence;
ss << "> SV: " << gr1.pointString() << " to " << gr2.pointString() << " SPAN " << getSpan() /*<< " " << cname */
<< " T/N split: " << tsplit << "/" << nsplit << " T/N disc: "
<< dc.tcount << "/" << dc.ncount << " " << evidence;


return ss.str();
Expand Down
8 changes: 4 additions & 4 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
Expand All @@ -34,7 +34,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = src
subdir = SnowTools/src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
Expand Down Expand Up @@ -204,9 +204,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign SnowTools/src/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
$(AUTOMAKE) --foreign SnowTools/src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
Expand Down
2 changes: 1 addition & 1 deletion src/SnowTools/SnowToolsCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace SnowTools {
static const int NONCENT_CHR [44] = {1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,
11,11,12,12,13,14,15,16,16,17,17,18,18,19,19,20,20,21,21,22,23,23,24,24};


}

#endif

0 comments on commit c224c01

Please sign in to comment.