Skip to content
Commits on Source (9)
......@@ -21,6 +21,9 @@ SRC_DIR=src
INC_DIR:=include
OBJ_DIR:=obj
RM = rm -f
CP = cp -f
# TODO
#vcfstats.cpp
......@@ -115,7 +118,7 @@ BIN_SOURCES = src/vcfecho.cpp \
# src/vcfsom.cpp
#BINS = $(BIN_SOURCES:.cpp=)
BINS = $(addprefix bin/,$(notdir $(BIN_SOURCES:.cpp=)))
BINS = $(addprefix $(BIN_DIR)/,$(notdir $(BIN_SOURCES:.cpp=)))
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))
TABIX = tabixpp/tabix.o
......@@ -143,11 +146,11 @@ LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2
all: $(OBJECTS) $(BINS) scriptToBin
scriptToBin: $(BINS)
cp scripts/* bin
$(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 = -Ofast -D_FILE_OFFSET_BITS=64 -std=c++0x
#CXXFLAGS = -O2
#CXXFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual
......@@ -166,19 +169,19 @@ gprof:
$(MAKE) CXXFLAGS="$(CXXFLAGS) -pg" all
$(OBJECTS): $(SOURCES) $(HEADERS) $(TABIX) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP) $(FASTAHACK)
$(CXX) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(CXX) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && $(CP) src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
multichoose: pre
cd multichoose && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
cd multichoose && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
intervaltree: pre
cd intervaltree && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
cd intervaltree && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(TABIX): pre
cd tabixpp && INCLUDES="$(HTS_INCLUDES)" LIBPATH="-L. $(HTS_LDFLAGS)" HTSLIB="$(HTS_LIB)" $(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)/
cd smithwaterman && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) *.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
$(DISORDER): $(SMITHWATERMAN)
......@@ -189,23 +192,23 @@ $(LEFTALIGN): $(SMITHWATERMAN)
$(INDELALLELE): $(SMITHWATERMAN)
$(FASTAHACK): pre
cd fastahack && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp Fasta.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
cd fastahack && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) Fasta.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
#$(FSOM):
# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
$(FILEVERCMP): pre
cd filevercmp && make && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/
cd filevercmp && make && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(SHORTBINS): pre
$(MAKE) bin/$@
$(MAKE) $(BIN_DIR)/$@
$(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)\"
libvcflib.a: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) $(TABIX) pre
ar rs libvcflib.a $(OBJECTS) smithwaterman/sw.o $(FASTAHACK) $(SSW) $(FILEVERCMP) $(TABIX)
cp libvcflib.a $(LIB_DIR)
$(CP) libvcflib.a $(LIB_DIR)
test: $(BINS)
......@@ -224,21 +227,21 @@ pull:
update: pull all
clean:
rm -f $(BINS) $(OBJECTS)
rm -f ssw_cpp.o ssw.o
rm -f libvcflib.a
rm -rf $(BIN_DIR)
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 multichoose && $(MAKE) clean
cd fsom && $(MAKE) clean
cd libVCFH && $(MAKE) clean
cd test && $(MAKE) clean
cd filevercmp && $(MAKE) clean
cd intervaltree && $(MAKE) clean
$(RM) $(BINS) $(OBJECTS)
$(RM) ssw_cpp.o ssw.o
$(RM) libvcflib.a
$(RM) -r $(BIN_DIR)
$(RM) -r $(LIB_DIR)
$(RM) -r $(INC_DIR)
$(RM) -r $(OBJ_DIR)
$(MAKE) clean -C tabixpp
$(MAKE) clean -C smithwaterman
$(MAKE) clean -C fastahack
$(MAKE) clean -C multichoose
$(MAKE) clean -C fsom
$(MAKE) clean -C libVCFH
$(MAKE) clean -C test
$(MAKE) clean -C filevercmp
$(MAKE) clean -C intervaltree
.PHONY: clean all test pre
......@@ -5,8 +5,9 @@
#### license: MIT
[![Gitter](https://badges.gitter.im/ekg/vcflib.svg)](https://gitter.im/ekg/vcflib?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/vcflib/vcflib.svg?branch=master)](https://travis-ci.org/vcflib/vcflib)
---
[![Build Status](https://travis-ci.org/vcflib/vcflib.svg?branch=master)](https://travis-ci.org/vcflib/vcflib)
[![C++0x](https://img.shields.io/badge/Language-C++0x-steelblue.svg)](https://www.cprogramming.com/c++11/what-is-c++0x.html)
[![Gitter](https://badges.gitter.im/ekg/vcflib.svg)](https://gitter.im/ekg/vcflib?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## overview
......@@ -25,18 +26,28 @@ It is both:
The API itself provides a quick and extremely permissive method to read and write VCF files.
Extensions and applications of the library provided in the included utilities (*.cpp) comprise the vast bulk of the library's utility for most users.
## download and install
## installation
1. Under the repository name, click to copy the clone URL for the repository. ![](https://help.github.com/assets/images/help/repository/clone-repo-clone-url-button.png)
2. Go to the location where you want the cloned directory to be made: `cd <PathWhereIWantToCloneVcflib>`
3. Type `git clone --recursive`, and then paste the URL you copied in Step 1.
4. Enter the cloned directory and type `make` to compile the programs. If you want to use threading type `make openmp` instead of `make`. Only a few VCFLIB tools are threaded.
### [bioconda](https://bioconda.github.io/user/install.html)
```
conda install -c conda-forge -c bioconda -c defaults vcflib
```
5. Once make is finished the executables are ready in the folder `<PathWhereIWantToCloneVcflib>/vcflib/bin/`. Set this path as an environment variable in the .bashrc file to access executables form everywhere on your proile OR call the executables from the path where they are.
### [homebrew](https://brew.sh)
```
brew install brewsci/bio/vcflib
```
### source
```
git clone --recursive https://github.com/ekg/vcflib.git
cd vcflib
make -j
```
Executables are built into the `./bin` directory in the repository.
A number of shell, perl, python3, and R scripts already reside there.
This makes installation easy, as users can add vcflib/bin
to their path, or copy the contained executables to a directory already in their path.
## usage
......@@ -108,7 +119,7 @@ vcflib provides a variety of functions for VCF manipulation:
* **Classify variants** by annotations in the INFO field using a self-organizing map ([vcfsom](#vcfsom)); **re-estimate their quality** given known variants.
A number of "helper" perl and python scripts (e.g. vcf2bed.py, vcfbiallelic) further extend functionality.
A number of "helper" perl and python3 scripts (e.g. vcf2bed.py, vcfbiallelic) further extend functionality.
In practice, users are encouraged to drive the utilities in the library in a streaming fashion, using pipes, to fully utilize resources on multi-core systems during interactive work. Piping provides a convenient method to interface with other libraries (vcf-tools, BedTools, GATK, htslib, bcftools, freebayes) which interface via VCF files, allowing the composition of an immense variety of processing functions.
......@@ -119,25 +130,6 @@ vcflib is incorporated into several projects, such as [freebayes](https://github
Additionally, developers should be aware of that vcflib contains submodules (git repositories) comprising its dependencies (outside of lzib and a *nix environment).
## installing
vcflib includes submodules, so to obtain vcflib you have to use:
% git clone --recursive git://github.com/ekg/vcflib.git
or
% git clone --recursive https://github.com/ekg/vcflib.git
To build, use Make:
% cd vcflib
% make
Executables are built into the ./bin directory in the repository.
A number of shell, perl, python, and R scripts already reside there.
This makes installation easy, as users can add vcflib/bin to their path, or copy the contained executables to a directory already in their path.
## executables
......@@ -295,18 +287,22 @@ given window size to the left, right, and center of the record.
compressed file which has been indexed with tabix. any number of
regions may be specified.
Filter the specified vcf file using the set of filters.
Filters are specified in the form "<ID> <operator> <value>:
Filter the specified VCF file using the set of filters.
Filters are specified in the form "<ID> <operator> <value>":
-f "DP > 10" # for info fields
-g "GT = 1|1" # for genotype fields
-f "CpG" # for 'flag' fields
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, and negative numbers using 0-N:
-f "! ( DP = 10 )" # depth not-equal 10
-f "GL = ( 0 - 1 )" # genotype-ll equal -1
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
......@@ -782,16 +778,24 @@ pFst is a likelihood ratio test (LRT) quantifying allele frequency differences b
```
INFO: help
INFO: description:
Summarizes genotype counts for bi-allelic SNVs and indel
INFO: output: table of genotype counts for each individual.
INFO: usage: genotypeSummmary --type PL --target 0,1,2,3,4,5,6,7 --file my.vcf --snp
pFst is a probabilistic approach for detecting differences in allele frequencies between two populations.
INFO: required: t,target -- a zero based comma separated list of target individuals corresponding to VCF columns
INFO: required: f,file -- proper formatted VCF
INFO: required, y,type -- genotype likelihood format; genotype : GL,PL,GP
INFO: optional, r,region -- a tabix compliant region : chr1:1-1000 or chr1
INFO: optional, s,snp -- Only count SNPs
Output : 3 columns :
1. seqid
2. position
3. pFst probability
INFO: usage: pFst --target 0,1,2,3,4,5,6,7 --background 11,12,13,16,17,19,22 --file my.vcf --deltaaf 0.1 --type PL
INFO: required: t,target -- argument: a zero based comma separated list of target individuals corresponding to VCF columns
INFO: required: b,background -- argument: a zero based comma separated list of background individuals corresponding to VCF columns
INFO: required: f,file -- argument: a properly formatted VCF.
INFO: required: y,type -- argument: genotype likelihood format ; genotypes: GP, GL or PL; pooled: PO
INFO: optional: d,deltaaf -- argument: skip sites where the difference in allele frequencies is less than deltaaf, default is zero
INFO: optional: r,region -- argument: a tabix compliant genomic range : seqid or seqid:start-end
INFO: optional: c,counts -- switch : use genotype counts rather than genotype likelihoods to estimate parameters, default false
```
### EHH and PI
The 'sequenceDiversity' program calculates extended haplotype homozygosity and pi within a fixed-width sliding window. This requires phased data.
......
The header file debian/include/IntervalTree.h was obtained from
https://github.com/ekg/intervaltree
https://github.com/vcflib/intervaltree
libvcflib (1.0.1+dfsg-1) unstable; urgency=medium
* New upstream release
* Updated homepage URL
* Major rewrite of patches
-- Michael R. Crusoe <michael.crusoe@gmail.com> Wed, 11 Dec 2019 13:11:23 +0100
libvcflib (1.0.0+dfsg-2) unstable; urgency=medium
* Use 2to3 to port to Python3
......
......@@ -17,7 +17,7 @@ Build-Depends: debhelper-compat (= 12),
Standards-Version: 4.4.0
Vcs-Browser: https://salsa.debian.org/med-team/libvcflib
Vcs-Git: https://salsa.debian.org/med-team/libvcflib.git
Homepage: https://github.com/ekg/vcflib
Homepage: https://github.com/vcflib/vcflib
Package: libvcflib1
Architecture: any
......@@ -42,8 +42,7 @@ Description: C++ library for parsing and manipulating VCF files
Package: libvcflib-dev
Architecture: any
Section: libdevel
Depends: ${shlibs:Depends},
${misc:Depends},
Depends: ${misc:Depends},
libvcflib1 (= ${binary:Version}),
libdisorder-dev,
libfastahack-dev,
......
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Contact: Erik Garrison <erik.garrison@bc.edu>
Upstream-Name: vcflib
Source: https://github.com/ekg/vcflib
Source: https://github.com/vcflib/vcflib
Files-Excluded: */paper
src/ssw.*
src/ssw_cpp.*
fastahack
fsom
googletest
libVCFH
smithwaterman
tabixpp
Files: *
Copyright: © 2009-2012 Erik Garrison <erik.garrison@bc.edu>
......
binaries/vcfkeepinfo usr/bin
binaries/vcf2tsv usr/bin
binaries/vcffilter usr/bin
binaries/*.R usr/lib/R/site-library/vcflib
binaries usr/lib/vcflib
bin/vcfkeepinfo usr/bin
bin/vcf2tsv usr/bin
bin/vcffilter usr/bin
bin/*.R usr/lib/R/site-library/vcflib
bin usr/lib/vcflib
debian/wrapper/* usr/bin
Description: Use 2to3 to port to Python3
Bug-Debian: https://bugs.debian.org/936930
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 05 Sep 2019 17:07:24 +0200
--- a/README.md
+++ b/README.md
@@ -108,7 +108,7 @@ vcflib provides a variety of functions f
* **Classify variants** by annotations in the INFO field using a self-organizing map ([vcfsom](#vcfsom)); **re-estimate their quality** given known variants.
-A number of "helper" perl and python scripts (e.g. vcf2bed.py, vcfbiallelic) further extend functionality.
+A number of "helper" perl and python3 scripts (e.g. vcf2bed.py, vcfbiallelic) further extend functionality.
In practice, users are encouraged to drive the utilities in the library in a streaming fashion, using pipes, to fully utilize resources on multi-core systems during interactive work. Piping provides a convenient method to interface with other libraries (vcf-tools, BedTools, GATK, htslib, bcftools, freebayes) which interface via VCF files, allowing the composition of an immense variety of processing functions.
@@ -135,7 +135,7 @@ To build, use Make:
% make
Executables are built into the ./bin directory in the repository.
-A number of shell, perl, python, and R scripts already reside there.
+A number of shell, perl, python3, and R scripts already reside there.
This makes installation easy, as users can add vcflib/bin to their path, or copy the contained executables to a directory already in their path.
--- a/scripts/vcf2bed.py
+++ b/scripts/vcf2bed.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-from __future__ import print_function
+#!/usr/bin/python3
+
import sys
for line in sys.stdin:
--- a/scripts/vcf2sqlite.py
+++ b/scripts/vcf2sqlite.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-from __future__ import print_function
+#!/usr/bin/python3
+
import sys
import re
import sqlite3
@@ -93,7 +93,7 @@ for line in sys.stdin:
pair = pair.split("=")
key = pair[0]
value = pair[1]
- if not infonumbers.has_key(key):
+ if key not in infonumbers:
continue
if infonumbers[key] == -1:
values = value.split(",")
@@ -105,7 +105,7 @@ for line in sys.stdin:
ordered_insertion = []
for field in sorted_fields:
value = "null"
- if info_values.has_key(field):
+ if field in info_values:
value = info_values[field]
if infotypes[field] == "String":
value = "\'" + value + "\'"
--- a/scripts/vcfclearid
+++ b/scripts/vcfclearid
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-from __future__ import print_function
+#!/usr/bin/python3
+
import sys
for line in sys.stdin:
--- a/scripts/vcfclearinfo
+++ b/scripts/vcfclearinfo
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-from __future__ import print_function
+#!/usr/bin/python3
+
import sys
for line in sys.stdin:
--- a/scripts/vcffirstheader
+++ b/scripts/vcffirstheader
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-from __future__ import print_function
+#!/usr/bin/python3
+
import sys
header=True
--- a/scripts/vcfnulldotslashdot
+++ b/scripts/vcfnulldotslashdot
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-from __future__ import print_function, division
+#!/usr/bin/python3
+
import sys
import math
From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: Put the disorder.h include where it is used
--- libvcflib.orig/src/Variant.h
+++ libvcflib/src/Variant.h
@@ -19,7 +19,6 @@
#include "join.h"
#include "tabix.hpp"
#include "SmithWatermanGotoh.h"
-#include "disorder.h"
#include <ssw_cpp.h>
#include "convert.h"
#include "multichoose.h"
--- libvcflib.orig/src/vcfentropy.cpp
+++ libvcflib/src/vcfentropy.cpp
@@ -2,6 +2,7 @@
#include "split.h"
#include "Fasta.h"
#include <getopt.h>
+#include "disorder.h"
using namespace std;
using namespace vcflib;
......@@ -2,12 +2,17 @@ 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 @@
@@ -125,11 +125,11 @@
# 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
+HTS_LDFLAGS ?= -L$(VCF_LIB_LOCAL)/tabixpp/htslib -lhts -lbz2 -lm -lz -llzma
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
-LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2 -lssw
+LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lz -lm -llzma -lbz2 -lssw
all: $(OBJECTS) $(BINS) scriptToBin
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 23 Jun 2016 09:10:54 +0200
Origin: https://github.com/ekg/filevercmp
Description: Inject two files via quilt patch
It would be better to use filevercmp module from gnulib package via
gnulib-tool --import filevercmp
but this would require configure.ac which is not (yet) done.
.
Upstream provides a copy of the code inside gnulib at
https://github.com/ekg/filevercmp
and thus it seems to be simpler to use this here at least for the moment.
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -199,7 +199,12 @@
# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
$(FILEVERCMP): pre
- cd filevercmp && make && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ #mkdir -p filevercmp
+ #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) -c filevercmp.c
+ ln -sf ../filevercmp/filevercmp.h $(VCF_LIB_LOCAL)/$(INC_DIR)/filevercmp.h
$(SHORTBINS): pre
$(MAKE) bin/$@
--- /dev/null
+++ libvcflib/filevercmp/filevercmp.h
@@ -0,0 +1,51 @@
+/*
+ Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
+ Copyright (C) 2001 Anthony Towns <aj@azure.humbug.org.au>
+ Copyright (C) 2008-2009 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef FILEVERCMP_H
+#define FILEVERCMP_H
+
+/* Compare version strings:
+
+ This function compares strings S1 and S2:
+ 1) By PREFIX in the same way as strcmp.
+ 2) Then by VERSION (most similarly to version compare of Debian's dpkg).
+ Leading zeros in version numbers are ignored.
+ 3) If both (PREFIX and VERSION) are equal, strcmp function is used for
+ comparison. So this function can return 0 if (and only if) strings S1
+ and S2 are identical.
+
+ It returns number >0 for S1 > S2, 0 for S1 == S2 and number <0 for S1 < S2.
+
+ This function compares strings, in a way that if VER1 and VER2 are version
+ numbers and PREFIX and SUFFIX (SUFFIX defined as (\.[A-Za-z~][A-Za-z0-9~]*)*)
+ are strings then VER1 < VER2 implies filevercmp (PREFIX VER1 SUFFIX,
+ PREFIX VER2 SUFFIX) < 0.
+
+ This function is intended to be a replacement for strverscmp. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int filevercmp (const char *s1, const char *s2);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FILEVERCMP_H */
--- /dev/null
+++ libvcflib/filevercmp/filevercmp.c
@@ -0,0 +1,180 @@
+/*
+ Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
+ Copyright (C) 2001 Anthony Towns <aj@azure.humbug.org.au>
+ Copyright (C) 2008-2009 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "filevercmp.h"
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <limits.h>
+#include <ctype.h>
+
+/* Match a file suffix defined by this regular expression:
+ /(\.[A-Za-z~][A-Za-z0-9~]*)*$/
+ Scan the string *STR and return a pointer to the matching suffix, or
+ NULL if not found. Upon return, *STR points to terminating NUL. */
+static const char *
+match_suffix (const char **str)
+{
+ const char *match = NULL;
+ bool read_alpha = false;
+ while (**str)
+ {
+ if (read_alpha)
+ {
+ read_alpha = false;
+ if (!isalpha (**str) && '~' != **str)
+ match = NULL;
+ }
+ else if ('.' == **str)
+ {
+ read_alpha = true;
+ if (!match)
+ match = *str;
+ }
+ else if (!isalnum (**str) && '~' != **str)
+ match = NULL;
+ (*str)++;
+ }
+ return match;
+}
+
+/* verrevcmp helper function */
+static inline int
+order (unsigned char c)
+{
+ if (isdigit (c))
+ return 0;
+ else if (isalpha (c))
+ return c;
+ else if (c == '~')
+ return -1;
+ else
+ return (int) c + UCHAR_MAX + 1;
+}
+
+/* slightly modified verrevcmp function from dpkg
+ S1, S2 - compared string
+ S1_LEN, S2_LEN - length of strings to be scanned
+
+ This implements the algorithm for comparison of version strings
+ specified by Debian and now widely adopted. The detailed
+ specification can be found in the Debian Policy Manual in the
+ section on the `Version' control field. This version of the code
+ implements that from s5.6.12 of Debian Policy v3.8.0.1
+ http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version */
+static int
+verrevcmp (const char *s1, size_t s1_len, const char *s2, size_t s2_len)
+{
+ size_t s1_pos = 0;
+ size_t s2_pos = 0;
+ while (s1_pos < s1_len || s2_pos < s2_len)
+ {
+ int first_diff = 0;
+ while ((s1_pos < s1_len && !isdigit (s1[s1_pos]))
+ || (s2_pos < s2_len && !isdigit (s2[s2_pos])))
+ {
+ int s1_c = (s1_pos == s1_len) ? 0 : order (s1[s1_pos]);
+ int s2_c = (s2_pos == s2_len) ? 0 : order (s2[s2_pos]);
+ if (s1_c != s2_c)
+ return s1_c - s2_c;
+ s1_pos++;
+ s2_pos++;
+ }
+ while (s1[s1_pos] == '0')
+ s1_pos++;
+ while (s2[s2_pos] == '0')
+ s2_pos++;
+ while (isdigit (s1[s1_pos]) && isdigit (s2[s2_pos]))
+ {
+ if (!first_diff)
+ first_diff = s1[s1_pos] - s2[s2_pos];
+ s1_pos++;
+ s2_pos++;
+ }
+ if (isdigit (s1[s1_pos]))
+ return 1;
+ if (isdigit (s2[s2_pos]))
+ return -1;
+ if (first_diff)
+ return first_diff;
+ }
+ return 0;
+}
+
+/* Compare version strings S1 and S2.
+ See filevercmp.h for function description. */
+int
+filevercmp (const char *s1, const char *s2)
+{
+ const char *s1_pos;
+ const char *s2_pos;
+ const char *s1_suffix, *s2_suffix;
+ size_t s1_len, s2_len;
+ int result;
+
+ /* easy comparison to see if strings are identical */
+ int simple_cmp = strcmp (s1, s2);
+ if (simple_cmp == 0)
+ return 0;
+
+ /* special handle for "", "." and ".." */
+ if (!*s1)
+ return -1;
+ if (!*s2)
+ return 1;
+ if (0 == strcmp (".", s1))
+ return -1;
+ if (0 == strcmp (".", s2))
+ return 1;
+ if (0 == strcmp ("..", s1))
+ return -1;
+ if (0 == strcmp ("..", s2))
+ return 1;
+
+ /* special handle for other hidden files */
+ if (*s1 == '.' && *s2 != '.')
+ return -1;
+ if (*s1 != '.' && *s2 == '.')
+ return 1;
+ if (*s1 == '.' && *s2 == '.')
+ {
+ s1++;
+ s2++;
+ }
+
+ /* "cut" file suffixes */
+ s1_pos = s1;
+ s2_pos = s2;
+ s1_suffix = match_suffix (&s1_pos);
+ s2_suffix = match_suffix (&s2_pos);
+ s1_len = (s1_suffix ? s1_suffix : s1_pos) - s1;
+ s2_len = (s2_suffix ? s2_suffix : s2_pos) - s2;
+
+ /* restore file suffixes if strings are identical after "cut" */
+ if ((s1_suffix || s2_suffix) && (s1_len == s2_len)
+ && 0 == strncmp (s1, s2, s1_len))
+ {
+ s1_len = s1_pos - s1;
+ s2_len = s2_pos - s2;
+ }
+
+ result = verrevcmp (s1, s1_len, s2, s2_len);
+ return result == 0 ? simple_cmp : result;
+}
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 13 Sep 2018 19:35:33 +0200
Description: Upstream should use consistent installation target dir
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -142,7 +142,7 @@
all: $(OBJECTS) $(BINS) scriptToBin
scriptToBin: $(BINS)
- cp scripts/* bin
+ cp scripts/* $(BIN_DIR)
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always)
......@@ -2,45 +2,127 @@ From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: Pass CPPFLAGS
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -146,7 +146,7 @@
@@ -125,7 +125,7 @@
# 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
+HTS_LDFLAGS ?= -L$(VCF_LIB_LOCAL)/tabixpp/htslib -lhts -lbz2 -lm -lz -llzma $(LDFLAGS)
INCLUDES = $(HTS_INCLUDES) -I$(INC_DIR)
@@ -138,7 +138,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 = -Ofast -D_FILE_OFFSET_BITS=64 -std=c++0x
+CXXFLAGS += -Ofast -D_FILE_OFFSET_BITS=64 -std=c++0x
#CXXFLAGS = -O2
#CXXFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual
@@ -161,9 +161,8 @@
gprof:
@@ -152,28 +152,28 @@
$(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)/
$(OBJECTS): $(SOURCES) $(HEADERS) multichoose pre $(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) $(LDLIBS) && $(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
- cd multichoose && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ cd multichoose && LDFLAGS="$(HTS_LDFLAGS)" $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
intervaltree: pre
- cd intervaltree && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ cd intervaltree && LDFLAGS="$(HTS_LDFLAGS)" $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(TABIX): pre
echo "No need to create separately packaged tabixpp"
$(FILEVERCMP): pre
- cd filevercmp && make && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ cd filevercmp && LDFLAGS="$(HTS_LDFLAGS)" $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(SHORTBINS): pre
$(MAKE) $(BIN_DIR)/$@
$(BINS): $(BIN_SOURCES) libvcflib.so $(OBJECTS) $(SMITHWATERMAN) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre intervaltree
$(BINS): $(BIN_SOURCES) libvcflib.so $(OBJECTS) $(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)\"
+ $(CXX) $(CPPFLAGS) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\" $(LDLIBS)
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)
libvcflib.so: $(OBJECTS) $(FILEVERCMP) pre
- $(CC) -shared -Wl,-soname -Wl,libvcflib.so.1 -o libvcflib.so.1 $(OBJECTS) $(FILEVERCMP)
+ $(CC) $(HTS_LDFLAGS) -shared -Wl,-soname -Wl,libvcflib.so.1 -o libvcflib.so.1 $(OBJECTS) $(FILEVERCMP) $(LDLIBS)
ln -s libvcflib.so.1 libvcflib.so
cp -a libvcflib.so* $(LIB_DIR)
$(CP) -a libvcflib.so* $(LIB_DIR)
@@ -199,10 +199,10 @@
$(RM) -r $(LIB_DIR)
$(RM) -r $(INC_DIR)
$(RM) -r $(OBJ_DIR)
- $(MAKE) clean -C multichoose
- $(MAKE) clean -C libVCFH
- $(MAKE) clean -C test
- $(MAKE) clean -C filevercmp
- $(MAKE) clean -C intervaltree
+ +$(MAKE) clean -C multichoose
+ +$(MAKE) clean -C libVCFH
+ +$(MAKE) clean -C test
+ +$(MAKE) clean -C filevercmp
+ +$(MAKE) clean -C intervaltree
.PHONY: clean all test pre
--- libvcflib.orig/filevercmp/Makefile
+++ libvcflib/filevercmp/Makefile
@@ -7,7 +7,7 @@
.PHONY: all clean
filevercmp.o: filevercmp.c main.c filevercmp.h
- gcc -c filevercmp.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c filevercmp.c
filevercmp: filevercmp.o
- gcc -o filevercmp main.c filevercmp.o
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o filevercmp main.c filevercmp.o
--- libvcflib.orig/intervaltree/Makefile
+++ libvcflib/intervaltree/Makefile
@@ -8,7 +8,7 @@
# FreeBSD ports, MacPorts, pkgsrc, etc.)
CXX ?= c++
-CXXFLAGS ?= -Wall
+CXXFLAGS += -Wall
DESTDIR ?= stage
PREFIX ?= /usr/local
MKDIR ?= mkdir
@@ -20,7 +20,7 @@
all: ${BIN}
${BIN}: interval_tree_test.cpp IntervalTree.h
- ${CXX} ${CXXFLAGS} interval_tree_test.cpp -std=c++0x -o ${BIN}
+ ${CXX} $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) interval_tree_test.cpp -std=c++0x -o ${BIN}
install: all
${MKDIR} -p ${DESTDIR}${PREFIX}/bin
--- libvcflib.orig/multichoose/Makefile
+++ libvcflib/multichoose/Makefile
@@ -5,16 +5,16 @@
all: multichoose multipermute
#multichoose_recursive: multichoose_recursive.cpp
-# ${CXX} multichoose_recursive.cpp -o multichoose_recursive
+# ${CXX} $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) multichoose_recursive.cpp -o multichoose_recursive
multichoose: multichoose.cpp multichoose.h
- ${CXX} multichoose.cpp -o multichoose
+ ${CXX} $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) multichoose.cpp -o multichoose
multipermute: multipermute.cpp multipermute.h
- ${CXX} multipermute.cpp -o multipermute
+ ${CXX} $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) multipermute.cpp -o multipermute
cmultichoose: multichoose.c
- ${CC} multichoose.c -o cmultichoose
+ ${CC} $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) multichoose.c -o cmultichoose
clean:
rm -f cmultichoose
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 15 Sep 2016 22:26:26 +0200
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
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -15,7 +15,7 @@
OBJECTS= $(SOURCES:.cpp=.o)
VCF_LIB_LOCAL:=$(shell pwd)
-BIN_DIR:=bin
+BIN_DIR:=binaries
LIB_DIR:=lib
SRC_DIR=src
INC_DIR:=include
@@ -115,7 +115,7 @@
# src/vcfsom.cpp
#BINS = $(BIN_SOURCES:.cpp=)
-BINS = $(addprefix bin/,$(notdir $(BIN_SOURCES:.cpp=)))
+BINS = $(addprefix $(BIN_DIR)/,$(notdir $(BIN_SOURCES:.cpp=)))
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))
# TABIX = tabixpp/tabix.o
@@ -192,7 +192,7 @@
ln -sf ../filevercmp/filevercmp.h $(VCF_LIB_LOCAL)/$(INC_DIR)/filevercmp.h
$(SHORTBINS): pre
- $(MAKE) bin/$@
+ $(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)\"
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 23 Jun 2016 09:10:54 +0200
Origin: https://github.com/ekg/multichoose/blob/master/multichoose.h
Description: Provide a needed header file
--- /dev/null
+++ b/src/multichoose.h
@@ -0,0 +1,79 @@
+#ifndef __MULTICHOOSE_H
+#define __MULTICHOOSE_H
+
+/*
+
+multichoose.h -- n multichoose k for generic vectors
+
+author: Erik Garrison <erik.garrison@bc.edu>
+last revised: 2010-04-16
+
+Copyright (c) 2010 by Erik Garrison
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+
+
+// provides multiset combinations out of the std::vector of objects
+template <class T>
+std::vector< std::vector<T> > multichoose(int k, std::vector<T>& objects) {
+
+ std::vector< std::vector<T> > choices;
+
+ int j,j_1,q,r;
+
+ r = objects.size() - 1;
+
+ // combination indexes
+ std::vector<T*> a, b;
+
+ for (int i=0;i<k;i++) {
+ a.push_back(&objects[0]); b.push_back(&objects[r]);
+ }
+
+ j=k;
+ while(1){
+ std::vector<T> multiset;
+ for(int i=0;i<k;i++)
+ multiset.push_back(*a[i]);
+ choices.push_back(multiset);
+ j=k;
+ do { j--; } while(a[j]==b[j]);
+ if (j<0) break;
+ j_1=j;
+ while(j_1<=k-1){
+ a[j_1]=a[j_1]+1;
+ q=j_1;
+ while(q<k-1) {
+ a[q+1]=a[q];
+ q++;
+ }
+ q++;
+ j_1=q;
+ }
+ }
+
+ return choices;
+}
+
+#endif
From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: fsom is not used
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -114,9 +114,6 @@
src/vcfnull2ref.cpp \
src/vcfinfosummarize.cpp
-# when we can figure out how to build on mac
-# src/vcfsom.cpp
-
#BINS = $(BIN_SOURCES:.cpp=)
BINS = $(addprefix $(BIN_DIR)/,$(notdir $(BIN_SOURCES:.cpp=)))
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))
@@ -128,7 +125,6 @@
INDELALLELE = smithwaterman/IndelAllele.o
DISORDER = smithwaterman/disorder.o
LEFTALIGN = smithwaterman/LeftAlign.o
-FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o
# Work out how to find htslib
@@ -194,9 +190,6 @@
$(FASTAHACK): pre
cd fastahack && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) Fasta.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
-#$(FSOM):
-# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
-
$(FILEVERCMP): pre
cd filevercmp && make && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/
@@ -238,7 +231,6 @@
$(MAKE) clean -C smithwaterman
$(MAKE) clean -C fastahack
$(MAKE) clean -C multichoose
- $(MAKE) clean -C fsom
$(MAKE) clean -C libVCFH
$(MAKE) clean -C test
$(MAKE) clean -C filevercmp
--- libvcflib.orig/README.md
+++ libvcflib/README.md
@@ -116,7 +116,6 @@
* Generate potential **primers** from VCF records ([vcfprimers](#vcfprimers)), to check for genome uniqueness.
* Convert the numerical represenation of genotypes provided by the GT field to a **human-readable genotype format** ([vcfgenotypes](#vcfgenotypes)).
* Observe how different alignment parameters, including context and entropy-dependent ones, influence **variant classification and interpretation** ([vcfremap](#vcfremap)).
- * **Classify variants** by annotations in the INFO field using a self-organizing map ([vcfsom](#vcfsom)); **re-estimate their quality** given known variants.
A number of "helper" perl and python3 scripts (e.g. vcf2bed.py, vcfbiallelic) further extend functionality.
@@ -571,47 +570,6 @@
Prints the names of the samples in the VCF file.
-### vcfsom
-
- usage: vcfsom [options] [vcf file]
-
- training:
- vcfsom -s output.som -f "AF DP ABP" training.vcf
-
- application:
- vcfsom -a output.som -f "AF DP ABP" test.vcf >results.vcf
-
-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
-
- options:
-
- -h, --help this dialog
-
- training:
-
- -f, --fields "FIELD ..." INFO fields to provide to the SOM
- -a, --apply FILE apply the saved map to input data to FILE
- -s, --save FILE train on input data and save the map to FILE
- -t, --print-training-results
- print results of SOM on training input
- (you can also just use --apply on the same input)
- -x, --width X width in columns of the output array
- -y, --height Y height in columns of the output array
- -i, --iterations N number of training iterations or epochs
- -d, --debug print timing information
-
- recalibration:
-
- -c, --center X,Y annotate with euclidean distance from center
- -p, --paint-true VCF use VCF file to annotate true variants (multiple)
- -f, --paint-false VCF use VCF file to annotate false variants (multiple)
- -R, --paint-tag TAG provide estimated FDR% in TAG in variant INFO
- -N, --false-negative replace FDR% (false detection) with FNR% (false negative)
-
-
### vcfstats
usage: vcfstats [options] <vcf file>
From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: libVCFH is not used
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -200,7 +200,6 @@
$(RM) -r $(INC_DIR)
$(RM) -r $(OBJ_DIR)
+$(MAKE) clean -C multichoose
- +$(MAKE) clean -C libVCFH
+$(MAKE) clean -C test
+$(MAKE) clean -C filevercmp
+$(MAKE) clean -C intervaltree
......@@ -2,12 +2,12 @@ Author: Michael R. Crusoe
Description: allow us to specify the package version
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -144,7 +144,7 @@
@@ -136,7 +136,7 @@
scriptToBin: $(BINS)
cp scripts/* $(BIN_DIR)
$(CP) scripts/* $(BIN_DIR)
-GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always)
-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 = -Ofast -D_FILE_OFFSET_BITS=64 -std=c++0x
#CXXFLAGS = -O2
no_fsom
use_debian_packaged_tabixpp.patch
use_debian_packaged_smithwaterman.patch
multichoose.h.patch
filevercmp.h.patch
use_debian_packaged_fastahack.patch
intervaltree.patch
shared_lib.patch
keep_R_files.patch
use_debian_packaged_libssw.patch
shared_lib.patch
pkg-config.patch
fix_ssw_cpp_header_name.patch
fix_installation.patch
dont_link_pthread
override_version
hardening-flags
spelling
2to3.patch
no_libVCFH
disorder_include
......@@ -4,100 +4,40 @@ Description: Create shared lib instead of static
--- libvcflib.orig/Makefile
+++ libvcflib/Makefile
@@ -119,11 +119,11 @@
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))
@@ -152,7 +152,7 @@
$(MAKE) CXXFLAGS="$(CXXFLAGS) -pg" all
# TABIX = tabixpp/tabix.o
-SMITHWATERMAN = smithwaterman/SmithWatermanGotoh.o
-REPEATS = smithwaterman/Repeats.o
-INDELALLELE = smithwaterman/IndelAllele.o
-DISORDER = smithwaterman/disorder.o
-LEFTALIGN = smithwaterman/LeftAlign.o
+# SMITHWATERMAN = smithwaterman/SmithWatermanGotoh.o
+# REPEATS = smithwaterman/Repeats.o
+# INDELALLELE = smithwaterman/IndelAllele.o
+# DISORDER = smithwaterman/disorder.o
+# LEFTALIGN = smithwaterman/LeftAlign.o
FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o
@@ -152,8 +152,11 @@
SSW = src/ssw.o src/ssw_cpp.o
-ssw.o: src/ssw.hpp
-ssw_cpp.o:src/ssw_cpp.hpp
+src/ssw.o: src/ssw.h src/ssw.c
+ $(CXX) -c $(CFLAGS) -fPIC -o $@ src/$(*F).c
+
+src/ssw_cpp.o: src/ssw_cpp.cpp src/ssw_cpp.h
+ $(CXX) -c $(CFLAGS) -fPIC -o $@ src/$(*F).cpp
openmp:
$(MAKE) CXXFLAGS="$(CXXFLAGS) -fopenmp -D HAS_OPENMP"
@@ -166,7 +169,7 @@
$(OBJECTS): $(SOURCES) $(HEADERS) $(TABIX) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP)
$(OBJECTS): $(SOURCES) $(HEADERS) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP)
- $(CXX) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ $(CXX) -c $(CFLAGS) -fPIC -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(OBJECTS): $(SOURCES) $(HEADERS) multichoose pre $(FILEVERCMP)
- $(CXX) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && $(CP) src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ $(CXX) -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"
@@ -177,21 +180,6 @@
echo "Source does not contain dir intervaltree"
#cd intervaltree && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
-$(TABIX): pre
- echo "No need to create separately packaged tabixpp"
-
-$(SMITHWATERMAN): pre
- echo "Source does not contain dir smithwaterman"
- #cd smithwaterman && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
-
-$(DISORDER): $(SMITHWATERMAN)
-
-$(REPEATS): $(SMITHWATERMAN)
-
-$(LEFTALIGN): $(SMITHWATERMAN)
-
-$(INDELALLELE): $(SMITHWATERMAN)
-
#$(FSOM):
# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
@@ -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
- cd filevercmp && $(CXX) $(CXXFLAGS) -c filevercmp.c
+ cd filevercmp && $(CXX) $(CXXFLAGS) -fPIC -c filevercmp.c
ln -sf ../filevercmp/filevercmp.h $(VCF_LIB_LOCAL)/$(INC_DIR)/filevercmp.h
cd multichoose && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
@@ -169,13 +169,13 @@
$(SHORTBINS): pre
$(MAKE) bin/$@
$(MAKE) $(BIN_DIR)/$@
-$(BINS): $(BIN_SOURCES) libvcflib.a $(OBJECTS) $(SMITHWATERMAN) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre intervaltree
+$(BINS): $(BIN_SOURCES) libvcflib.so $(OBJECTS) $(SMITHWATERMAN) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre intervaltree
-$(BINS): $(BIN_SOURCES) libvcflib.a $(OBJECTS) $(FILEVERCMP) pre intervaltree
+$(BINS): $(BIN_SOURCES) libvcflib.so $(OBJECTS) $(FILEVERCMP) pre intervaltree
$(CXX) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\"
-libvcflib.a: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre
- ar rs libvcflib.a $(OBJECTS) $(SSW) $(FILEVERCMP)
- cp libvcflib.a $(LIB_DIR)
+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)
-libvcflib.a: $(OBJECTS) $(FILEVERCMP) pre
- ar rs libvcflib.a $(OBJECTS) $(FILEVERCMP)
- $(CP) libvcflib.a $(LIB_DIR)
-
+libvcflib.so: $(OBJECTS) $(FILEVERCMP) pre
+ $(CC) -shared -Wl,-soname -Wl,libvcflib.so.1 -o libvcflib.so.1 $(OBJECTS) $(FILEVERCMP)
+ ln -s libvcflib.so.1 libvcflib.so
+ cp -a libvcflib.so* $(LIB_DIR)
+ $(CP) -a libvcflib.so* $(LIB_DIR)
test: $(BINS)
@@ -232,7 +222,7 @@
@prove -Itests/lib -w tests/*.t
@@ -194,7 +194,7 @@
clean:
rm -f $(BINS) $(OBJECTS)
rm -f ssw_cpp.o ssw.o
- rm -f libvcflib.a
+ rm -f libvcflib.so
rm -rf $(BIN_DIR)
rm -rf $(LIB_DIR)
rm -rf $(INC_DIR)
$(RM) $(BINS) $(OBJECTS)
- $(RM) libvcflib.a
+ $(RM) libvcflib.so*
$(RM) -r $(BIN_DIR)
$(RM) -r $(LIB_DIR)
$(RM) -r $(INC_DIR)