Skip to content
Commits on Source (7)
......@@ -128,8 +128,16 @@ LEFTALIGN = smithwaterman/LeftAlign.o
FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o
INCLUDES = -Itabixpp/htslib -I$(INC_DIR) -L. -Ltabixpp/htslib
LDFLAGS = -L$(LIB_DIR) -lvcflib -lhts -lpthread -lz -lm -llzma -lbz2
# Work out how to find htslib
# Use the one we ship in tabixpp unless told otherwise by the environment
HTS_LIB ?= $(VCF_LIB_LOCAL)/tabixpp/htslib/libhts.a
HTS_INCLUDES ?= -I$(VCF_LIB_LOCAL)/tabixpp/htslib
HTS_LDFLAGS ?= -L$(VCF_LIB_LOCAL)/tabixpp/htslib -lhts -lbz2 -lm -lz -llzma -pthread
INCLUDES = $(HTS_INCLUDES) -I$(INC_DIR)
LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2
all: $(OBJECTS) $(BINS) scriptToBin
......@@ -167,7 +175,7 @@ intervaltree: pre
cd intervaltree && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(TABIX): pre
cd tabixpp && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
cd tabixpp && INCLUDES="$(HTS_INCLUDES)" LIBPATH="-L. $(HTS_LDFLAGS)" HTSLIB="$(HTS_LIB)" $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(SMITHWATERMAN): pre
cd smithwaterman && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
......@@ -223,8 +231,14 @@ clean:
rm -rf $(LIB_DIR)
rm -rf $(INC_DIR)
rm -rf $(OBJ_DIR)
cd tabixpp && make clean
cd smithwaterman && make clean
cd fastahack && make clean
cd tabixpp && $(MAKE) clean
cd smithwaterman && $(MAKE) clean
cd fastahack && $(MAKE) clean
cd multichoose && $(MAKE) clean
cd fsom && $(MAKE) clean
cd libVCFH && $(MAKE) clean
cd test && $(MAKE) clean
cd filevercmp && $(MAKE) clean
cd intervaltree && $(MAKE) clean
.PHONY: clean all test pre
......@@ -167,11 +167,9 @@ Uses allele frequencies in the AF info column to estimate phylogeny at multialle
-t, --tag-parsed FLAG Tag records which are split apart of a complex allele
with this flag
If multiple alleleic primitives (gaps or mismatches) are specified in
a single VCF record, split the record into multiple lines, but drop all
INFO fields. "Pure" MNPs are split into multiple SNPs unless the -m
flag is provided. Genotypes are phased where complex alleles have been
decomposed, provided genotypes in the input.
If multiple alleleic primitives (gaps or mismatches) are specified in a single VCF record, split the record into multiple lines, but drop all INFO fields.
"Pure" MNPs are split into multiple SNPs unless the -m flag is provided.
Genotypes are phased where complex alleles have been decomposed, provided genotypes in the input.
### vcfaltcount
......@@ -190,27 +188,23 @@ Counts the number of alternate alleles in the record.
Intersect the records in the VCF file with targets provided in a BED file.
Intersections are done on the reference sequences in the VCF file.
If no VCF filename is specified on the command line (last argument) the VCF
read from stdin.
If no VCF filename is specified on the command line (last argument) the VCF read from stdin.
### vcfannotategenotypes
usage: vcfannotategenotypes <annotation-tag> <vcf file> <vcf file>
annotates genotypes in the first file with genotypes in the second adding the
genotype as another flag to each sample filed in the first file.
annotation-tag is the name of the sample flag which is added to store the
annotation. also adds a 'has\_variant' flag for sites where the second file has
a variant.
Annotates genotypes in the first file with genotypes in the second adding the genotype as another flag to each sample filed in the first file.
Annotation-tag is the name of the sample flag which is added to store the annotation.
Also adds a 'has\_variant' flag for sites where the second file has a variant.
### vcfbreakmulti
usage: vcfbreakmulti [options] [file]
If multiple alleles are specified in a single record, break the record into
multiple lines, preserving allele-specific INFO fields.
If multiple alleles are specified in a single record, break the record into multiple lines, preserving allele-specific INFO fields.
### vcfcheck
......@@ -239,16 +233,18 @@ reflect positional change.
-r --region REGION A region specifier of the form chrN:x-y to bound the merge
Combines VCF files positionally, combining samples when sites and alleles are identical.
Any number of VCF files may be combined. The INFO field and other columns are taken from
one of the files which are combined when records in multiple files match. Alleles must
have identical ordering to be combined into one record. If they do not, multiple records
will be emitted.
Any number of VCF files may be combined.
The INFO field and other columns are taken from one of the files which are combined when records in multiple files match.
Alleles must
have identical ordering to be combined into one record.
If they do not, multiple records will be emitted.
### vcfcommonsamples
usage: vcfcommonsamples <vcf file> <vcf file> outputs each record in the
first file, removing samples not present in the second
usage: vcfcommonsamples <vcf file> <vcf file>
Outputs each record in the first file, removing samples not present in the second.
### vcfcountalleles
......@@ -270,9 +266,9 @@ in the file.
usage: vcfentropy [options] <vcf file>
options: -f, --fasta-reference FASTA reference file to use to obtain
primer sequences -w, --window-size Size of the window over which to
calculate entropy
options:
-f, --fasta-reference FASTA reference file to use to obtain primer sequences
-w, --window-size Size of the window over which to calculate entropy
Anotates the output VCF file with, for each record, EntropyLeft,
EntropyRight, EntropyCenter, which are the entropies of the sequence of the
......@@ -307,18 +303,15 @@ given window size to the left, right, and center of the record.
Operators can be any of: =, !, <, >, |, &
Any number of filters may be specified. They are combined via logical AND
unless --or is specified on the command line. Obtain logical negation through
the use of parentheses, e.g. "! ( DP = 10 )"
Any number of filters may be specified. They are combined via logical AND unless --or is specified on the command line.
Obtain logical negation through the use of parentheses, e.g. "! ( DP = 10 )"
For convenience, you can specify "QUAL" to refer to the quality of the site, even
though it does not appear in the INFO fields.
For convenience, you can specify "QUAL" to refer to the quality of the site, even though it does not appear in the INFO fields.
### vcffixup
Count the allele frequencies across alleles present in each record in the
VCF file. (Similar to vcftools --freq.)
Count the allele frequencies across alleles present in each record in the VCF file. (Similar to vcftools --freq.)
Uses genotypes from the VCF file to correct AC (alternate allele count), AF
(alternate allele frequency), NS (number of called), in the VCF records. For
......@@ -334,10 +327,9 @@ was not called as polymorphic.
usage: vcfflatten [file]
Removes multi-allelic sites by picking the most common alternate. Requires
allele frequency specification 'AF' and use of 'G' and 'A' to specify the
fields which vary according to the Allele or Genotype. VCF file may be
specified on the command line or piped as stdin.
Removes multi-allelic sites by picking the most common alternate.
Requires allele frequency specification 'AF' and use of 'G' and 'A' to specify the fields which vary according to the Allele or Genotype.
VCF file may be specified on the command line or piped as stdin.
### vcfgeno2haplo
......@@ -355,10 +347,9 @@ was not called as polymorphic.
### vcfgenotypecompare
usage: vcfgenotypecompare <other-genotype-tag> <vcf file>
adds statistics to the INFO field of the vcf file describing the
amount of discrepancy between the genotypes (GT) in the vcf file and the
genotypes reported in the <other-genotype-tag>. use this after
vcfannotategenotypes to get correspondence statistics for two vcfs.
Adds statistics to the INFO field of the vcf file describing the amount of discrepancy between the genotypes (GT) in the vcf file and the genotypes reported in the <other-genotype-tag>.
Use this after vcfannotategenotypes to get correspondence statistics for two vcfs.
### vcfgenotypes
......@@ -414,27 +405,28 @@ Adds a field (id) which contains an allele-specific numerical index.
For bed-vcf intersection, alleles which fall into the targets are retained.
For vcf-vcf intersection and union, unify on equivalent alleles within window-size bp
as determined by haplotype comparison alleles.
For vcf-vcf intersection and union, unify on equivalent alleles within window-size bp as determined by haplotype comparison alleles.
### vcfkeepgeno
usage: vcfkeepgeno <vcf file> [FIELD1] [FIELD2] ...
outputs each record in the vcf file, removing FORMAT fields not listed
on the command line from sample specifications in the output
Outputs each record in the vcf file, removing FORMAT fields not listed on the command line from sample specifications in the output.
### vcfkeepinfo
usage: vcfkeepinfo <vcf file> [FIELD1] [FIELD2] ...
outputs each record in the vcf file, removing INFO fields not listed on the command line
Outputs each record in the vcf file, removing INFO fields not listed on the command line.
### vcfkeepsamples
usage: vcfkeepsamples <vcf file> [SAMPLE1] [SAMPLE2] ...
outputs each record in the vcf file, removing samples not listed on the command line
Outputs each record in the vcf file, removing samples not listed on the command line.
### vcfleftalign
......@@ -453,9 +445,9 @@ alignments.
-r, --reference FILE Use this reference as a basis for realignment.
-w, --window N Use a window of this many bp when left aligning (150).
Left-aligns variants in the specified input file or stdin. Window size is determined
dynamically according to the entropy of the regions flanking the indel. These must have
entropy > 1 bit/bp, or be shorter than ~5kb.
Left-aligns variants in the specified input file or stdin.
Window size is determined dynamically according to the entropy of the regions flanking the indel.
These must have entropy > 1 bit/bp, or be shorter than ~5kb.
### vcflength
......@@ -495,12 +487,11 @@ Use `vcfallelicprimitives` to decompose records while preserving format.
-f, --fasta-reference FASTA reference file to use to obtain primer sequences
-l, --primer-length The length of the primer sequences on each side of the variant
For each VCF record, extract the flanking sequences, and write them to stdout as FASTA
records suitable for alignment. This tool is intended for use in designing validation
experiments. Primers extracted which would flank all of the alleles at multi-allelic
sites. The name of the FASTA "reads" indicates the VCF record which they apply to.
The form is >CHROM_POS_LEFT for the 3' primer and >CHROM_POS_RIGHT for the 5' primer,
for example:
For each VCF record, extract the flanking sequences, and write them to stdout as FASTA records suitable for alignment.
This tool is intended for use in designing validation experiments.
Primers extracted which would flank all of the alleles at multi-allelic sites.
The name of the FASTA "reads" indicates the VCF record which they apply to.
The form is >CHROM_POS_LEFT for the 3' primer and >CHROM_POS_RIGHT for the 5' primer, for example:
>20_233255_LEFT
CCATTGTATATATAGACCATAATTTCTTTATCCAATCATCTGTTGATGGA
......@@ -519,8 +510,8 @@ Use `vcfallelicprimitives` to decompose records while preserving format.
-p, --random-seed N use this random seed
Randomly sample sites from an input VCF file, which may be provided as stdin.
Scale the sampling probability by the field specified in KEY. This may be
used to provide uniform sampling across allele frequencies, for instance.
Scale the sampling probability by the field specified in KEY.
This may be used to provide uniform sampling across allele frequencies, for instance.
### vcfremap
......@@ -553,7 +544,8 @@ allele observation) for each genotype.
### vcfremovesamples
usage: vcfremovesamples <vcf file> [SAMPLE1] [SAMPLE2] ...
outputs each record in the vcf file, removing samples listed on the command line
Outputs each record in the vcf file, removing samples listed on the command line.
### vcfroc
......@@ -565,17 +557,17 @@ allele observation) for each genotype.
-w, --window-size N compare records up to this many bp away (default 30)
-r, --reference FILE FASTA reference file
Generates a pseudo-ROC curve using sensitivity and specificity estimated against
a putative truth set. Thresholding is provided by successive QUAL cutoffs.
Generates a pseudo-ROC curve using sensitivity and specificity estimated against a putative truth set.
Thresholding is provided by successive QUAL cutoffs.
### vcfsamplediff
usage: vcfsamplediff <tag> <sample> <sample> [ <sample> ... ] <vcf file>
tags each record where the listed sample genotypes differ with <tag>
Tags each record where the listed sample genotypes differ with <tag>
The first sample is assumed to be germline, the second somatic.
Each record is tagged with <tag>={germline,somatic,loh} to specify the type of
variant given the genotype difference between the two samples.
Each record is tagged with <tag>={germline,somatic,loh} to specify the type of variant given the genotype difference between the two samples.
### vcfsamplenames
......@@ -593,13 +585,10 @@ Prints the names of the samples in the VCF file.
application:
vcfsom -a output.som -f "AF DP ABP" test.vcf >results.vcf
vcfsomtrains and/or applies a self-organizing map to the input VCF data
on stdin, adding two columns for the x and y coordinates of the winning
neuron in the network and an optional euclidean distance from a given
node (--center).
vcfsom trains and/or applies a self-organizing map to the input VCF data on stdin, adding two columns for the x and y coordinates of the winning neuron in the network and an optional euclidean distance from a given node (--center).
If a map is provided via --apply, map will be applied to input without
training. Automated filtering to an estimated FP rate is
If a map is provided via --apply, map will be applied to input without training.
Automated filtering to an estimated FP rate is
options:
......
libvcflib (1.0.0+dfsg-1) UNRELEASED; urgency=medium
* Team upload.
* New upstream version
* libvcflib-tools: promote vcffilter to /usr/bin; add basic autopkgtests
-- Michael R. Crusoe <michael.crusoe@gmail.com> Wed, 04 Sep 2019 09:51:22 +0900
libvcflib (1.0.0~rc2+dfsg-4) unstable; urgency=medium
* Move manpage to vcflib-tools package
......
......@@ -5,207 +5,339 @@
#include <algorithm>
#include <iostream>
#include <memory>
#include <cassert>
template <class T, typename K = std::size_t>
#ifdef USE_INTERVAL_TREE_NAMESPACE
namespace interval_tree {
#endif
template <class Scalar, typename Value>
class Interval {
public:
K start;
K stop;
T value;
Interval(K s, K e, const T& v)
: start(s)
, stop(e)
Scalar start;
Scalar stop;
Value value;
Interval(const Scalar& s, const Scalar& e, const Value& v)
: start(std::min(s, e))
, stop(std::max(s, e))
, value(v)
{}
};
template <class T, typename K>
K intervalStart(const Interval<T,K>& i) {
template <class Scalar, typename Value>
Value intervalStart(const Interval<Scalar,Value>& i) {
return i.start;
}
template <class T, typename K>
K intervalStop(const Interval<T,K>& i) {
template <class Scalar, typename Value>
Value intervalStop(const Interval<Scalar, Value>& i) {
return i.stop;
}
template <class T, typename K>
std::ostream& operator<<(std::ostream& out, Interval<T,K>& i) {
template <class Scalar, typename Value>
std::ostream& operator<<(std::ostream& out, const Interval<Scalar, Value>& i) {
out << "Interval(" << i.start << ", " << i.stop << "): " << i.value;
return out;
}
template <class T, typename K = std::size_t>
class IntervalStartSorter {
template <class Scalar, class Value>
class IntervalTree {
public:
bool operator() (const Interval<T,K>& a, const Interval<T,K>& b) {
typedef Interval<Scalar, Value> interval;
typedef std::vector<interval> interval_vector;
struct IntervalStartCmp {
bool operator()(const interval& a, const interval& b) {
return a.start < b.start;
}
};
template <class T, typename K = std::size_t>
class IntervalTree {
public:
typedef Interval<T,K> interval;
typedef std::vector<interval> intervalVector;
typedef IntervalTree<T,K> intervalTree;
intervalVector intervals;
std::unique_ptr<intervalTree> left;
std::unique_ptr<intervalTree> right;
K center;
struct IntervalStopCmp {
bool operator()(const interval& a, const interval& b) {
return a.stop < b.stop;
}
};
IntervalTree<T,K>(void)
IntervalTree()
: left(nullptr)
, right(nullptr)
, center(0)
{}
private:
std::unique_ptr<intervalTree> copyTree(const intervalTree& orig){
return std::unique_ptr<intervalTree>(new intervalTree(orig));
~IntervalTree() = default;
std::unique_ptr<IntervalTree> clone() const {
return std::unique_ptr<IntervalTree>(new IntervalTree(*this));
}
public:
IntervalTree<T,K>(const intervalTree& other)
IntervalTree(const IntervalTree& other)
: intervals(other.intervals),
left(other.left ? copyTree(*other.left) : nullptr),
right(other.right ? copyTree(*other.right) : nullptr),
left(other.left ? other.left->clone() : nullptr),
right(other.right ? other.right->clone() : nullptr),
center(other.center)
{
}
{}
public:
IntervalTree& operator=(IntervalTree&&) = default;
IntervalTree(IntervalTree&&) = default;
IntervalTree<T,K>& operator=(const intervalTree& other) {
IntervalTree& operator=(const IntervalTree& other) {
center = other.center;
intervals = other.intervals;
left = other.left ? copyTree(*other.left) : nullptr;
right = other.right ? copyTree(*other.right) : nullptr;
left = other.left ? other.left->clone() : nullptr;
right = other.right ? other.right->clone() : nullptr;
return *this;
}
// Note: changes the order of ivals
IntervalTree<T,K>(
intervalVector& ivals,
IntervalTree(
interval_vector&& ivals,
std::size_t depth = 16,
std::size_t minbucket = 64,
K leftextent = 0,
K rightextent = 0,
std::size_t maxbucket = 512
)
std::size_t maxbucket = 512,
Scalar leftextent = 0,
Scalar rightextent = 0)
: left(nullptr)
, right(nullptr)
{
--depth;
IntervalStartSorter<T,K> intervalStartSorter;
if (depth == 0 || (ivals.size() < minbucket && ivals.size() < maxbucket)) {
std::sort(ivals.begin(), ivals.end(), intervalStartSorter);
intervals = ivals;
} else {
const auto minmaxStop = std::minmax_element(ivals.begin(), ivals.end(),
IntervalStopCmp());
const auto minmaxStart = std::minmax_element(ivals.begin(), ivals.end(),
IntervalStartCmp());
if (!ivals.empty()) {
center = (minmaxStart.first->start + minmaxStop.second->stop) / 2;
}
if (leftextent == 0 && rightextent == 0) {
// sort intervals by start
std::sort(ivals.begin(), ivals.end(), intervalStartSorter);
std::sort(ivals.begin(), ivals.end(), IntervalStartCmp());
} else {
assert(std::is_sorted(ivals.begin(), ivals.end(), IntervalStartCmp()));
}
K leftp = 0;
K rightp = 0;
K centerp = 0;
if (depth == 0 || (ivals.size() < minbucket && ivals.size() < maxbucket)) {
std::sort(ivals.begin(), ivals.end(), IntervalStartCmp());
intervals = std::move(ivals);
assert(is_valid().first);
return;
} else {
Scalar leftp = 0;
Scalar rightp = 0;
if (leftextent || rightextent) {
leftp = leftextent;
rightp = rightextent;
} else {
leftp = ivals.front().start;
std::vector<K> stops;
stops.resize(ivals.size());
transform(ivals.begin(), ivals.end(), stops.begin(), intervalStop<T,K>);
rightp = *max_element(stops.begin(), stops.end());
rightp = std::max_element(ivals.begin(), ivals.end(),
IntervalStopCmp())->stop;
}
//centerp = ( leftp + rightp ) / 2;
centerp = ivals.at(ivals.size() / 2).start;
center = centerp;
interval_vector lefts;
interval_vector rights;
intervalVector lefts;
intervalVector rights;
for (typename intervalVector::const_iterator i = ivals.begin(); i != ivals.end(); ++i) {
for (typename interval_vector::const_iterator i = ivals.begin();
i != ivals.end(); ++i) {
const interval& interval = *i;
if (interval.stop < center) {
lefts.push_back(interval);
} else if (interval.start > center) {
rights.push_back(interval);
} else {
assert(interval.start <= center);
assert(center <= interval.stop);
intervals.push_back(interval);
}
}
if (!lefts.empty()) {
left = std::unique_ptr<intervalTree>(new intervalTree(lefts, depth, minbucket, leftp, centerp));
left.reset(new IntervalTree(std::move(lefts),
depth, minbucket, maxbucket,
leftp, center));
}
if (!rights.empty()) {
right = std::unique_ptr<intervalTree>(new intervalTree(rights, depth, minbucket, centerp, rightp));
right.reset(new IntervalTree(std::move(rights),
depth, minbucket, maxbucket,
center, rightp));
}
}
assert(is_valid().first);
}
intervalVector findOverlapping(K start, K stop) const {
intervalVector ov;
this->findOverlapping(start, stop, ov);
return ov;
}
void findOverlapping(K start, K stop, intervalVector& overlapping) const {
// Call f on all intervals near the range [start, stop]:
template <class UnaryFunction>
void visit_near(const Scalar& start, const Scalar& stop, UnaryFunction f) const {
if (!intervals.empty() && ! (stop < intervals.front().start)) {
for (typename intervalVector::const_iterator i = intervals.begin(); i != intervals.end(); ++i) {
const interval& interval = *i;
if (interval.stop >= start && interval.start <= stop) {
overlapping.push_back(interval);
for (auto & i : intervals) {
f(i);
}
}
if (left && start <= center) {
left->visit_near(start, stop, f);
}
if (right && stop >= center) {
right->visit_near(start, stop, f);
}
}
if (left && start <= center) {
left->findOverlapping(start, stop, overlapping);
// Call f on all intervals crossing pos
template <class UnaryFunction>
void visit_overlapping(const Scalar& pos, UnaryFunction f) const {
visit_overlapping(pos, pos, f);
}
if (right && stop >= center) {
right->findOverlapping(start, stop, overlapping);
// Call f on all intervals overlapping [start, stop]
template <class UnaryFunction>
void visit_overlapping(const Scalar& start, const Scalar& stop, UnaryFunction f) const {
auto filterF = [&](const interval& interval) {
if (interval.stop >= start && interval.start <= stop) {
// Only apply f if overlapping
f(interval);
}
};
visit_near(start, stop, filterF);
}
// Call f on all intervals contained within [start, stop]
template <class UnaryFunction>
void visit_contained(const Scalar& start, const Scalar& stop, UnaryFunction f) const {
auto filterF = [&](const interval& interval) {
if (start <= interval.start && interval.stop <= stop) {
f(interval);
}
};
visit_near(start, stop, filterF);
}
intervalVector findContained(K start, K stop) const {
intervalVector contained;
this->findContained(start, stop, contained);
return contained;
interval_vector findOverlapping(const Scalar& start, const Scalar& stop) const {
interval_vector result;
visit_overlapping(start, stop,
[&](const interval& interval) {
result.emplace_back(interval);
});
return result;
}
void findContained(K start, K stop, intervalVector& contained) const {
if (!intervals.empty() && ! (stop < intervals.front().start)) {
for (typename intervalVector::const_iterator i = intervals.begin(); i != intervals.end(); ++i) {
const interval& interval = *i;
if (interval.start >= start && interval.stop <= stop) {
contained.push_back(interval);
interval_vector findContained(const Scalar& start, const Scalar& stop) const {
interval_vector result;
visit_contained(start, stop,
[&](const interval& interval) {
result.push_back(interval);
});
return result;
}
bool empty() const {
if (left && !left->empty()) {
return false;
}
if (!intervals.empty()) {
return false;
}
if (right && !right->empty()) {
return false;
}
return true;
}
if (left && start <= center) {
left->findContained(start, stop, contained);
template <class UnaryFunction>
void visit_all(UnaryFunction f) const {
if (left) {
left->visit_all(f);
}
std::for_each(intervals.begin(), intervals.end(), f);
if (right) {
right->visit_all(f);
}
}
if (right && stop >= center) {
right->findContained(start, stop, contained);
std::pair<Scalar, Scalar> extentBruitForce() const {
struct Extent {
std::pair<Scalar, Scalar> x = {std::numeric_limits<Scalar>::max(),
std::numeric_limits<Scalar>::min() };
void operator()(const interval & interval) {
x.first = std::min(x.first, interval.start);
x.second = std::max(x.second, interval.stop);
}
};
Extent extent;
visit_all([&](const interval & interval) { extent(interval); });
return extent.x;
}
// Check all constraints.
// If first is false, second is invalid.
std::pair<bool, std::pair<Scalar, Scalar>> is_valid() const {
const auto minmaxStop = std::minmax_element(intervals.begin(), intervals.end(),
IntervalStopCmp());
const auto minmaxStart = std::minmax_element(intervals.begin(), intervals.end(),
IntervalStartCmp());
std::pair<bool, std::pair<Scalar, Scalar>> result = {true, { std::numeric_limits<Scalar>::max(),
std::numeric_limits<Scalar>::min() }};
if (!intervals.empty()) {
result.second.first = std::min(result.second.first, minmaxStart.first->start);
result.second.second = std::min(result.second.second, minmaxStop.second->stop);
}
if (left) {
auto valid = left->is_valid();
result.first &= valid.first;
result.second.first = std::min(result.second.first, valid.second.first);
result.second.second = std::min(result.second.second, valid.second.second);
if (!result.first) { return result; }
if (valid.second.second >= center) {
result.first = false;
return result;
}
}
if (right) {
auto valid = right->is_valid();
result.first &= valid.first;
result.second.first = std::min(result.second.first, valid.second.first);
result.second.second = std::min(result.second.second, valid.second.second);
if (!result.first) { return result; }
if (valid.second.first <= center) {
result.first = false;
return result;
}
}
if (!std::is_sorted(intervals.begin(), intervals.end(), IntervalStartCmp())) {
result.first = false;
}
return result;
}
~IntervalTree(void) = default;
friend std::ostream& operator<<(std::ostream& os, const IntervalTree& itree) {
return writeOut(os, itree);
}
friend std::ostream& writeOut(std::ostream& os, const IntervalTree& itree,
std::size_t depth = 0) {
auto pad = [&]() { for (std::size_t i = 0; i != depth; ++i) { os << ' '; } };
pad(); os << "center: " << itree.center << '\n';
for (const interval & inter : itree.intervals) {
pad(); os << inter << '\n';
}
if (itree.left) {
pad(); os << "left:\n";
writeOut(os, *itree.left, depth + 1);
} else {
pad(); os << "left: nullptr\n";
}
if (itree.right) {
pad(); os << "right:\n";
writeOut(os, *itree.right, depth + 1);
} else {
pad(); os << "right: nullptr\n";
}
return os;
}
private:
interval_vector intervals;
std::unique_ptr<IntervalTree> left;
std::unique_ptr<IntervalTree> right;
Scalar center;
};
#ifdef USE_INTERVAL_TREE_NAMESPACE
}
#endif
#endif
binaries/vcfkeepinfo usr/bin
binaries/vcf2tsv usr/bin
binaries/vcffilter usr/bin
binaries/*.R usr/lib/R/site-library/vcflib
binaries usr/lib/vcflib
debian/wrapper/* usr/bin
Author: Michael R. Crusoe <michael.crusoe@gmail.com>
Description: pthread is needed by the libraries we link to, but not us
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -135,7 +135,7 @@
INCLUDES = $(HTS_INCLUDES) -I$(INC_DIR)
-LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2
+LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lz -lm -llzma -lbz2
......@@ -10,9 +10,9 @@ Description: Inject two files via quilt patch
https://github.com/ekg/filevercmp
and thus it seems to be simpler to use this here at least for the moment.
--- a/Makefile
+++ b/Makefile
@@ -191,7 +191,12 @@ $(FASTAHACK): pre
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -199,7 +199,12 @@
# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
$(FILEVERCMP): pre
......@@ -27,7 +27,7 @@ Description: Inject two files via quilt patch
$(SHORTBINS): pre
$(MAKE) bin/$@
--- /dev/null
+++ b/filevercmp/filevercmp.h
+++ libvcflib/filevercmp/filevercmp.h
@@ -0,0 +1,51 @@
+/*
+ Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
......@@ -81,7 +81,7 @@ Description: Inject two files via quilt patch
+
+#endif /* FILEVERCMP_H */
--- /dev/null
+++ b/filevercmp/filevercmp.c
+++ libvcflib/filevercmp/filevercmp.c
@@ -0,0 +1,180 @@
+/*
+ Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
......
......@@ -2,9 +2,9 @@ Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 13 Sep 2018 19:35:33 +0200
Description: Upstream should use consistent installation target dir
--- a/Makefile
+++ b/Makefile
@@ -133,7 +133,7 @@ LDFLAGS = -L$(LIB_DIR) -lvcflib -lhts -l
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -142,7 +142,7 @@
all: $(OBJECTS) $(BINS) scriptToBin
scriptToBin: $(BINS)
......
From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: Pass CPPFLAGS
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -146,7 +146,7 @@
GIT_VERSION ?= $(shell git describe --abbrev=4 --dirty --always)
-CXXFLAGS = -O3 -D_FILE_OFFSET_BITS=64 -std=c++0x
+CXXFLAGS += -O3 -D_FILE_OFFSET_BITS=64 -std=c++0x
#CXXFLAGS = -O2
#CXXFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual
@@ -161,9 +161,8 @@
gprof:
$(MAKE) CXXFLAGS="$(CXXFLAGS) -pg" all
-$(OBJECTS): $(SOURCES) $(HEADERS) $(TABIX) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP)
$(OBJECTS): $(SOURCES) $(HEADERS) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP)
- $(CXX) -c $(CFLAGS) -fPIC -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ $(CXX) $(CPPFLAGS) -c $(CFLAGS) -fPIC -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
multichoose: pre
echo "Source does not contain dir multichoose"
@@ -182,18 +181,18 @@
#cp /usr/share/gnulib/lib/filevercmp.* filevercmp
#echo 'Proper use of filevercmp would be: `gnulib-tool --import filevercmp` - but it needs ./configure.ac'
#We here go with quilt patches from upstream files
- cd filevercmp && $(CXX) $(CXXFLAGS) -fPIC -c filevercmp.c
+ cd filevercmp && $(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC -c filevercmp.c
ln -sf ../filevercmp/filevercmp.h $(VCF_LIB_LOCAL)/$(INC_DIR)/filevercmp.h
$(SHORTBINS): pre
$(MAKE) $(BIN_DIR)/$@
$(BINS): $(BIN_SOURCES) libvcflib.so $(OBJECTS) $(SMITHWATERMAN) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre intervaltree
- $(CXX) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\"
+ $(CXX) $(CPPFLAGS) $(HTS_LDFLAGS) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\"
libvcflib.so: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre
# ar rs libvcflib.a $(OBJECTS) $(SSW) $(FILEVERCMP)
- gcc -shared -Wl,-soname -Wl,libvcflib.so.1 -o libvcflib.so.1 $(OBJECTS) $(SSW) $(FILEVERCMP)
+ gcc $(HTS_LDFLAGS) -shared -Wl,-soname -Wl,libvcflib.so.1 -o libvcflib.so.1 $(OBJECTS) $(SSW) $(FILEVERCMP)
ln -s libvcflib.so.1 libvcflib.so
cp -a libvcflib.so* $(LIB_DIR)
......@@ -3,13 +3,13 @@ Last-Update: Thu, 23 Jun 2016 09:10:54 +0200
Description: We provide a local copy of intervaltree in debian/include and
inject it here in the build system
--- a/Makefile
+++ b/Makefile
@@ -166,6 +166,7 @@ multichoose: pre
intervaltree: pre
echo "Source does not contain dir intervaltree"
# cd intervaltree && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -171,6 +171,7 @@
multichoose: pre
echo "Source does not contain dir multichoose"
#cd multichoose && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ mkdir -p $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp -a debian/include/* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(TABIX): pre
echo "No need to create separately packaged tabixpp"
intervaltree: pre
echo "Source does not contain dir intervaltree"
......@@ -4,9 +4,9 @@ Description: There is a dir bin/ containing some R files which
is removed in clean target. Just use a different output dir
that can be cleaned without problems
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ SOURCES = src/Variant.cpp \
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -15,7 +15,7 @@
OBJECTS= $(SOURCES:.cpp=.o)
VCF_LIB_LOCAL:=$(shell pwd)
......@@ -15,7 +15,7 @@ Description: There is a dir bin/ containing some R files which
LIB_DIR:=lib
SRC_DIR=src
INC_DIR:=include
@@ -115,7 +115,7 @@ BIN_SOURCES = src/vcfecho.cpp \
@@ -115,7 +115,7 @@
# src/vcfsom.cpp
#BINS = $(BIN_SOURCES:.cpp=)
......@@ -24,7 +24,7 @@ Description: There is a dir bin/ containing some R files which
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))
# TABIX = tabixpp/tabix.o
@@ -183,7 +183,7 @@ $(FILEVERCMP): pre
@@ -192,7 +192,7 @@
ln -sf ../filevercmp/filevercmp.h $(VCF_LIB_LOCAL)/$(INC_DIR)/filevercmp.h
$(SHORTBINS): pre
......
Author: Michael R. Crusoe
Description: allow us to specify the package version
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -144,7 +144,7 @@
scriptToBin: $(BINS)
cp scripts/* $(BIN_DIR)
-GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always)
+GIT_VERSION ?= $(shell git describe --abbrev=4 --dirty --always)
CXXFLAGS = -O3 -D_FILE_OFFSET_BITS=64 -std=c++0x
#CXXFLAGS = -O2
......@@ -3,8 +3,8 @@ Last-Update: Fri, 10 Feb 2017 09:09:35 +0100
Description: Add pkg-config file to simplify building of freebayes
--- /dev/null
+++ b/libvcflib.pc
@@ -0,0 +1,11 @@
+++ libvcflib/libvcflib.pc
@@ -0,0 +1,12 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
......@@ -12,7 +12,8 @@ Description: Add pkg-config file to simplify building of freebayes
+
+Name: libvcflib
+Version: 1.0
+Requires: libsmithwaterman, libfastahack
+Description: C++ library for parsing and manipulating VCF files
+Libs: -L${libdir} -lvcflib -lsmithwaterman -ldisorder -lfastahack
+Cflags: -I${includedir} -I/usr/include/smithwaterman -I/usr/include/fastahack
+Libs: -L${libdir} -lvcflib
+Cflags: -I${includedir}
+
......@@ -10,3 +10,6 @@ use_debian_packaged_libssw.patch
pkg-config.patch
fix_ssw_cpp_header_name.patch
fix_installation.patch
dont_link_pthread
override_version
hardening-flags
......@@ -2,9 +2,9 @@ Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 15 Sep 2016 22:26:26 +0200
Description: Create shared lib instead of static
--- a/Makefile
+++ b/Makefile
@@ -119,11 +119,11 @@ BINS = $(addprefix bin/,$(notdir $(BIN_S
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -119,11 +119,11 @@
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))
# TABIX = tabixpp/tabix.o
......@@ -21,7 +21,7 @@ Description: Create shared lib instead of static
FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o
@@ -143,8 +143,11 @@ CXXFLAGS = -O3 -D_FILE_OFFSET_BITS=64 -s
@@ -152,8 +152,11 @@
SSW = src/ssw.o src/ssw_cpp.o
......@@ -35,7 +35,7 @@ Description: Create shared lib instead of static
openmp:
$(MAKE) CXXFLAGS="$(CXXFLAGS) -fopenmp -D HAS_OPENMP"
@@ -157,7 +160,7 @@ gprof:
@@ -166,7 +169,7 @@
$(OBJECTS): $(SOURCES) $(HEADERS) $(TABIX) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP)
$(OBJECTS): $(SOURCES) $(HEADERS) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP)
......@@ -44,13 +44,12 @@ Description: Create shared lib instead of static
multichoose: pre
echo "Source does not contain dir multichoose"
@@ -168,22 +171,6 @@ intervaltree: pre
@@ -177,21 +180,6 @@
echo "Source does not contain dir intervaltree"
#cd intervaltree && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
mkdir -p $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp -a debian/include/* $(VCF_LIB_LOCAL)/$(INC_DIR)/
-$(TABIX): pre
- echo "No need to create separately packaged tabixpp"
- # cd tabixpp && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
-
-$(SMITHWATERMAN): pre
- echo "Source does not contain dir smithwaterman"
......@@ -67,7 +66,7 @@ Description: Create shared lib instead of static
#$(FSOM):
# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
@@ -192,18 +179,20 @@ $(FILEVERCMP): pre
@@ -200,18 +188,20 @@
#cp /usr/share/gnulib/lib/filevercmp.* filevercmp
#echo 'Proper use of filevercmp would be: `gnulib-tool --import filevercmp` - but it needs ./configure.ac'
#We here go with quilt patches from upstream files
......@@ -93,7 +92,7 @@ Description: Create shared lib instead of static
test: $(BINS)
@@ -224,7 +213,7 @@ update: pull all
@@ -232,7 +222,7 @@
clean:
rm -f $(BINS) $(OBJECTS)
rm -f ssw_cpp.o ssw.o
......
......@@ -2,9 +2,9 @@ Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 23 Jun 2016 09:10:54 +0200
Description: Use Debian packaged libfastahack (and libdisorder)
--- a/Makefile
+++ b/Makefile
@@ -119,7 +119,6 @@ BINS = $(addprefix bin/,$(notdir $(BIN_S
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -119,7 +119,6 @@
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))
# TABIX = tabixpp/tabix.o
......@@ -12,18 +12,7 @@ Description: Use Debian packaged libfastahack (and libdisorder)
SMITHWATERMAN = smithwaterman/SmithWatermanGotoh.o
REPEATS = smithwaterman/Repeats.o
INDELALLELE = smithwaterman/IndelAllele.o
@@ -128,8 +127,8 @@ LEFTALIGN = smithwaterman/LeftAlign.o
FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o
-INCLUDES = `pkg-config --cflags libsmithwaterman` -I$(INC_DIR)
-LDFLAGS = -L$(LIB_DIR) -lvcflib -lhts -lpthread -lz -lm -llzma -lbz2 -ltabixpp `pkg-config --libs libsmithwaterman`
+INCLUDES = `pkg-config --cflags libsmithwaterman` `pkg-config --cflags libfastahack` -I$(INC_DIR)
+LDFLAGS = -L$(LIB_DIR) -lvcflib -lhts -lpthread -lz -lm -llzma -lbz2 -ltabixpp `pkg-config --libs libsmithwaterman` `pkg-config --libs libfastahack` -ldisorder
all: $(OBJECTS) $(BINS) scriptToBin
@@ -156,8 +155,8 @@ profiling:
@@ -165,8 +164,8 @@
gprof:
$(MAKE) CXXFLAGS="$(CXXFLAGS) -pg" all
......@@ -34,7 +23,7 @@ Description: Use Debian packaged libfastahack (and libdisorder)
$(CXX) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
multichoose: pre
@@ -184,9 +183,6 @@ $(LEFTALIGN): $(SMITHWATERMAN)
@@ -192,9 +191,6 @@
$(INDELALLELE): $(SMITHWATERMAN)
......@@ -44,7 +33,7 @@ Description: Use Debian packaged libfastahack (and libdisorder)
#$(FSOM):
# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
@@ -201,11 +197,11 @@ $(FILEVERCMP): pre
@@ -209,11 +205,11 @@
$(SHORTBINS): pre
$(MAKE) bin/$@
......@@ -59,11 +48,18 @@ Description: Use Debian packaged libfastahack (and libdisorder)
cp libvcflib.a $(LIB_DIR)
@@ -234,6 +230,6 @@ clean:
@@ -241,10 +237,10 @@
rm -rf $(INC_DIR)
rm -rf $(OBJ_DIR)
# cd tabixpp && make clean
# cd smithwaterman && make clean
- cd fastahack && make clean
+ # cd fastahack && make clean
.PHONY: clean all test pre
#cd smithwaterman && $(MAKE) clean
- cd fastahack && $(MAKE) clean
- cd multichoose && $(MAKE) clean
- cd fsom && $(MAKE) clean
- cd libVCFH && $(MAKE) clean
+ #cd fastahack && $(MAKE) clean
+ #cd multichoose && $(MAKE) clean
+ #cd fsom && $(MAKE) clean
+ #cd libVCFH && $(MAKE) clean
cd test && $(MAKE) clean
cd filevercmp && $(MAKE) clean
cd intervaltree && $(MAKE) clean
......@@ -4,9 +4,9 @@ Bug-Debian: https://bugs.debian.org/838513
Description: Use Debian packaged libssw (while its not clear
why two implementations of Smith-Waterman are needed at all)
--- a/Makefile
+++ b/Makefile
@@ -141,13 +141,7 @@ CXXFLAGS = -O3 -D_FILE_OFFSET_BITS=64 -s
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -150,13 +150,7 @@
#CXXFLAGS = -O2
#CXXFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual
......
......@@ -2,20 +2,9 @@ Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 23 Jun 2016 09:10:54 +0200
Description: Use Debian packaged libsmithwaterman
--- a/Makefile
+++ b/Makefile
@@ -128,8 +128,8 @@ LEFTALIGN = smithwaterman/LeftAlign.o
FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o
-INCLUDES = -I$(INC_DIR)
-LDFLAGS = -L$(LIB_DIR) -lvcflib -lhts -lpthread -lz -lm -llzma -lbz2 -ltabixpp
+INCLUDES = `pkg-config --cflags libsmithwaterman` -I$(INC_DIR)
+LDFLAGS = -L$(LIB_DIR) -lvcflib -lhts -lpthread -lz -lm -llzma -lbz2 -ltabixpp `pkg-config --libs libsmithwaterman`
all: $(OBJECTS) $(BINS) scriptToBin
@@ -161,17 +161,20 @@ $(OBJECTS): $(SOURCES) $(HEADERS) multic
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -170,16 +170,19 @@
$(CXX) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
multichoose: pre
......@@ -30,7 +19,6 @@ Description: Use Debian packaged libsmithwaterman
$(TABIX): pre
echo "No need to create separately packaged tabixpp"
# cd tabixpp && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(SMITHWATERMAN): pre
- cd smithwaterman && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
......@@ -39,7 +27,7 @@ Description: Use Debian packaged libsmithwaterman
$(DISORDER): $(SMITHWATERMAN)
@@ -197,7 +200,7 @@ $(BINS): $(BIN_SOURCES) libvcflib.a $(OB
@@ -205,7 +208,7 @@
$(CXX) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\"
libvcflib.a: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre
......@@ -48,12 +36,12 @@ Description: Use Debian packaged libsmithwaterman
cp libvcflib.a $(LIB_DIR)
@@ -225,7 +228,7 @@ clean:
@@ -232,7 +235,7 @@
rm -rf $(LIB_DIR)
rm -rf $(INC_DIR)
rm -rf $(OBJ_DIR)
# cd tabixpp && make clean
- cd smithwaterman && make clean
+ # cd smithwaterman && make clean
cd fastahack && make clean
.PHONY: clean all test pre
- cd smithwaterman && $(MAKE) clean
+ #cd smithwaterman && $(MAKE) clean
cd fastahack && $(MAKE) clean
cd multichoose && $(MAKE) clean
cd fsom && $(MAKE) clean
......@@ -2,9 +2,9 @@ Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 23 Jun 2016 09:10:54 +0200
Description: Use Debian packaged libtabixpp
--- a/Makefile
+++ b/Makefile
@@ -118,8 +118,8 @@ BIN_SOURCES = src/vcfecho.cpp \
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -118,8 +118,8 @@
BINS = $(addprefix bin/,$(notdir $(BIN_SOURCES:.cpp=)))
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))
......@@ -15,19 +15,7 @@ Description: Use Debian packaged libtabixpp
SMITHWATERMAN = smithwaterman/SmithWatermanGotoh.o
REPEATS = smithwaterman/Repeats.o
INDELALLELE = smithwaterman/IndelAllele.o
@@ -128,9 +128,8 @@ LEFTALIGN = smithwaterman/LeftAlign.o
FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o
-INCLUDES = -Itabixpp/htslib -I$(INC_DIR) -L. -Ltabixpp/htslib
-LDFLAGS = -L$(LIB_DIR) -lvcflib -lhts -lpthread -lz -lm -llzma -lbz2
-
+INCLUDES = -I$(INC_DIR)
+LDFLAGS = -L$(LIB_DIR) -lvcflib -lhts -lpthread -lz -lm -llzma -lbz2 -ltabixpp
all: $(OBJECTS) $(BINS) scriptToBin
@@ -158,6 +157,7 @@ gprof:
@@ -166,6 +166,7 @@
$(MAKE) CXXFLAGS="$(CXXFLAGS) -pg" all
$(OBJECTS): $(SOURCES) $(HEADERS) $(TABIX) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP) $(FASTAHACK)
......@@ -35,17 +23,16 @@ Description: Use Debian packaged libtabixpp
$(CXX) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
multichoose: pre
@@ -167,7 +167,8 @@ intervaltree: pre
@@ -175,7 +176,7 @@
cd intervaltree && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(TABIX): pre
- cd tabixpp && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
- cd tabixpp && INCLUDES="$(HTS_INCLUDES)" LIBPATH="-L. $(HTS_LDFLAGS)" HTSLIB="$(HTS_LIB)" $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ echo "No need to create separately packaged tabixpp"
+ # cd tabixpp && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(SMITHWATERMAN): pre
cd smithwaterman && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
@@ -195,8 +196,8 @@ $(SHORTBINS): pre
@@ -203,8 +204,8 @@
$(BINS): $(BIN_SOURCES) libvcflib.a $(OBJECTS) $(SMITHWATERMAN) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre intervaltree
$(CXX) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\"
......@@ -56,12 +43,11 @@ Description: Use Debian packaged libtabixpp
cp libvcflib.a $(LIB_DIR)
@@ -223,7 +224,7 @@ clean:
@@ -231,7 +232,6 @@
rm -rf $(LIB_DIR)
rm -rf $(INC_DIR)
rm -rf $(OBJ_DIR)
- cd tabixpp && make clean
+ # cd tabixpp && make clean
cd smithwaterman && make clean
cd fastahack && make clean
- cd tabixpp && $(MAKE) clean
cd smithwaterman && $(MAKE) clean
cd fastahack && $(MAKE) clean
cd multichoose && $(MAKE) clean
......@@ -2,7 +2,13 @@
# DH_VERBOSE := 1
include /usr/share/dpkg/default.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS)
export HTS_LIB=
export HTS_INCLUDES=$(shell pkg-config --cflags libsmithwaterman) $(shell pkg-config --cflags libfastahack)
export HTS_LDFLAGS=-ltabixpp -lhts $(shell pkg-config --libs libsmithwaterman) $(shell pkg-config --libs libfastahack) $(shell dpkg-buildflags --get LDFLAGS)
export GIT_VERSION=$(DEB_VERSION)
%:
dh $@
......