Commit 97a0408b authored by Michael R. Crusoe's avatar Michael R. Crusoe 🏳️‍🌈
Browse files

New upstream version 1.0.1+dfsg

parent 18f9a566
Loading
Loading
Loading
Loading
+32 −29
Original line number Diff line number Diff line
@@ -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
+50 −46
Original line number Diff line number Diff line
@@ -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.

filevercmp/.gitignore

0 → 100644
+3 −0
Original line number Diff line number Diff line
filevercmp.o
filevercmp
*~

filevercmp/Makefile

0 → 100644
+13 −0
Original line number Diff line number Diff line
all: filevercmp

clean:
	rm -f filevercmp
	rm -f filevercmp.o

.PHONY: all clean

filevercmp.o: filevercmp.c main.c filevercmp.h
	gcc -c filevercmp.c

filevercmp: filevercmp.o
	gcc -o filevercmp main.c filevercmp.o

filevercmp/README.md

0 → 100644
+39 −0
Original line number Diff line number Diff line
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 &gt;0 for S1 &gt; S2, 0 for S1 == S2 and number &lt;0 for S1 &lt; 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 &lt; VER2 implies filevercmp (PREFIX VER1 SUFFIX,
PREFIX VER2 SUFFIX) &lt; 0.

This function is intended to be a replacement for strverscmp.

*fine print*


    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/>.
Loading