Samtools implements various utilities for post-processing alignments in the

SAM, BAM, and CRAM formats, including indexing, variant calling (in conjunction
with bcftools), and a simple alignment viewer.

WWW: http://www.htslib.org/

PR:		195592
Submitted by:	Reed A. Cartwright <cartwright@asu.edu>
This commit is contained in:
Pawel Pekala 2014-12-15 21:59:19 +00:00
parent e9c505591d
commit dc1d64b572
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=374767
8 changed files with 169 additions and 0 deletions

View File

@ -76,6 +76,7 @@
SUBDIR += python-nexus
SUBDIR += recombine
SUBDIR += ruby-bio
SUBDIR += samtools
SUBDIR += seaview
SUBDIR += seqan
SUBDIR += seqio

34
biology/samtools/Makefile Normal file
View File

@ -0,0 +1,34 @@
# Created by: Reed A. Cartwright <cartwright@asu.edu>
# $FreeBSD$
PORTNAME= samtools
PORTVERSION= 1.1
CATEGORIES= biology
MAINTAINER= cartwright@asu.edu
COMMENT= Tools for manipulating next-generation sequencing data
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libhts.so:${PORTSDIR}/biology/htslib
USE_GITHUB= yes
GH_ACCOUNT= samtools
GH_COMMIT= 34c6691
USES= gmake
SUB_FILES= pkg-message
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
MAKE_ENV= INSTALL_LIB="${INSTALL_LIB}" \
INSTALL_DATA="${INSTALL_DATA}" \
INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
INSTALL_DIR="${MKDIR}"
PLIST_SUB= PORTVERSION="${PORTVERSION}"
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (samtools-1.1.tar.gz) = adf674bef85e6ffd88d19178a46f229fc033c7302610d5a51ef9709dd0346c59
SIZE (samtools-1.1.tar.gz) = 4321336

View File

@ -0,0 +1,85 @@
--- Makefile.orig 2014-09-19 15:51:42 UTC
+++ Makefile
@@ -21,12 +21,12 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
-CC = gcc
-CPPFLAGS = $(DFLAGS) $(INCLUDES)
-CFLAGS = -g -Wall -O2
-LDFLAGS =
-LDLIBS =
-DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1
+CC ?= cc
+CPPFLAGS += $(DFLAGS) $(INCLUDES)
+CFLAGS += -Wall -Wno-unused-function -Wno-implicit-function-declaration
+LDFLAGS +=
+LDLIBS +=
+DFLAGS= -D_CURSES_LIB=1
LOBJS= bam_aux.o bam.o bam_import.o sam.o \
sam_header.o bam_plbuf.o
AOBJS= bam_index.o bam_plcmd.o sam_view.o \
@@ -39,19 +39,12 @@ AOBJS= bam_index.o bam_plcmd.o sam_
INCLUDES= -I. -I$(HTSDIR)
LIBCURSES= -lcurses # -lXCurses
-prefix = /usr/local
+prefix = ${STAGEDIR}${PREFIX}
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
-mandir = $(prefix)/share/man
+mandir = $(prefix)/man
man1dir = $(mandir)/man1
-MKDIR_P = mkdir -p
-INSTALL = install -p
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL) -m 644
-INSTALL_DIR = $(MKDIR_P) -m 755
-
-
PROGRAMS = samtools
BUILT_MISC_PROGRAMS = \
@@ -59,7 +52,6 @@ BUILT_MISC_PROGRAMS = \
misc/md5fa misc/md5sum-lite misc/wgsim
MISC_PROGRAMS = \
- $(BUILT_MISC_PROGRAMS) \
misc/blast2sam.pl misc/bowtie2sam.pl misc/export2sam.pl \
misc/interpolate_sam.pl misc/novo2sam.pl \
misc/plot-bamstats misc/psl2sam.pl \
@@ -82,9 +74,8 @@ all: $(PROGRAMS) $(BUILT_MISC_PROGRAMS)
# Adjust $(HTSDIR) to point to your top-level htslib directory
-HTSDIR = ../htslib
-include $(HTSDIR)/htslib.mk
-HTSLIB = $(HTSDIR)/libhts.a
+HTSDIR = $(prefix)/include
+HTSLIB = -lhts
BGZIP = $(HTSDIR)/bgzip
@@ -121,7 +112,7 @@ lib:libbam.a
libbam.a:$(LOBJS)
$(AR) -csru $@ $(LOBJS)
-samtools: $(AOBJS) libbam.a $(HTSLIB)
+samtools: $(AOBJS) libbam.a
$(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) libbam.a $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
bam_h = bam.h $(htslib_bgzf_h) $(htslib_sam_h)
@@ -269,8 +260,10 @@ misc/md5sum-lite.o: misc/md5.c misc/md5.
install: $(PROGRAMS) $(BUILT_MISC_PROGRAMS)
- $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
- $(INSTALL_PROGRAM) $(PROGRAMS) $(MISC_PROGRAMS) $(DESTDIR)$(bindir)
+ $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)/samtools_misc $(DESTDIR)$(man1dir)
+ $(INSTALL_PROGRAM) $(PROGRAMS) $(DESTDIR)$(bindir)
+ $(INSTALL_PROGRAM) $(BUILT_MISC_PROGRAMS) $(DESTDIR)$(bindir)/samtools_misc
+ $(INSTALL_SCRIPT) $(MISC_PROGRAMS) $(DESTDIR)$(bindir)/samtools_misc
$(INSTALL_DATA) samtools.1 $(DESTDIR)$(man1dir)

View File

@ -0,0 +1,18 @@
--- errmod.c.orig 2014-12-15 20:22:22 UTC
+++ errmod.c
@@ -24,6 +24,15 @@ FROM, OUT OF OR IN CONNECTION WITH THE S
DEALINGS IN THE SOFTWARE. */
#include <math.h>
+
+#include <sys/param.h>
+#ifdef __FreeBSD__
+# if __FreeBSD_version < 1000034
+# define logl(x) log(x)
+# define expl(x) exp(x)
+# endif
+#endif
+
#include "errmod.h"
#include "htslib/ksort.h"
KSORT_INIT_GENERIC(uint16_t)

View File

@ -0,0 +1,2 @@
Add %%PREFIX%%/bin/samtools_misc to your path to use miscellaneous tools.

View File

@ -0,0 +1,5 @@
Samtools implements various utilities for post-processing alignments in the
SAM, BAM, and CRAM formats, including indexing, variant calling (in conjunction
with bcftools), and a simple alignment viewer.
WWW: http://www.htslib.org/

View File

@ -0,0 +1,22 @@
bin/samtools
bin/samtools_misc/ace2sam
bin/samtools_misc/blast2sam.pl
bin/samtools_misc/bowtie2sam.pl
bin/samtools_misc/export2sam.pl
bin/samtools_misc/interpolate_sam.pl
bin/samtools_misc/maq2sam-long
bin/samtools_misc/maq2sam-short
bin/samtools_misc/md5fa
bin/samtools_misc/md5sum-lite
bin/samtools_misc/novo2sam.pl
bin/samtools_misc/plot-bamstats
bin/samtools_misc/psl2sam.pl
bin/samtools_misc/sam2vcf.pl
bin/samtools_misc/samtools.pl
bin/samtools_misc/seq_cache_populate.pl
bin/samtools_misc/soap2sam.pl
bin/samtools_misc/varfilter.py
bin/samtools_misc/wgsim
bin/samtools_misc/wgsim_eval.pl
bin/samtools_misc/zoom2sam.pl
man/man1/samtools.1.gz