From: Heng Li Date: Tue, 24 Mar 2009 10:36:38 +0000 (+0000) Subject: * samtools-0.1.2-17 X-Git-Url: https://git.donarmstrong.com/?p=samtools.git;a=commitdiff_plain;h=98d794938b2ebe8cabe32fde7b0519007e54699d * samtools-0.1.2-17 * incorporating Nils' changes * rename Makefile to Makefile.std and prepare to add the GNU building systerms (also by Nils) --- diff --git a/Makefile b/Makefile deleted file mode 100644 index d4a4101..0000000 --- a/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -CC= gcc -CXX= g++ -CFLAGS= -g -Wall -O2 -m64 #-arch ppc -CXXFLAGS= $(CFLAGS) -DFLAGS= -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 #-D_NO_RAZF #-D_NO_CURSES -OBJS= bam.o bam_import.o bam_pileup.o bam_lpileup.o bam_sort.o bam_index.o \ - razf.o bgzf.o faidx.o bam_tview.o bam_maqcns.o bam_aux.o bam_plcmd.o \ - bam_mate.o bam_rmdup.o glf.o bam_stat.o kstring.o -PROG= razip bgzip samtools -INCLUDES= -LIBS= -lm -lz -SUBDIRS= . misc - -.SUFFIXES:.c .o - -.c.o: - $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@ - -all-recur lib-recur clean-recur cleanlocal-recur install-recur: - @target=`echo $@ | sed s/-recur//`; \ - wdir=`pwd`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - cd $$subdir; \ - $(MAKE) CC="$(CC)" CXX="$(CXX)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \ - INCLUDES="$(INCLUDES)" LIBS="$(LIBS)" $$target || exit 1; \ - cd $$wdir; \ - done; - -all:$(PROG) - -lib:libbam.a - -libbam.a:$(OBJS) - $(AR) -cru $@ $(OBJS) - -samtools:lib bamtk.o - $(CC) $(CFLAGS) -o $@ bamtk.o $(LIBS) -L. -lbam -lcurses - -razip:razip.o razf.o - $(CC) $(CFLAGS) -o $@ razf.o razip.o $(LIBS) - -bgzip:bgzip.o bgzf.o - $(CC) $(CFLAGS) -o $@ bgzf.o bgzip.o $(LIBS) - -razip.o:razf.h -bam.o:bam.h razf.h bam_endian.h -bam_import.o:bam.h kseq.h khash.h razf.h -bam_pileup.o:bam.h razf.h ksort.h -bam_plcmd.o:bam.h faidx.h bam_maqcns.h glf.h -bam_index.o:bam.h khash.h ksort.h razf.h bam_endian.h -bam_lpileup.o:bam.h ksort.h -bam_tview.o:bam.h faidx.h bam_maqcns.h -bam_maqcns.o:bam.h ksort.h bam_maqcns.h -bam_sort.o:bam.h ksort.h razf.h -razf.o:razf.h -glf.o:glf.h - -faidx.o:faidx.h razf.h khash.h -faidx_main.o:faidx.h razf.h - -cleanlocal: - rm -fr gmon.out *.o a.out *.dSYM $(PROG) *~ *.a - -clean:cleanlocal-recur diff --git a/Makefile.std b/Makefile.std new file mode 100644 index 0000000..d4a4101 --- /dev/null +++ b/Makefile.std @@ -0,0 +1,64 @@ +CC= gcc +CXX= g++ +CFLAGS= -g -Wall -O2 -m64 #-arch ppc +CXXFLAGS= $(CFLAGS) +DFLAGS= -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 #-D_NO_RAZF #-D_NO_CURSES +OBJS= bam.o bam_import.o bam_pileup.o bam_lpileup.o bam_sort.o bam_index.o \ + razf.o bgzf.o faidx.o bam_tview.o bam_maqcns.o bam_aux.o bam_plcmd.o \ + bam_mate.o bam_rmdup.o glf.o bam_stat.o kstring.o +PROG= razip bgzip samtools +INCLUDES= +LIBS= -lm -lz +SUBDIRS= . misc + +.SUFFIXES:.c .o + +.c.o: + $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@ + +all-recur lib-recur clean-recur cleanlocal-recur install-recur: + @target=`echo $@ | sed s/-recur//`; \ + wdir=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + cd $$subdir; \ + $(MAKE) CC="$(CC)" CXX="$(CXX)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \ + INCLUDES="$(INCLUDES)" LIBS="$(LIBS)" $$target || exit 1; \ + cd $$wdir; \ + done; + +all:$(PROG) + +lib:libbam.a + +libbam.a:$(OBJS) + $(AR) -cru $@ $(OBJS) + +samtools:lib bamtk.o + $(CC) $(CFLAGS) -o $@ bamtk.o $(LIBS) -L. -lbam -lcurses + +razip:razip.o razf.o + $(CC) $(CFLAGS) -o $@ razf.o razip.o $(LIBS) + +bgzip:bgzip.o bgzf.o + $(CC) $(CFLAGS) -o $@ bgzf.o bgzip.o $(LIBS) + +razip.o:razf.h +bam.o:bam.h razf.h bam_endian.h +bam_import.o:bam.h kseq.h khash.h razf.h +bam_pileup.o:bam.h razf.h ksort.h +bam_plcmd.o:bam.h faidx.h bam_maqcns.h glf.h +bam_index.o:bam.h khash.h ksort.h razf.h bam_endian.h +bam_lpileup.o:bam.h ksort.h +bam_tview.o:bam.h faidx.h bam_maqcns.h +bam_maqcns.o:bam.h ksort.h bam_maqcns.h +bam_sort.o:bam.h ksort.h razf.h +razf.o:razf.h +glf.o:glf.h + +faidx.o:faidx.h razf.h khash.h +faidx_main.o:faidx.h razf.h + +cleanlocal: + rm -fr gmon.out *.o a.out *.dSYM $(PROG) *~ *.a + +clean:cleanlocal-recur diff --git a/bam_sort.c b/bam_sort.c index f089cdf..dbe7495 100644 --- a/bam_sort.c +++ b/bam_sort.c @@ -221,7 +221,7 @@ int bam_sort(int argc, char *argv[]) } } if (optind + 2 > argc) { - fprintf(stderr, "Usage: samtools sort [-n] [-m ] \n"); + fprintf(stderr, "Usage: samtools sort [-n] [-m ] \n"); return 1; } bam_sort_core(is_by_qname, argv[optind], argv[optind+1], max_mem); diff --git a/bam_tview.c b/bam_tview.c index e71a386..77d60a0 100644 --- a/bam_tview.c +++ b/bam_tview.c @@ -257,6 +257,7 @@ void tv_loop(tview_t *tv) tid = tv->curr_tid; pos = tv->left_pos; while (1) { int c = getch(); + if(256 < c) {c = 1 + (c%256);} // Terminal was displaying ctrl-H as 263 via ssh from Mac OS X 10.5 computer switch (c) { case '?': tv_win_help(tv); break; case '\033': diff --git a/bamtk.c b/bamtk.c index be37b63..6f0ff99 100644 --- a/bamtk.c +++ b/bamtk.c @@ -3,7 +3,7 @@ #include "bam.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.2-16" +#define PACKAGE_VERSION "0.1.2-17" #endif int bam_taf2baf(int argc, char *argv[]); diff --git a/misc/Makefile b/misc/Makefile deleted file mode 100644 index 0f65881..0000000 --- a/misc/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -CC= gcc -CXX= g++ -CFLAGS= -g -Wall -O2 -m64 #-arch ppc -CXXFLAGS= $(CFLAGS) -DFLAGS= #-D_FILE_OFFSET_BITS=64 -OBJS= -PROG= faidx md5sum-lite md5fa maq2sam-short maq2sam-long wgsim -INCLUDES= -I.. -LIBS= -lm -lz -SUBDIRS= . - -.SUFFIXES:.c .o - -.c.o: - $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@ - -all:$(PROG) - -lib-recur all-recur clean-recur cleanlocal-recur install-recur: - @target=`echo $@ | sed s/-recur//`; \ - wdir=`pwd`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - cd $$subdir; \ - $(MAKE) CC="$(CC)" CXX="$(CXX)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \ - INCLUDES="$(INCLUDES)" $$target || exit 1; \ - cd $$wdir; \ - done; - -lib: - -wgsim:wgsim.o - $(CC) $(CFLAGS) -o $@ wgsim.o -lm - -faidx:../faidx.c ../faidx.h - $(CC) $(CFLAGS) -D_NO_RAZF -DFAIDX_MAIN -o $@ ../faidx.c - -md5fa:md5.o md5fa.o md5.h ../kseq.h - $(CC) $(CFLAGS) -o $@ md5.o md5fa.o -lz - -md5sum-lite:md5sum-lite.o - $(CC) $(CFLAGS) -o $@ md5sum-lite.o - -md5sum-lite.o:md5.c md5.h - $(CC) -c $(CFLAGS) -DMD5SUM_MAIN -o $@ md5.c - -maq2sam-short:maq2sam.c - $(CC) $(CFLAGS) -o $@ maq2sam.c -lz - -maq2sam-long:maq2sam.c - $(CC) $(CFLAGS) -DMAQ_LONGREADS -o $@ maq2sam.c -lz - -md5fa.o:md5.h md5fa.c - $(CC) $(CFLAGS) -c -I.. -o $@ md5fa.c - -cleanlocal: - rm -fr gmon.out *.o a.out *.dSYM $(PROG) *~ *.a - -clean:cleanlocal-recur diff --git a/misc/Makefile.std b/misc/Makefile.std new file mode 100644 index 0000000..0f65881 --- /dev/null +++ b/misc/Makefile.std @@ -0,0 +1,58 @@ +CC= gcc +CXX= g++ +CFLAGS= -g -Wall -O2 -m64 #-arch ppc +CXXFLAGS= $(CFLAGS) +DFLAGS= #-D_FILE_OFFSET_BITS=64 +OBJS= +PROG= faidx md5sum-lite md5fa maq2sam-short maq2sam-long wgsim +INCLUDES= -I.. +LIBS= -lm -lz +SUBDIRS= . + +.SUFFIXES:.c .o + +.c.o: + $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@ + +all:$(PROG) + +lib-recur all-recur clean-recur cleanlocal-recur install-recur: + @target=`echo $@ | sed s/-recur//`; \ + wdir=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + cd $$subdir; \ + $(MAKE) CC="$(CC)" CXX="$(CXX)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \ + INCLUDES="$(INCLUDES)" $$target || exit 1; \ + cd $$wdir; \ + done; + +lib: + +wgsim:wgsim.o + $(CC) $(CFLAGS) -o $@ wgsim.o -lm + +faidx:../faidx.c ../faidx.h + $(CC) $(CFLAGS) -D_NO_RAZF -DFAIDX_MAIN -o $@ ../faidx.c + +md5fa:md5.o md5fa.o md5.h ../kseq.h + $(CC) $(CFLAGS) -o $@ md5.o md5fa.o -lz + +md5sum-lite:md5sum-lite.o + $(CC) $(CFLAGS) -o $@ md5sum-lite.o + +md5sum-lite.o:md5.c md5.h + $(CC) -c $(CFLAGS) -DMD5SUM_MAIN -o $@ md5.c + +maq2sam-short:maq2sam.c + $(CC) $(CFLAGS) -o $@ maq2sam.c -lz + +maq2sam-long:maq2sam.c + $(CC) $(CFLAGS) -DMAQ_LONGREADS -o $@ maq2sam.c -lz + +md5fa.o:md5.h md5fa.c + $(CC) $(CFLAGS) -c -I.. -o $@ md5fa.c + +cleanlocal: + rm -fr gmon.out *.o a.out *.dSYM $(PROG) *~ *.a + +clean:cleanlocal-recur diff --git a/samtools.1 b/samtools.1 index 1bf96e6..6b1879a 100644 --- a/samtools.1 +++ b/samtools.1 @@ -96,7 +96,7 @@ will be created. .TP .B view -samtools view [-b] [region1 [...]] +samtools view [-bhH] [region1 [...]] Extract/print all or sub alignments in SAM or BAM format. If no region is specified, all the alignments will be printed; otherwise only @@ -110,6 +110,12 @@ format: `chr2', `chr2:1000000' or `chr2:1,000,000-2,000,000'. .TP 8 .B -b Output in the BAM format. +.TP +.B -h +Include the header in the output. +.TP +.B -H +Output the header only. .RE .TP @@ -203,7 +209,7 @@ as in the default format we may not know the mapping quality. .TP .B -c -Call the consensus sequnce using MAQ consensus model. Options +Call the consensus sequence using MAQ consensus model. Options .B -T, .B -N and