Skip to content

Commit

Permalink
Small updates to Makefile and README
Browse files Browse the repository at this point in the history
 - lstdc++fs linking depends on GCC/LLVM versions (linking is still
   required even though it's in the standard C++17 library for old
   versions)
 - added `make install` command, placing vcfdist in INSTALLDIR
   (/usr/local/bin)
 - updated README
 - updated demo (THRESHOLD column, ../src/vcfdist -> vcfdist)
  • Loading branch information
TimD1 committed Jan 30, 2024
1 parent 6b4f3bc commit 9c4ba31
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ vcfdist is developed for Linux and its only dependencies are GCC v8+ and HTSlib.
> sudo make install
> export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
```
If you do already have HTSlib installed elsewhere, make sure you've added it to your `LD_LIBRARY_PATH`. At this point, installation is as simple as cloning the repository and building the executable. It should compile in less than one minute.
If you do already have HTSlib installed elsewhere, make sure you've added it to your `LD_LIBRARY_PATH`, and that the HTSlib headers are included during compilation. At this point, installation is as simple as cloning the repository and building the executable. It should compile in less than one minute.

```bash
> git clone https://github.com/timd1/vcfdist
> cd vcfdist/src
> make
> ./vcfdist --version
> sudo make install
> vcfdist --version
vcfdist v2.3.2
```

Expand All @@ -86,7 +87,7 @@ sudo docker run -it timd1/vcfdist:latest vcfdist --help

The <a href="./demo">`demo`</a> directory contains a <a href="./demo/demo.sh">demo script</a> (shown below) and all required inputs. It operates on the first 5 million bases on `chr1`, and should run in about 3 seconds.
```bash
../src/vcfdist \
vcfdist \
query.vcf \
nist-v4.2.1_chr1_5Mb.vcf.gz \
GRCh38_chr1_5Mb.fa \
Expand All @@ -100,7 +101,7 @@ You can expect to see <a href="./demo/output.txt">this output</a>.
To include more details on intermediate results, run it again at higher verbosity by removing the `-v 0` flag.
Please note that your results may not be identical, since vcfdist is under active development and handling of edge-cases may differ between versions.

Please see additional options documented <a href="./src/README.md">here</a>, or run `./vcfdist --help`.
Please see additional options documented <a href="./src/README.md">here</a>, or run `vcfdist --help`.

The output TSV files are documented <a href="./docs/outputs.md">here</a>.

Expand Down
2 changes: 1 addition & 1 deletion demo/demo.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
echo -e "Running vcfdist..."
../src/vcfdist \
vcfdist \
query.vcf \
nist-v4.2.1_chr1_5Mb.vcf.gz \
GRCh38_chr1_5Mb.fa \
Expand Down
12 changes: 6 additions & 6 deletions demo/output.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
PRECISION-RECALL SUMMARY

TYPE MIN_QUAL TRUTH_TP QUERY_TP TRUTH_FN QUERY_FP PREC RECALL F1_SCORE F1_QSCORE
SNP Q >= 0 8222 8222 1 2 0.999757 0.999878 0.999818 37.388565
SNP Q >= 0 8222 8222 1 2 0.999757 0.999878 0.999818 37.388565
SNP NONE Q >= 0 8222 8222 1 2 0.999757 0.999878 0.999818 37.388565
SNP BEST Q >= 0 8222 8222 1 2 0.999757 0.999878 0.999818 37.388565

TYPE MIN_QUAL TRUTH_TP QUERY_TP TRUTH_FN QUERY_FP PREC RECALL F1_SCORE F1_QSCORE
INDEL Q >= 0 876 876 51 12 0.986486 0.944984 0.965289 14.595358
INDEL Q >= 0 876 876 51 12 0.986486 0.944984 0.965289 14.595358
INDEL NONE Q >= 0 876 876 51 12 0.986486 0.944984 0.965289 14.595358
INDEL BEST Q >= 0 876 876 51 12 0.986486 0.944984 0.965289 14.595358

TYPE MIN_QUAL TRUTH_TP QUERY_TP TRUTH_FN QUERY_FP PREC RECALL F1_SCORE F1_QSCORE
SV Q >= 0 0 0 0 0 1.000000 1.000000 1.000000 100.000000
SV Q >= 0 0 0 0 0 1.000000 1.000000 1.000000 100.000000
SV NONE Q >= 0 0 0 0 0 1.000000 1.000000 1.000000 100.000000
SV BEST Q >= 0 0 0 0 0 1.000000 1.000000 1.000000 100.000000
10 changes: 9 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++17 -O3
OBJS = globals.o print.o variant.o dist.o bed.o cluster.o phase.o edit.o timer.o
TARGET = vcfdist
LDLIBS = -lz -lhts -lstdc++fs -lpthread
INSTALLDIR = /usr/local/bin

LDLIBS = -lz -lhts -lpthread
# g++ < 9.1 and llvm < 9.0 require linking to lstdc++fs
# if using g++ >= 9.1 or llvm >= 9.0, please comment the following line
LDLIBS += -lstdc++fs

all: $(TARGET)

install:
cp $(TARGET) $(INSTALLDIR)

$(TARGET): $(OBJS) main.cpp
$(CXX) $(CXXFLAGS) $(OBJS) -o $(TARGET) main.cpp $(LDLIBS)

Expand Down

0 comments on commit 9c4ba31

Please sign in to comment.