Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = bwa htslib fermi-lite src
SUBDIRS = bwa fermi-lite src

install:
mkdir -p lib && cp src/libseqlib.a fermi-lite/libfml.a bwa/libbwa.a htslib/libhts.a lib
mkdir -p lib && cp src/libseqlib.a fermi-lite/libfml.a bwa/libbwa.a lib

seqtools:
mkdir -p bin && cd src/seqtools && make && mv seqtools ../../bin
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = bwa htslib fermi-lite src
SUBDIRS = bwa fermi-lite src
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

Expand Down Expand Up @@ -778,7 +778,7 @@ uninstall-am:


install:
mkdir -p lib && cp src/libseqlib.a fermi-lite/libfml.a bwa/libbwa.a htslib/libhts.a lib
mkdir -p lib && cp src/libseqlib.a fermi-lite/libfml.a bwa/libbwa.a lib

seqtools:
mkdir -p bin && cd src/seqtools && make && mv seqtools ../../bin
Expand Down
8 changes: 4 additions & 4 deletions SeqLib/BamHeader.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef SEQLIB_BAM_HEADER_H__
#define SEQLIB_BAM_HEADER_H__

#include "htslib/htslib/hts.h"
#include "htslib/htslib/sam.h"
#include "htslib/htslib/bgzf.h"
#include "htslib/htslib/kstring.h"
#include <htslib/hts.h>
#include <htslib/sam.h>
#include <htslib/bgzf.h>
#include <htslib/kstring.h>

#include "SeqLib/SeqLibUtils.h"
#include <string>
Expand Down
5 changes: 5 additions & 0 deletions SeqLib/BamReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ class BamReader {
*/
bool SetMultipleRegions(const GRC& grc);

/** Return the current region index
* @return current region index
*/
size_t GetRegionIdx();

/** Return if the reader has opened the first file */
bool IsOpen() const { if (m_bams.size()) return m_bams.begin()->second.fp.get() != NULL; return false; }

Expand Down
38 changes: 18 additions & 20 deletions SeqLib/BamRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include <algorithm>

extern "C" {
#include "htslib/htslib/hts.h"
#include "htslib/htslib/sam.h"
#include "htslib/htslib/bgzf.h"
#include "htslib/htslib/kstring.h"
#include "htslib/htslib/faidx.h"
#include <htslib/hts.h>
#include <htslib/sam.h>
#include <htslib/bgzf.h>
#include <htslib/kstring.h>
#include <htslib/faidx.h>

}

Expand Down Expand Up @@ -665,31 +665,29 @@ class BamRecord {
inline int32_t NumSoftClip() const {
int32_t p = 0;
uint32_t* c = bam_get_cigar(b);
for (size_t i = 0; i < b->core.n_cigar; ++i)
if (bam_cigar_opchr(c[i]) == 'S')
p += bam_cigar_oplen(c[i]);

p = (((*c) & 0xF) == BAM_CSOFT_CLIP ? ((*c) >> 4) : 0);
c += b->core.n_cigar - 1;
p += (((*c) & 0xF) == BAM_CSOFT_CLIP ? ((*c) >> 4) : 0);

return p;
}
}

/** Get the number of hard clipped bases */
inline int32_t NumHardClip() const {
int32_t p = 0;
uint32_t* c = bam_get_cigar(b);
for (size_t i = 0; i < b->core.n_cigar; ++i)
if (bam_cigar_opchr(c[i]) == 'H')
p += bam_cigar_oplen(c[i]);
return p;
}

p = (((*c) & 0xF) == BAM_CHARD_CLIP ? ((*c) >> 4) : 0);
c += b->core.n_cigar - 1;
p += (((*c) & 0xF) == BAM_CHARD_CLIP ? ((*c) >> 4) : 0);

return p;
}

/** Get the number of clipped bases (hard clipped and soft clipped) */
inline int32_t NumClip() const {
int32_t p = 0;
uint32_t* c = bam_get_cigar(b);
for (size_t i = 0; i < b->core.n_cigar; ++i)
if ( (bam_cigar_opchr(c[i]) == 'S') || (bam_cigar_opchr(c[i]) == 'H') )
p += bam_cigar_oplen(c[i]);
return p;
return NumSoftClip() + NumHardClip();
}

/** Get a string (Z) tag
Expand Down
2 changes: 1 addition & 1 deletion SeqLib/RefGenome.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <cstdlib>
#include <iostream>

#include "htslib/htslib/faidx.h"
#include <htslib/faidx.h>

namespace SeqLib {

Expand Down
2 changes: 1 addition & 1 deletion bwa
Submodule bwa updated 18 files
+3 −1 Makefile
+49 −0 NEWS.md
+2 −2 bwa.1
+5 −2 bwa.c
+7 −0 bwa.h
+2 −2 bwakit/run-bwamem
+25 −0 bwamem.c
+1 −0 bwamem.h
+3 −1 bwamem_extra.c
+6 −1 bwamem_pair.c
+1 −1 bwape.c
+1 −0 bwase.c
+1 −1 bwtsw2_pair.c
+3 −1 fastmap.c
+1 −1 kstring.h
+10 −16 kthread.c
+1 −1 main.c
+1 −1 qualfa2fq.pl
1 change: 0 additions & 1 deletion htslib
Submodule htslib deleted from 49fdfb
5 changes: 5 additions & 0 deletions src/BamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ void BamReader::Reset() {
return false;
}

size_t BamReader::GetRegionIdx() {
// this ought to be in sync across all open BAMs
return m_bams.begin()->second.m_region_idx;
}

bool BamReader::Open(const std::string& bam) {

// dont open same bam twice
Expand Down
2 changes: 1 addition & 1 deletion src/ReadFilter.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "SeqLib/ReadFilter.h"

#include <cassert>
#include "htslib/htslib/khash.h"
#include <htslib/khash.h>

//#define QNAME "D0EN0ACXX111207:7:2306:6903:136511"
//#define QFLAG -1
Expand Down