├── include ├── zlib-1.2.8 │ ├── libz.so │ ├── libz.so.1 │ ├── lib │ │ ├── libz.1.dylib │ │ ├── libz.dylib │ │ ├── libz.a │ │ ├── libz.1.2.8.dylib │ │ └── pkgconfig │ │ │ └── zlib.pc │ ├── contrib │ │ ├── blast │ │ │ ├── test.txt │ │ │ ├── README │ │ │ ├── test.pk │ │ │ └── Makefile │ │ ├── infback9 │ │ │ ├── README │ │ │ ├── infback9.h │ │ │ ├── inflate9.h │ │ │ └── inftree9.h │ │ ├── README.contrib │ │ ├── masmx64 │ │ │ ├── bld_ml64.bat │ │ │ └── readme.txt │ │ ├── puff │ │ │ ├── zeros.raw │ │ │ ├── puff.h │ │ │ ├── Makefile │ │ │ └── README │ │ ├── masmx86 │ │ │ ├── bld_ml32.bat │ │ │ └── readme.txt │ │ ├── dotzlib │ │ │ ├── DotZLib.chm │ │ │ ├── DotZLib │ │ │ │ ├── DotZLib.cs │ │ │ │ ├── CodecBase.cs │ │ │ │ ├── Deflater.cs │ │ │ │ ├── Inflater.cs │ │ │ │ ├── ChecksumImpl.cs │ │ │ │ ├── GZipStream.cs │ │ │ │ ├── CircularBuffer.cs │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── DotZLib.sln │ │ │ ├── DotZLib.build │ │ │ ├── LICENSE_1_0.txt │ │ │ └── readme.txt │ │ ├── minizip │ │ │ ├── MiniZip64_Changes.txt │ │ │ ├── minizip.pc.in │ │ │ ├── Makefile │ │ │ ├── mztools.h │ │ │ ├── configure.ac │ │ │ ├── iowin32.h │ │ │ ├── make_vms.com │ │ │ ├── Makefile.am │ │ │ ├── minizip.1 │ │ │ └── miniunzip.1 │ │ ├── delphi │ │ │ ├── ZLibConst.pas │ │ │ ├── readme.txt │ │ │ └── zlibd32.mak │ │ ├── testzlib │ │ │ └── testzlib.txt │ │ ├── untgz │ │ │ ├── Makefile │ │ │ └── Makefile.msc │ │ ├── iostream3 │ │ │ ├── TODO │ │ │ ├── README │ │ │ └── test.cc │ │ ├── ada │ │ │ ├── zlib.gpr │ │ │ └── readme.txt │ │ ├── iostream │ │ │ ├── test.cpp │ │ │ └── zfstream.h │ │ ├── iostream2 │ │ │ └── zstream_test.cpp │ │ ├── vstudio │ │ │ ├── vc10 │ │ │ │ ├── miniunz.vcxproj.filters │ │ │ │ ├── minizip.vcxproj.filters │ │ │ │ ├── testzlibdll.vcxproj.filters │ │ │ │ ├── zlib.rc │ │ │ │ ├── testzlib.vcxproj.filters │ │ │ │ └── zlibstat.vcxproj.filters │ │ │ ├── vc11 │ │ │ │ └── zlib.rc │ │ │ ├── vc9 │ │ │ │ └── zlib.rc │ │ │ └── readme.txt │ │ ├── asm686 │ │ │ └── README.686 │ │ └── pascal │ │ │ ├── zlibd32.mak │ │ │ └── readme.txt │ ├── libz.a │ ├── ChangeLog │ ├── adler32.o │ ├── crc32.lo │ ├── crc32.o │ ├── deflate.o │ ├── example │ ├── example.o │ ├── example64 │ ├── examplesh │ ├── gzclose.o │ ├── gzlib.lo │ ├── gzlib.o │ ├── gzread.lo │ ├── gzread.o │ ├── gzwrite.o │ ├── infback.o │ ├── inffast.o │ ├── inflate.o │ ├── minigzip │ ├── trees.lo │ ├── trees.o │ ├── uncompr.o │ ├── zutil.lo │ ├── zutil.o │ ├── adler32.lo │ ├── compress.lo │ ├── compress.o │ ├── deflate.lo │ ├── example64.o │ ├── gzclose.lo │ ├── gzwrite.lo │ ├── infback.lo │ ├── inffast.lo │ ├── inflate.lo │ ├── inftrees.lo │ ├── inftrees.o │ ├── minigzip.o │ ├── minigzip64 │ ├── minigzipsh │ ├── uncompr.lo │ ├── zlib.3.pdf │ ├── libz.so.1.2.8 │ ├── minigzip64.o │ ├── win32 │ │ ├── VisualC.txt │ │ ├── zlib1.rc │ │ ├── zlib.def │ │ └── Makefile.bor │ ├── old │ │ ├── README │ │ ├── os2 │ │ │ └── zlib.def │ │ ├── descrip.mms │ │ └── Makefile.emx │ ├── nintendods │ │ └── README │ ├── zlib.pc.in │ ├── zlib.pc.cmakein │ ├── zlib.pc │ ├── inffast.h │ ├── gzclose.c │ ├── zlib.map │ ├── watcom │ │ ├── watcom_l.mak │ │ └── watcom_f.mak │ ├── msdos │ │ ├── Makefile.emx │ │ ├── Makefile.dj2 │ │ └── Makefile.tc │ ├── examples │ │ └── README.examples │ ├── amiga │ │ ├── Makefile.sas │ │ └── Makefile.pup │ ├── uncompr.c │ ├── INDEX │ ├── compress.c │ └── inftrees.h └── samtools-0.1.18 │ ├── bam.o │ ├── bgzf.o │ ├── razf.o │ ├── sam.o │ ├── bam_aux.o │ ├── bam_cat.o │ ├── bam_md.o │ ├── bedidx.o │ ├── faidx.o │ ├── kstring.o │ ├── libbam.a │ ├── bam_index.o │ ├── bam_sort.o │ ├── knetfile.o │ ├── kprobaln.o │ ├── bam_import.o │ ├── bam_lpileup.o │ ├── bam_pileup.o │ ├── bam_reheader.o │ ├── bcftools │ ├── bcf.o │ ├── em.o │ ├── fet.o │ ├── mut.o │ ├── vcf.o │ ├── index.o │ ├── kfunc.o │ ├── kmin.o │ ├── prob1.o │ ├── bcfutils.o │ ├── libbcf.a │ ├── bcf2qcall.o │ ├── prob1.h │ ├── Makefile │ ├── kmin.h │ └── README │ ├── sam_header.o │ ├── examples │ ├── ex1.sam.gz │ ├── toy.fa │ ├── toy.sam │ ├── 00README.txt │ ├── bam2bed.c │ ├── calDepth.c │ └── Makefile │ ├── sample.h │ ├── errmod.h │ ├── sam_header.h │ ├── AUTHORS │ ├── COPYING │ ├── bam_endian.h │ ├── INSTALL │ ├── misc │ ├── Makefile │ ├── md5fa.c │ ├── md5.h │ ├── psl2sam.pl │ ├── bowtie2sam.pl │ ├── blast2sam.pl │ ├── zoom2sam.pl │ ├── wgsim_eval.pl │ └── soap2sam.pl │ ├── bam_reheader.c │ ├── kprobaln.h │ ├── bam2bcf.h │ ├── knetfile.h │ ├── kaln.h │ ├── Makefile.mingw │ ├── bam_mate.c │ ├── sam.h │ ├── Makefile │ └── kstring.h ├── test ├── RR.bam ├── WG.bam ├── RR.ATCGmap.gz ├── anno.refFlat └── bismark.dat ├── README.md └── install.sh /include/zlib-1.2.8/libz.so: -------------------------------------------------------------------------------- 1 | libz.so.1.2.8 -------------------------------------------------------------------------------- /include/zlib-1.2.8/libz.so.1: -------------------------------------------------------------------------------- 1 | libz.so.1.2.8 -------------------------------------------------------------------------------- /include/zlib-1.2.8/lib/libz.1.dylib: -------------------------------------------------------------------------------- 1 | libz.1.2.8.dylib -------------------------------------------------------------------------------- /include/zlib-1.2.8/lib/libz.dylib: -------------------------------------------------------------------------------- 1 | libz.1.2.8.dylib -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/blast/test.txt: -------------------------------------------------------------------------------- 1 | AIAIAIAIAIAIA -------------------------------------------------------------------------------- /test/RR.bam: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/test/RR.bam -------------------------------------------------------------------------------- /test/WG.bam: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/test/WG.bam -------------------------------------------------------------------------------- /test/RR.ATCGmap.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/test/RR.ATCGmap.gz -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/infback9/README: -------------------------------------------------------------------------------- 1 | See infback9.h for what this is and how to use it. 2 | -------------------------------------------------------------------------------- /test/anno.refFlat: -------------------------------------------------------------------------------- 1 | GeneA TransA chr2 + 1000 2000 1100 1950 3 1100,1500,1700, 1200,1580,1950, 2 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/libz.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/libz.a -------------------------------------------------------------------------------- /include/zlib-1.2.8/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/ChangeLog -------------------------------------------------------------------------------- /include/zlib-1.2.8/adler32.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/adler32.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/crc32.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/crc32.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/crc32.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/crc32.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/deflate.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/deflate.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/example -------------------------------------------------------------------------------- /include/zlib-1.2.8/example.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/example.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/example64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/example64 -------------------------------------------------------------------------------- /include/zlib-1.2.8/examplesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/examplesh -------------------------------------------------------------------------------- /include/zlib-1.2.8/gzclose.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/gzclose.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/gzlib.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/gzlib.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/gzlib.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/gzlib.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/gzread.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/gzread.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/gzread.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/gzread.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/gzwrite.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/gzwrite.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/infback.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/infback.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/inffast.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/inffast.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/inflate.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/inflate.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/minigzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/minigzip -------------------------------------------------------------------------------- /include/zlib-1.2.8/trees.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/trees.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/trees.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/trees.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/uncompr.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/uncompr.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/zutil.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/zutil.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/zutil.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/zutil.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bgzf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bgzf.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/razf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/razf.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/sam.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/sam.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/adler32.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/adler32.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/compress.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/compress.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/compress.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/compress.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/deflate.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/deflate.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/example64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/example64.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/gzclose.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/gzclose.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/gzwrite.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/gzwrite.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/infback.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/infback.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/inffast.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/inffast.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/inflate.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/inflate.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/inftrees.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/inftrees.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/inftrees.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/inftrees.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/lib/libz.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/lib/libz.a -------------------------------------------------------------------------------- /include/zlib-1.2.8/minigzip.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/minigzip.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/minigzip64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/minigzip64 -------------------------------------------------------------------------------- /include/zlib-1.2.8/minigzipsh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/minigzipsh -------------------------------------------------------------------------------- /include/zlib-1.2.8/uncompr.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/uncompr.lo -------------------------------------------------------------------------------- /include/zlib-1.2.8/zlib.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/zlib.3.pdf -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_aux.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam_aux.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_cat.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam_cat.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_md.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam_md.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bedidx.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bedidx.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/faidx.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/faidx.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/kstring.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/kstring.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/libbam.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/libbam.a -------------------------------------------------------------------------------- /include/zlib-1.2.8/libz.so.1.2.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/libz.so.1.2.8 -------------------------------------------------------------------------------- /include/zlib-1.2.8/minigzip64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/minigzip64.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_index.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam_index.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_sort.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam_sort.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/knetfile.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/knetfile.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/kprobaln.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/kprobaln.o -------------------------------------------------------------------------------- /test/bismark.dat: -------------------------------------------------------------------------------- 1 | chr10 3107007 - 6 3 CG CGT 2 | chr10 3107024 - 9 3 CHH CTT 3 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_import.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam_import.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_lpileup.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam_lpileup.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_pileup.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam_pileup.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_reheader.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bam_reheader.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/bcf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/bcf.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/em.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/em.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/fet.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/fet.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/mut.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/mut.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/vcf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/vcf.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/sam_header.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/sam_header.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/blast/README: -------------------------------------------------------------------------------- 1 | Read blast.h for purpose and usage. 2 | 3 | Mark Adler 4 | madler@alumni.caltech.edu 5 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/index.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/index.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/kfunc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/kfunc.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/kmin.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/kmin.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/prob1.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/prob1.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/blast/test.pk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/blast/test.pk -------------------------------------------------------------------------------- /include/zlib-1.2.8/lib/libz.1.2.8.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/lib/libz.1.2.8.dylib -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/bcfutils.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/bcfutils.o -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/libbcf.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/libbcf.a -------------------------------------------------------------------------------- /include/samtools-0.1.18/examples/ex1.sam.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/examples/ex1.sam.gz -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/README.contrib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/README.contrib -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/masmx64/bld_ml64.bat: -------------------------------------------------------------------------------- 1 | ml64.exe /Flinffasx64 /c /Zi inffasx64.asm 2 | ml64.exe /Flgvmat64 /c /Zi gvmat64.asm 3 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/puff/zeros.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/puff/zeros.raw -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/bcf2qcall.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/samtools-0.1.18/bcftools/bcf2qcall.o -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/masmx86/bld_ml32.bat: -------------------------------------------------------------------------------- 1 | ml /coff /Zi /c /Flmatch686.lst match686.asm 2 | ml /coff /Zi /c /Flinffas32.lst inffas32.asm 3 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/examples/toy.fa: -------------------------------------------------------------------------------- 1 | >ref 2 | AGCATGTTAGATAAGATAGCTGTGCTAGTAGGCAGTCAGCGCCAT 3 | >ref2 4 | aggttttataaaacaattaagtctacagagcaactacgcg 5 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/dotzlib/DotZLib.chm -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib/DotZLib.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/dotzlib/DotZLib/DotZLib.cs -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib/CodecBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/dotzlib/DotZLib/CodecBase.cs -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib/Deflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/dotzlib/DotZLib/Deflater.cs -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib/Inflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/dotzlib/DotZLib/Inflater.cs -------------------------------------------------------------------------------- /include/zlib-1.2.8/win32/VisualC.txt: -------------------------------------------------------------------------------- 1 | 2 | To build zlib using the Microsoft Visual C++ environment, 3 | use the appropriate project from the projects/ directory. 4 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib/ChecksumImpl.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/dotzlib/DotZLib/ChecksumImpl.cs -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib/GZipStream.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/dotzlib/DotZLib/GZipStream.cs -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib/CircularBuffer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoweilong/cgmaptools/HEAD/include/zlib-1.2.8/contrib/dotzlib/DotZLib/CircularBuffer.cs -------------------------------------------------------------------------------- /include/zlib-1.2.8/old/README: -------------------------------------------------------------------------------- 1 | This directory contains files that have not been updated for zlib 1.2.x 2 | 3 | (Volunteers are encouraged to help clean this up. Thanks.) 4 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/MiniZip64_Changes.txt: -------------------------------------------------------------------------------- 1 | 2 | MiniZip 1.1 was derrived from MiniZip at version 1.01f 3 | 4 | Change in 1.0 (Okt 2009) 5 | - **TODO - Add history** 6 | 7 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/blast/Makefile: -------------------------------------------------------------------------------- 1 | blast: blast.c blast.h 2 | cc -DTEST -o blast blast.c 3 | 4 | test: blast 5 | blast < test.pk | cmp - test.txt 6 | 7 | clean: 8 | rm -f blast blast.o 9 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/nintendods/README: -------------------------------------------------------------------------------- 1 | This Makefile requires devkitARM (http://www.devkitpro.org/category/devkitarm/) and works inside "contrib/nds". It is based on a devkitARM template. 2 | 3 | Eduardo Costa 4 | January 3, 2009 5 | 6 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/delphi/ZLibConst.pas: -------------------------------------------------------------------------------- 1 | unit ZLibConst; 2 | 3 | interface 4 | 5 | resourcestring 6 | sTargetBufferTooSmall = 'ZLib error: target buffer may be too small'; 7 | sInvalidStreamOp = 'Invalid stream operation'; 8 | 9 | implementation 10 | 11 | end. 12 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/testzlib/testzlib.txt: -------------------------------------------------------------------------------- 1 | To build testzLib with Visual Studio 2005: 2 | 3 | copy to a directory file from : 4 | - root of zLib tree 5 | - contrib/testzlib 6 | - contrib/masmx86 7 | - contrib/masmx64 8 | - contrib/vstudio/vc7 9 | 10 | and open testzlib8.sln -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/untgz/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-g 3 | 4 | untgz: untgz.o ../../libz.a 5 | $(CC) $(CFLAGS) -o untgz untgz.o -L../.. -lz 6 | 7 | untgz.o: untgz.c ../../zlib.h 8 | $(CC) $(CFLAGS) -c -I../.. untgz.c 9 | 10 | ../../libz.a: 11 | cd ../..; ./configure; make 12 | 13 | clean: 14 | rm -f untgz untgz.o *~ 15 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/zlib.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | sharedlibdir=@sharedlibdir@ 5 | includedir=@includedir@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cgmaptools 2 | Command-line Toolset for Bisulfite Sequencing Data Analysis 3 | 4 | homepage: [https://cgmaptools.github.io](https://cgmaptools.github.io) 5 | 6 | ![CGmapTools](https://cgmaptools.github.io/images/CGmapTools_logo.png) 7 | 8 | ![](https://cgmaptools.github.io/cgmaptools_documentation/cgmaptools_schematicDiagram.png) 9 | 10 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/minizip.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@/minizip 5 | 6 | Name: minizip 7 | Description: Minizip zip file manipulation library 8 | Requires: 9 | Version: @PACKAGE_VERSION@ 10 | Libs: -L${libdir} -lminizip 11 | Libs.private: -lz 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/zlib.pc.cmakein: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@INSTALL_LIB_DIR@ 4 | sharedlibdir=@INSTALL_LIB_DIR@ 5 | includedir=@INSTALL_INC_DIR@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/zlib.pc: -------------------------------------------------------------------------------- 1 | prefix=/data2/user2/miaolf/bin/cgmaptools_for_python3/include/zlib-1.2.8 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | sharedlibdir=${libdir} 5 | includedir=${prefix}/include 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: 1.2.8 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/untgz/Makefile.msc: -------------------------------------------------------------------------------- 1 | CC=cl 2 | CFLAGS=-MD 3 | 4 | untgz.exe: untgz.obj ..\..\zlib.lib 5 | $(CC) $(CFLAGS) untgz.obj ..\..\zlib.lib 6 | 7 | untgz.obj: untgz.c ..\..\zlib.h 8 | $(CC) $(CFLAGS) -c -I..\.. untgz.c 9 | 10 | ..\..\zlib.lib: 11 | cd ..\.. 12 | $(MAKE) -f win32\makefile.msc 13 | cd contrib\untgz 14 | 15 | clean: 16 | -del untgz.obj 17 | -del untgz.exe 18 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/lib/pkgconfig/zlib.pc: -------------------------------------------------------------------------------- 1 | prefix=/Users/weilongguo/Documents/program/cgmaptools/src/zlib-1.2.8 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | sharedlibdir=${libdir} 5 | includedir=${prefix}/include 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: 1.2.8 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/sample.h: -------------------------------------------------------------------------------- 1 | #ifndef BAM_SAMPLE_H 2 | #define BAM_SAMPLE_H 3 | 4 | #include "kstring.h" 5 | 6 | typedef struct { 7 | int n, m; 8 | char **smpl; 9 | void *rg2smid, *sm2id; 10 | } bam_sample_t; 11 | 12 | bam_sample_t *bam_smpl_init(void); 13 | int bam_smpl_add(bam_sample_t *sm, const char *abs, const char *txt); 14 | int bam_smpl_rg2smid(const bam_sample_t *sm, const char *fn, const char *rg, kstring_t *str); 15 | void bam_smpl_destroy(bam_sample_t *sm); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/errmod.h: -------------------------------------------------------------------------------- 1 | #ifndef ERRMOD_H 2 | #define ERRMOD_H 3 | 4 | #include 5 | 6 | struct __errmod_coef_t; 7 | 8 | typedef struct { 9 | double depcorr; 10 | struct __errmod_coef_t *coef; 11 | } errmod_t; 12 | 13 | errmod_t *errmod_init(float depcorr); 14 | void errmod_destroy(errmod_t *em); 15 | 16 | /* 17 | n: number of bases 18 | m: maximum base 19 | bases[i]: qual:6, strand:1, base:4 20 | q[i*m+j]: phred-scaled likelihood of (i,j) 21 | */ 22 | int errmod_cal(const errmod_t *em, int n, int m, uint16_t *bases, float *q); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/iostream3/TODO: -------------------------------------------------------------------------------- 1 | Possible upgrades to gzfilebuf: 2 | 3 | - The ability to do putback (e.g. putbackfail) 4 | 5 | - The ability to seek (zlib supports this, but could be slow/tricky) 6 | 7 | - Simultaneous read/write access (does it make sense?) 8 | 9 | - Support for ios_base::ate open mode 10 | 11 | - Locale support? 12 | 13 | - Check public interface to see which calls give problems 14 | (due to dependence on library internals) 15 | 16 | - Override operator<<(ostream&, gzfilebuf*) to allow direct copying 17 | of stream buffer to stream ( i.e. os << is.rdbuf(); ) 18 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-O -I../.. 3 | 4 | UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a 5 | ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a 6 | 7 | .c.o: 8 | $(CC) -c $(CFLAGS) $*.c 9 | 10 | all: miniunz minizip 11 | 12 | miniunz: $(UNZ_OBJS) 13 | $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) 14 | 15 | minizip: $(ZIP_OBJS) 16 | $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) 17 | 18 | test: miniunz minizip 19 | ./minizip test readme.txt 20 | ./miniunz -l test.zip 21 | mv readme.txt readme.old 22 | ./miniunz test.zip 23 | 24 | clean: 25 | /bin/rm -f *.o *~ minizip miniunz 26 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/ada/zlib.gpr: -------------------------------------------------------------------------------- 1 | project Zlib is 2 | 3 | for Languages use ("Ada"); 4 | for Source_Dirs use ("."); 5 | for Object_Dir use "."; 6 | for Main use ("test.adb", "mtest.adb", "read.adb", "buffer_demo"); 7 | 8 | package Compiler is 9 | for Default_Switches ("ada") use ("-gnatwcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst"); 10 | end Compiler; 11 | 12 | package Linker is 13 | for Default_Switches ("ada") use ("-lz"); 14 | end Linker; 15 | 16 | package Builder is 17 | for Default_Switches ("ada") use ("-s", "-gnatQ"); 18 | end Builder; 19 | 20 | end Zlib; 21 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/iostream/test.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "zfstream.h" 3 | 4 | int main() { 5 | 6 | // Construct a stream object with this filebuffer. Anything sent 7 | // to this stream will go to standard out. 8 | gzofstream os( 1, ios::out ); 9 | 10 | // This text is getting compressed and sent to stdout. 11 | // To prove this, run 'test | zcat'. 12 | os << "Hello, Mommy" << endl; 13 | 14 | os << setcompressionlevel( Z_NO_COMPRESSION ); 15 | os << "hello, hello, hi, ho!" << endl; 16 | 17 | setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) 18 | << "I'm compressing again" << endl; 19 | 20 | os.close(); 21 | 22 | return 0; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/sam_header.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAM_HEADER_H__ 2 | #define __SAM_HEADER_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void *sam_header_parse2(const char *headerText); 9 | void *sam_header_merge(int n, const void **dicts); 10 | void sam_header_free(void *header); 11 | char *sam_header_write(const void *headerDict); // returns a newly allocated string 12 | 13 | char **sam_header2list(const void *_dict, char type[2], char key_tag[2], int *_n); 14 | 15 | void *sam_header2tbl(const void *dict, char type[2], char key_tag[2], char value_tag[2]); 16 | const char *sam_tbl_get(void *h, const char *key); 17 | int sam_tbl_size(void *h); 18 | void sam_tbl_destroy(void *h); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/iostream2/zstream_test.cpp: -------------------------------------------------------------------------------- 1 | #include "zstream.h" 2 | #include 3 | #include 4 | #include 5 | 6 | void main() { 7 | char h[256] = "Hello"; 8 | char* g = "Goodbye"; 9 | ozstream out("temp.gz"); 10 | out < "This works well" < h < g; 11 | out.close(); 12 | 13 | izstream in("temp.gz"); // read it back 14 | char *x = read_string(in), *y = new char[256], z[256]; 15 | in > y > z; 16 | in.close(); 17 | cout << x << endl << y << endl << z << endl; 18 | 19 | out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results 20 | out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; 21 | out << z << endl << y << endl << x << endl; 22 | out << 1.1234567890123456789 << endl; 23 | 24 | delete[] x; delete[] y; 25 | } 26 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/examples/toy.sam: -------------------------------------------------------------------------------- 1 | @SQ SN:ref LN:45 2 | @SQ SN:ref2 LN:40 3 | r001 163 ref 7 30 8M4I4M1D3M = 37 39 TTAGATAAAGAGGATACTG * XX:B:S,12561,2,20,112 4 | r002 0 ref 9 30 1S2I6M1P1I1P1I4M2I * 0 0 AAAAGATAAGGGATAAA * 5 | r003 0 ref 9 30 5H6M * 0 0 AGCTAA * 6 | r004 0 ref 16 30 6M14N1I5M * 0 0 ATAGCTCTCAGC * 7 | r003 16 ref 29 30 6H5M * 0 0 TAGGC * 8 | r001 83 ref 37 30 9M = 7 -39 CAGCGCCAT * 9 | x1 0 ref2 1 30 20M * 0 0 aggttttataaaacaaataa ???????????????????? 10 | x2 0 ref2 2 30 21M * 0 0 ggttttataaaacaaataatt ????????????????????? 11 | x3 0 ref2 6 30 9M4I13M * 0 0 ttataaaacAAATaattaagtctaca ?????????????????????????? 12 | x4 0 ref2 10 30 25M * 0 0 CaaaTaattaagtctacagagcaac ????????????????????????? 13 | x5 0 ref2 12 30 24M * 0 0 aaTaattaagtctacagagcaact ???????????????????????? 14 | x6 0 ref2 14 30 23M * 0 0 Taattaagtctacagagcaacta ??????????????????????? 15 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/mztools.h: -------------------------------------------------------------------------------- 1 | /* 2 | Additional tools for Minizip 3 | Code: Xavier Roche '2004 4 | License: Same as ZLIB (www.gzip.org) 5 | */ 6 | 7 | #ifndef _zip_tools_H 8 | #define _zip_tools_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef _ZLIB_H 15 | #include "zlib.h" 16 | #endif 17 | 18 | #include "unzip.h" 19 | 20 | /* Repair a ZIP file (missing central directory) 21 | file: file to recover 22 | fileOut: output file after recovery 23 | fileOutTmp: temporary file name used for recovery 24 | */ 25 | extern int ZEXPORT unzRepair(const char* file, 26 | const char* fileOut, 27 | const char* fileOutTmp, 28 | uLong* nRecovered, 29 | uLong* bytesRecovered); 30 | 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_INIT([minizip], [1.2.8], [bugzilla.redhat.com]) 5 | AC_CONFIG_SRCDIR([minizip.c]) 6 | AM_INIT_AUTOMAKE([foreign]) 7 | LT_INIT 8 | 9 | AC_MSG_CHECKING([whether to build example programs]) 10 | AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs])) 11 | AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes]) 12 | if test "$enable_demos" = yes 13 | then 14 | AC_MSG_RESULT([yes]) 15 | else 16 | AC_MSG_RESULT([no]) 17 | fi 18 | 19 | case "${host}" in 20 | *-mingw* | mingw*) 21 | WIN32="yes" 22 | ;; 23 | *) 24 | ;; 25 | esac 26 | AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) 27 | 28 | 29 | AC_SUBST([HAVE_UNISTD_H], [0]) 30 | AC_CHECK_HEADER([unistd.h], [HAVE_UNISTD_H=1], []) 31 | AC_CONFIG_FILES([Makefile minizip.pc]) 32 | AC_OUTPUT 33 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/iowin32.h: -------------------------------------------------------------------------------- 1 | /* iowin32.h -- IO base function header for compress/uncompress .zip 2 | Version 1.1, February 14h, 2010 3 | part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) 4 | 5 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) 6 | 7 | Modifications for Zip64 support 8 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 9 | 10 | For more info read MiniZip_info.txt 11 | 12 | */ 13 | 14 | #include 15 | 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 22 | void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def)); 23 | void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def)); 24 | void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def)); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/AUTHORS: -------------------------------------------------------------------------------- 1 | Heng Li from the Sanger Institute wrote most of the initial source codes 2 | of SAMtools and various converters. 3 | 4 | Bob Handsaker from the Broad Institute is a major contributor to the 5 | SAM/BAM specification. He designed and implemented the BGZF format, the 6 | underlying indexable compression format for the BAM format. BGZF does 7 | not support arithmetic between file offsets. 8 | 9 | Jue Ruan for the Beijing Genome Institute designed and implemented the 10 | RAZF format, an alternative indexable compression format. RAZF supports 11 | arithmetic between file offsets, at the cost of increased index file 12 | size and the full compatibility with gzip. RAZF is optional and only 13 | used in `faidx' for indexing RAZF compressed fasta files. 14 | 15 | Colin Hercus updated novo2sam.pl to support gapped alignment by 16 | novoalign. 17 | 18 | Petr Danecek contributed the header parsing library sam_header.c and 19 | sam2vcf.pl script and added knet support to the RAZF library. 20 | 21 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/examples/00README.txt: -------------------------------------------------------------------------------- 1 | File ex1.fa contains two sequences cut from the human genome 2 | build36. They were exatracted with command: 3 | 4 | samtools faidx human_b36.fa 2:2043966-2045540 20:67967-69550 5 | 6 | Sequence names were changed manually for simplicity. File ex1.sam.gz 7 | contains MAQ alignments exatracted with: 8 | 9 | (samtools view NA18507_maq.bam 2:2044001-2045500; 10 | samtools view NA18507_maq.bam 20:68001-69500) 11 | 12 | and processed with `samtools fixmate' to make it self-consistent as a 13 | standalone alignment. 14 | 15 | To try samtools, you may run the following commands: 16 | 17 | samtools faidx ex1.fa # index the reference FASTA 18 | samtools import ex1.fa.fai ex1.sam.gz ex1.bam # SAM->BAM 19 | samtools index ex1.bam # index BAM 20 | samtools tview ex1.bam ex1.fa # view alignment 21 | samtools pileup -cf ex1.fa ex1.bam # pileup and consensus 22 | samtools pileup -cf ex1.fa -t ex1.fa.fai ex1.sam.gz 23 | 24 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/masmx86/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Summary 3 | ------- 4 | This directory contains ASM implementations of the functions 5 | longest_match() and inflate_fast(). 6 | 7 | 8 | Use instructions 9 | ---------------- 10 | Assemble using MASM, and copy the object files into the zlib source 11 | directory, then run the appropriate makefile, as suggested below. You can 12 | donwload MASM from here: 13 | 14 | http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 15 | 16 | You can also get objects files here: 17 | 18 | http://www.winimage.com/zLibDll/zlib124_masm_obj.zip 19 | 20 | Build instructions 21 | ------------------ 22 | * With Microsoft C and MASM: 23 | nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" 24 | 25 | * With Borland C and TASM: 26 | make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" 27 | 28 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotZLib", "DotZLib\DotZLib.csproj", "{BB1EE0B1-1808-46CB-B786-949D91117FC5}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.ActiveCfg = Debug|.NET 13 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.Build.0 = Debug|.NET 14 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.ActiveCfg = Release|.NET 15 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.Build.0 = Release|.NET 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/old/os2/zlib.def: -------------------------------------------------------------------------------- 1 | ; 2 | ; Slightly modified version of ../nt/zlib.dnt :-) 3 | ; 4 | 5 | LIBRARY Z 6 | DESCRIPTION "Zlib compression library for OS/2" 7 | CODE PRELOAD MOVEABLE DISCARDABLE 8 | DATA PRELOAD MOVEABLE MULTIPLE 9 | 10 | EXPORTS 11 | adler32 12 | compress 13 | crc32 14 | deflate 15 | deflateCopy 16 | deflateEnd 17 | deflateInit2_ 18 | deflateInit_ 19 | deflateParams 20 | deflateReset 21 | deflateSetDictionary 22 | gzclose 23 | gzdopen 24 | gzerror 25 | gzflush 26 | gzopen 27 | gzread 28 | gzwrite 29 | inflate 30 | inflateEnd 31 | inflateInit2_ 32 | inflateInit_ 33 | inflateReset 34 | inflateSetDictionary 35 | inflateSync 36 | uncompress 37 | zlibVersion 38 | gzprintf 39 | gzputc 40 | gzgetc 41 | gzseek 42 | gzrewind 43 | gztell 44 | gzeof 45 | gzsetparams 46 | zError 47 | inflateSyncPoint 48 | get_crc_table 49 | compress2 50 | gzputs 51 | gzgets 52 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/make_vms.com: -------------------------------------------------------------------------------- 1 | $ if f$search("ioapi.h_orig") .eqs. "" then copy ioapi.h ioapi.h_orig 2 | $ open/write zdef vmsdefs.h 3 | $ copy sys$input: zdef 4 | $ deck 5 | #define unix 6 | #define fill_zlib_filefunc64_32_def_from_filefunc32 fillzffunc64from 7 | #define Write_Zip64EndOfCentralDirectoryLocator Write_Zip64EoDLocator 8 | #define Write_Zip64EndOfCentralDirectoryRecord Write_Zip64EoDRecord 9 | #define Write_EndOfCentralDirectoryRecord Write_EoDRecord 10 | $ eod 11 | $ close zdef 12 | $ copy vmsdefs.h,ioapi.h_orig ioapi.h 13 | $ cc/include=[--]/prefix=all ioapi.c 14 | $ cc/include=[--]/prefix=all miniunz.c 15 | $ cc/include=[--]/prefix=all unzip.c 16 | $ cc/include=[--]/prefix=all minizip.c 17 | $ cc/include=[--]/prefix=all zip.c 18 | $ link miniunz,unzip,ioapi,[--]libz.olb/lib 19 | $ link minizip,zip,ioapi,[--]libz.olb/lib 20 | $ mcr []minizip test minizip_info.txt 21 | $ mcr []miniunz -l test.zip 22 | $ rename minizip_info.txt; minizip_info.txt_old 23 | $ mcr []miniunz test.zip 24 | $ delete test.zip;* 25 | $exit 26 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/vstudio/vc10/miniunz.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {048af943-022b-4db6-beeb-a54c34774ee2} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {c1d600d2-888f-4aea-b73e-8b0dd9befa0c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {0844199a-966b-4f19-81db-1e0125e141b9} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/vstudio/vc10/minizip.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {c0419b40-bf50-40da-b153-ff74215b79de} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {bb87b070-735b-478e-92ce-7383abb2f36c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {f46ab6a6-548f-43cb-ae96-681abb5bd5db} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libminizip.la 2 | 3 | if COND_DEMOS 4 | bin_PROGRAMS = miniunzip minizip 5 | endif 6 | 7 | zlib_top_srcdir = $(top_srcdir)/../.. 8 | zlib_top_builddir = $(top_builddir)/../.. 9 | 10 | AM_CPPFLAGS = -I$(zlib_top_srcdir) 11 | AM_LDFLAGS = -L$(zlib_top_builddir) 12 | 13 | if WIN32 14 | iowin32_src = iowin32.c 15 | iowin32_h = iowin32.h 16 | endif 17 | 18 | libminizip_la_SOURCES = \ 19 | ioapi.c \ 20 | mztools.c \ 21 | unzip.c \ 22 | zip.c \ 23 | ${iowin32_src} 24 | 25 | libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz 26 | 27 | minizip_includedir = $(includedir)/minizip 28 | minizip_include_HEADERS = \ 29 | crypt.h \ 30 | ioapi.h \ 31 | mztools.h \ 32 | unzip.h \ 33 | zip.h \ 34 | ${iowin32_h} 35 | 36 | pkgconfigdir = $(libdir)/pkgconfig 37 | pkgconfig_DATA = minizip.pc 38 | 39 | EXTRA_PROGRAMS = miniunzip minizip 40 | 41 | miniunzip_SOURCES = miniunz.c 42 | miniunzip_LDADD = libminizip.la 43 | 44 | minizip_SOURCES = minizip.c 45 | minizip_LDADD = libminizip.la -lz 46 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/vstudio/vc10/testzlibdll.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {fa61a89f-93fc-4c89-b29e-36224b7592f4} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {d4b85da0-2ba2-4934-b57f-e2584e3848ee} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {e573e075-00bd-4a7d-bd67-a8cc9bfc5aca} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/vstudio/vc10/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1,2,8,0 6 | PRODUCTVERSION 1,2,8,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.8\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlibwapi.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/vstudio/vc11/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1,2,8,0 6 | PRODUCTVERSION 1,2,8,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.8\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlibwapi.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/vstudio/vc9/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1,2,8,0 6 | PRODUCTVERSION 1,2,8,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.8\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlibwapi.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/COPYING: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2008-2009 Genome Research Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_endian.h: -------------------------------------------------------------------------------- 1 | #ifndef BAM_ENDIAN_H 2 | #define BAM_ENDIAN_H 3 | 4 | #include 5 | 6 | static inline int bam_is_big_endian() 7 | { 8 | long one= 1; 9 | return !(*((char *)(&one))); 10 | } 11 | static inline uint16_t bam_swap_endian_2(uint16_t v) 12 | { 13 | return (uint16_t)(((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8)); 14 | } 15 | static inline void *bam_swap_endian_2p(void *x) 16 | { 17 | *(uint16_t*)x = bam_swap_endian_2(*(uint16_t*)x); 18 | return x; 19 | } 20 | static inline uint32_t bam_swap_endian_4(uint32_t v) 21 | { 22 | v = ((v & 0x0000FFFFU) << 16) | (v >> 16); 23 | return ((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8); 24 | } 25 | static inline void *bam_swap_endian_4p(void *x) 26 | { 27 | *(uint32_t*)x = bam_swap_endian_4(*(uint32_t*)x); 28 | return x; 29 | } 30 | static inline uint64_t bam_swap_endian_8(uint64_t v) 31 | { 32 | v = ((v & 0x00000000FFFFFFFFLLU) << 32) | (v >> 32); 33 | v = ((v & 0x0000FFFF0000FFFFLLU) << 16) | ((v & 0xFFFF0000FFFF0000LLU) >> 16); 34 | return ((v & 0x00FF00FF00FF00FFLLU) << 8) | ((v & 0xFF00FF00FF00FF00LLU) >> 8); 35 | } 36 | static inline void *bam_swap_endian_8p(void *x) 37 | { 38 | *(uint64_t*)x = bam_swap_endian_8(*(uint64_t*)x); 39 | return x; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/win32/zlib1.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../zlib.h" 3 | 4 | #ifdef GCC_WINDRES 5 | VS_VERSION_INFO VERSIONINFO 6 | #else 7 | VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 8 | #endif 9 | FILEVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 10 | PRODUCTVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 11 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 12 | #ifdef _DEBUG 13 | FILEFLAGS 1 14 | #else 15 | FILEFLAGS 0 16 | #endif 17 | FILEOS VOS__WINDOWS32 18 | FILETYPE VFT_DLL 19 | FILESUBTYPE 0 // not used 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904E4" 24 | //language ID = U.S. English, char set = Windows, Multilingual 25 | BEGIN 26 | VALUE "FileDescription", "zlib data compression library\0" 27 | VALUE "FileVersion", ZLIB_VERSION "\0" 28 | VALUE "InternalName", "zlib1.dll\0" 29 | VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0" 30 | VALUE "OriginalFilename", "zlib1.dll\0" 31 | VALUE "ProductName", "zlib\0" 32 | VALUE "ProductVersion", ZLIB_VERSION "\0" 33 | VALUE "Comments", "For more information visit http://www.zlib.net/\0" 34 | END 35 | END 36 | BLOCK "VarFileInfo" 37 | BEGIN 38 | VALUE "Translation", 0x0409, 1252 39 | END 40 | END 41 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/INSTALL: -------------------------------------------------------------------------------- 1 | System Requirements 2 | =================== 3 | 4 | SAMtools depends on the zlib library . Version 1.2.3+ is 5 | preferred and with 1.2.3+ you can compile razip and use it to compress a FASTA 6 | file. SAMtools' faidx is able to index a razip-compressed FASTA file to save 7 | diskspace. Older zlib also works with SAMtools, but razip cannot be compiled. 8 | 9 | The text-based viewer (tview) requires the GNU ncurses library 10 | , which comes with Mac OS X and most of 11 | the modern Linux/Unix distributions. If you do not have this library installed, 12 | you can still compile the rest of SAMtools by manually changing: 13 | `-D_CURSES_LIB=1' to `-D_CURSES_LIB=0' at the line starting with `DFLAGS=', and 14 | comment out the line starting with `LIBCURSES='. 15 | 16 | 17 | Compilation 18 | =========== 19 | 20 | Type `make' to compile samtools. If you have zlib >= 1.2.2.1, you can compile 21 | razip with `make razip'. 22 | 23 | 24 | Installation 25 | ============ 26 | 27 | Copy `samtools', `bcftools/bcftools' and other executables/scripts in `misc' to 28 | a location you want (e.g. a directory in your $PATH). You may also copy 29 | `samtools.1' and `bcftools/bcftools.1' to a directory in your $MANPATH such 30 | that the `man' command may find the manual. 31 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib.build: -------------------------------------------------------------------------------- 1 | 2 | 3 | A .Net wrapper library around ZLib1.dll 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/masmx64/readme.txt: -------------------------------------------------------------------------------- 1 | Summary 2 | ------- 3 | This directory contains ASM implementations of the functions 4 | longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t), 5 | for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits. 6 | 7 | gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits 8 | assembly optimized version from Jean-loup Gailly original longest_match function 9 | 10 | inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing 11 | original function from Mark Adler 12 | 13 | Use instructions 14 | ---------------- 15 | Assemble the .asm files using MASM and put the object files into the zlib source 16 | directory. You can also get object files here: 17 | 18 | http://www.winimage.com/zLibDll/zlib124_masm_obj.zip 19 | 20 | define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, 21 | and inffasx64.obj and gvmat64.obj as object to link. 22 | 23 | 24 | Build instructions 25 | ------------------ 26 | run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe) 27 | 28 | ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK 29 | 30 | You can get Windows 2003 server DDK with ml64 and cl for AMD64 from 31 | http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) 32 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/prob1.h: -------------------------------------------------------------------------------- 1 | #ifndef BCF_PROB1_H 2 | #define BCF_PROB1_H 3 | 4 | #include "bcf.h" 5 | 6 | struct __bcf_p1aux_t; 7 | typedef struct __bcf_p1aux_t bcf_p1aux_t; 8 | 9 | typedef struct { 10 | int rank0, perm_rank; // NB: perm_rank is always set to -1 by bcf_p1_cal() 11 | int ac; // ML alternative allele count 12 | double f_exp, f_flat, p_ref_folded, p_ref, p_var_folded, p_var; 13 | double cil, cih; 14 | double cmp[3], p_chi2, lrt; // used by contrast2() 15 | } bcf_p1rst_t; 16 | 17 | #define MC_PTYPE_FULL 1 18 | #define MC_PTYPE_COND2 2 19 | #define MC_PTYPE_FLAT 3 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | bcf_p1aux_t *bcf_p1_init(int n, uint8_t *ploidy); 26 | void bcf_p1_init_prior(bcf_p1aux_t *ma, int type, double theta); 27 | void bcf_p1_init_subprior(bcf_p1aux_t *ma, int type, double theta); 28 | void bcf_p1_destroy(bcf_p1aux_t *ma); 29 | int bcf_p1_cal(const bcf1_t *b, int do_contrast, bcf_p1aux_t *ma, bcf_p1rst_t *rst); 30 | int bcf_p1_call_gt(const bcf_p1aux_t *ma, double f0, int k); 31 | void bcf_p1_dump_afs(bcf_p1aux_t *ma); 32 | int bcf_p1_read_prior(bcf_p1aux_t *ma, const char *fn); 33 | int bcf_p1_set_n1(bcf_p1aux_t *b, int n1); 34 | void bcf_p1_set_folded(bcf_p1aux_t *p1a); // only effective when set_n1() is not called 35 | 36 | int bcf_em1(const bcf1_t *b, int n1, int flag, double x[10]); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/Makefile: -------------------------------------------------------------------------------- 1 | CC= gcc 2 | CFLAGS= -g -Wall -O2 #-m64 #-arch ppc 3 | DFLAGS= -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE 4 | LOBJS= bcf.o vcf.o bcfutils.o prob1.o em.o kfunc.o kmin.o index.o fet.o mut.o bcf2qcall.o 5 | OMISC= .. 6 | AOBJS= call1.o main.o $(OMISC)/kstring.o $(OMISC)/bgzf.o $(OMISC)/knetfile.o $(OMISC)/bedidx.o 7 | PROG= bcftools 8 | INCLUDES= 9 | SUBDIRS= . 10 | 11 | .SUFFIXES:.c .o 12 | 13 | .c.o: 14 | $(CC) -c $(CFLAGS) $(DFLAGS) -I.. $(INCLUDES) $< -o $@ 15 | 16 | all-recur lib-recur clean-recur cleanlocal-recur install-recur: 17 | @target=`echo $@ | sed s/-recur//`; \ 18 | wdir=`pwd`; \ 19 | list='$(SUBDIRS)'; for subdir in $$list; do \ 20 | cd $$subdir; \ 21 | $(MAKE) CC="$(CC)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \ 22 | INCLUDES="$(INCLUDES)" LIBPATH="$(LIBPATH)" $$target || exit 1; \ 23 | cd $$wdir; \ 24 | done; 25 | 26 | all:$(PROG) 27 | 28 | lib:libbcf.a 29 | 30 | libbcf.a:$(LOBJS) 31 | $(AR) -csru $@ $(LOBJS) 32 | 33 | bcftools:lib $(AOBJS) 34 | $(CC) $(CFLAGS) -o $@ $(AOBJS) -L. $(LIBPATH) -lbcf -lm -lz 35 | 36 | bcf.o:bcf.h 37 | vcf.o:bcf.h 38 | index.o:bcf.h 39 | bcfutils.o:bcf.h 40 | prob1.o:prob1.h bcf.h 41 | call1.o:prob1.h bcf.h 42 | bcf2qcall.o:bcf.h 43 | main.o:bcf.h 44 | 45 | bcf.pdf:bcf.tex 46 | pdflatex bcf 47 | 48 | cleanlocal: 49 | rm -fr gmon.out *.o a.out *.dSYM $(PROG) *~ *.a bcf.aux bcf.log bcf.pdf *.class libbcf.*.dylib libbcf.so* 50 | 51 | clean:cleanlocal-recur 52 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/LICENSE_1_0.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/puff/puff.h: -------------------------------------------------------------------------------- 1 | /* puff.h 2 | Copyright (C) 2002-2013 Mark Adler, all rights reserved 3 | version 2.3, 21 Jan 2013 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the author be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Mark Adler madler@alumni.caltech.edu 22 | */ 23 | 24 | 25 | /* 26 | * See puff.c for purpose and usage. 27 | */ 28 | #ifndef NIL 29 | # define NIL ((unsigned char *)0) /* for no output option */ 30 | #endif 31 | 32 | int puff(unsigned char *dest, /* pointer to destination pointer */ 33 | unsigned long *destlen, /* amount of output space */ 34 | const unsigned char *source, /* pointer to source data pointer */ 35 | unsigned long *sourcelen); /* amount of input available */ 36 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/zlib.map: -------------------------------------------------------------------------------- 1 | ZLIB_1.2.0 { 2 | global: 3 | compressBound; 4 | deflateBound; 5 | inflateBack; 6 | inflateBackEnd; 7 | inflateBackInit_; 8 | inflateCopy; 9 | local: 10 | deflate_copyright; 11 | inflate_copyright; 12 | inflate_fast; 13 | inflate_table; 14 | zcalloc; 15 | zcfree; 16 | z_errmsg; 17 | gz_error; 18 | gz_intmax; 19 | _*; 20 | }; 21 | 22 | ZLIB_1.2.0.2 { 23 | gzclearerr; 24 | gzungetc; 25 | zlibCompileFlags; 26 | } ZLIB_1.2.0; 27 | 28 | ZLIB_1.2.0.8 { 29 | deflatePrime; 30 | } ZLIB_1.2.0.2; 31 | 32 | ZLIB_1.2.2 { 33 | adler32_combine; 34 | crc32_combine; 35 | deflateSetHeader; 36 | inflateGetHeader; 37 | } ZLIB_1.2.0.8; 38 | 39 | ZLIB_1.2.2.3 { 40 | deflateTune; 41 | gzdirect; 42 | } ZLIB_1.2.2; 43 | 44 | ZLIB_1.2.2.4 { 45 | inflatePrime; 46 | } ZLIB_1.2.2.3; 47 | 48 | ZLIB_1.2.3.3 { 49 | adler32_combine64; 50 | crc32_combine64; 51 | gzopen64; 52 | gzseek64; 53 | gztell64; 54 | inflateUndermine; 55 | } ZLIB_1.2.2.4; 56 | 57 | ZLIB_1.2.3.4 { 58 | inflateReset2; 59 | inflateMark; 60 | } ZLIB_1.2.3.3; 61 | 62 | ZLIB_1.2.3.5 { 63 | gzbuffer; 64 | gzoffset; 65 | gzoffset64; 66 | gzclose_r; 67 | gzclose_w; 68 | } ZLIB_1.2.3.4; 69 | 70 | ZLIB_1.2.5.1 { 71 | deflatePending; 72 | } ZLIB_1.2.3.5; 73 | 74 | ZLIB_1.2.5.2 { 75 | deflateResetKeep; 76 | gzgetc_; 77 | inflateResetKeep; 78 | } ZLIB_1.2.5.1; 79 | 80 | ZLIB_1.2.7.1 { 81 | inflateGetDictionary; 82 | gzvprintf; 83 | } ZLIB_1.2.5.2; 84 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/watcom/watcom_l.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # OpenWatcom large model 3 | # Last updated: 28-Dec-2005 4 | 5 | # To use, do "wmake -f watcom_l.mak" 6 | 7 | C_SOURCE = adler32.c compress.c crc32.c deflate.c & 8 | gzclose.c gzlib.c gzread.c gzwrite.c & 9 | infback.c inffast.c inflate.c inftrees.c & 10 | trees.c uncompr.c zutil.c 11 | 12 | OBJS = adler32.obj compress.obj crc32.obj deflate.obj & 13 | gzclose.obj gzlib.obj gzread.obj gzwrite.obj & 14 | infback.obj inffast.obj inflate.obj inftrees.obj & 15 | trees.obj uncompr.obj zutil.obj 16 | 17 | CC = wcc 18 | LINKER = wcl 19 | CFLAGS = -zq -ml -s -bt=dos -oilrtfm -fr=nul -wx 20 | ZLIB_LIB = zlib_l.lib 21 | 22 | .C.OBJ: 23 | $(CC) $(CFLAGS) $[@ 24 | 25 | all: $(ZLIB_LIB) example.exe minigzip.exe 26 | 27 | $(ZLIB_LIB): $(OBJS) 28 | wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj 29 | wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj 30 | wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj 31 | wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj 32 | wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj 33 | 34 | example.exe: $(ZLIB_LIB) example.obj 35 | $(LINKER) -fe=example.exe example.obj $(ZLIB_LIB) 36 | 37 | minigzip.exe: $(ZLIB_LIB) minigzip.obj 38 | $(LINKER) -fe=minigzip.exe minigzip.obj $(ZLIB_LIB) 39 | 40 | clean: .SYMBOLIC 41 | del *.obj 42 | del $(ZLIB_LIB) 43 | @echo Cleaning done 44 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/watcom/watcom_f.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # OpenWatcom flat model 3 | # Last updated: 28-Dec-2005 4 | 5 | # To use, do "wmake -f watcom_f.mak" 6 | 7 | C_SOURCE = adler32.c compress.c crc32.c deflate.c & 8 | gzclose.c gzlib.c gzread.c gzwrite.c & 9 | infback.c inffast.c inflate.c inftrees.c & 10 | trees.c uncompr.c zutil.c 11 | 12 | OBJS = adler32.obj compress.obj crc32.obj deflate.obj & 13 | gzclose.obj gzlib.obj gzread.obj gzwrite.obj & 14 | infback.obj inffast.obj inflate.obj inftrees.obj & 15 | trees.obj uncompr.obj zutil.obj 16 | 17 | CC = wcc386 18 | LINKER = wcl386 19 | CFLAGS = -zq -mf -3r -fp3 -s -bt=dos -oilrtfm -fr=nul -wx 20 | ZLIB_LIB = zlib_f.lib 21 | 22 | .C.OBJ: 23 | $(CC) $(CFLAGS) $[@ 24 | 25 | all: $(ZLIB_LIB) example.exe minigzip.exe 26 | 27 | $(ZLIB_LIB): $(OBJS) 28 | wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj 29 | wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj 30 | wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj 31 | wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj 32 | wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj 33 | 34 | example.exe: $(ZLIB_LIB) example.obj 35 | $(LINKER) -ldos32a -fe=example.exe example.obj $(ZLIB_LIB) 36 | 37 | minigzip.exe: $(ZLIB_LIB) minigzip.obj 38 | $(LINKER) -ldos32a -fe=minigzip.exe minigzip.obj $(ZLIB_LIB) 39 | 40 | clean: .SYMBOLIC 41 | del *.obj 42 | del $(ZLIB_LIB) 43 | @echo Cleaning done 44 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/iostream3/README: -------------------------------------------------------------------------------- 1 | These classes provide a C++ stream interface to the zlib library. It allows you 2 | to do things like: 3 | 4 | gzofstream outf("blah.gz"); 5 | outf << "These go into the gzip file " << 123 << endl; 6 | 7 | It does this by deriving a specialized stream buffer for gzipped files, which is 8 | the way Stroustrup would have done it. :-> 9 | 10 | The gzifstream and gzofstream classes were originally written by Kevin Ruland 11 | and made available in the zlib contrib/iostream directory. The older version still 12 | compiles under gcc 2.xx, but not under gcc 3.xx, which sparked the development of 13 | this version. 14 | 15 | The new classes are as standard-compliant as possible, closely following the 16 | approach of the standard library's fstream classes. It compiles under gcc versions 17 | 3.2 and 3.3, but not under gcc 2.xx. This is mainly due to changes in the standard 18 | library naming scheme. The new version of gzifstream/gzofstream/gzfilebuf differs 19 | from the previous one in the following respects: 20 | - added showmanyc 21 | - added setbuf, with support for unbuffered output via setbuf(0,0) 22 | - a few bug fixes of stream behavior 23 | - gzipped output file opened with default compression level instead of maximum level 24 | - setcompressionlevel()/strategy() members replaced by single setcompression() 25 | 26 | The code is provided "as is", with the permission to use, copy, modify, distribute 27 | and sell it for any purpose without fee. 28 | 29 | Ludwig Schwardt 30 | 31 | 32 | DSP Lab 33 | Electrical & Electronic Engineering Department 34 | University of Stellenbosch 35 | South Africa 36 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/examples/bam2bed.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "sam.h" 3 | static int fetch_func(const bam1_t *b, void *data) 4 | { 5 | samfile_t *fp = (samfile_t*)data; 6 | uint32_t *cigar = bam1_cigar(b); 7 | const bam1_core_t *c = &b->core; 8 | int i, l; 9 | if (b->core.tid < 0) return 0; 10 | for (i = l = 0; i < c->n_cigar; ++i) { 11 | int op = cigar[i]&0xf; 12 | if (op == BAM_CMATCH || op == BAM_CDEL || op == BAM_CREF_SKIP) 13 | l += cigar[i]>>4; 14 | } 15 | printf("%s\t%d\t%d\t%s\t%d\t%c\n", fp->header->target_name[c->tid], 16 | c->pos, c->pos + l, bam1_qname(b), c->qual, (c->flag&BAM_FREVERSE)? '-' : '+'); 17 | return 0; 18 | } 19 | int main(int argc, char *argv[]) 20 | { 21 | samfile_t *fp; 22 | if (argc == 1) { 23 | fprintf(stderr, "Usage: bam2bed [region]\n"); 24 | return 1; 25 | } 26 | if ((fp = samopen(argv[1], "rb", 0)) == 0) { 27 | fprintf(stderr, "bam2bed: Fail to open BAM file %s\n", argv[1]); 28 | return 1; 29 | } 30 | if (argc == 2) { /* if a region is not specified */ 31 | bam1_t *b = bam_init1(); 32 | while (samread(fp, b) >= 0) fetch_func(b, fp); 33 | bam_destroy1(b); 34 | } else { 35 | int ref, beg, end; 36 | bam_index_t *idx; 37 | if ((idx = bam_index_load(argv[1])) == 0) { 38 | fprintf(stderr, "bam2bed: BAM indexing file is not available.\n"); 39 | return 1; 40 | } 41 | bam_parse_region(fp->header, argv[2], &ref, &beg, &end); 42 | if (ref < 0) { 43 | fprintf(stderr, "bam2bed: Invalid region %s\n", argv[2]); 44 | return 1; 45 | } 46 | bam_fetch(fp->x.bam, idx, ref, beg, end, fp, fetch_func); 47 | bam_index_destroy(idx); 48 | } 49 | samclose(fp); 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/minizip.1: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .TH minizip 1 "May 2, 2001" 3 | .\" Please adjust this date whenever revising the manpage. 4 | .\" 5 | .\" Some roff macros, for reference: 6 | .\" .nh disable hyphenation 7 | .\" .hy enable hyphenation 8 | .\" .ad l left justify 9 | .\" .ad b justify to both left and right margins 10 | .\" .nf disable filling 11 | .\" .fi enable filling 12 | .\" .br insert line break 13 | .\" .sp insert n+1 empty lines 14 | .\" for manpage-specific macros, see man(7) 15 | .SH NAME 16 | minizip - create ZIP archives 17 | .SH SYNOPSIS 18 | .B minizip 19 | .RI [ -o ] 20 | zipfile [ " files" ... ] 21 | .SH DESCRIPTION 22 | .B minizip 23 | is a simple tool which allows the creation of compressed file archives 24 | in the ZIP format used by the MS-DOS utility PKZIP. It was written as 25 | a demonstration of the 26 | .IR zlib (3) 27 | library and therefore lack many of the features of the 28 | .IR zip (1) 29 | program. 30 | .SH OPTIONS 31 | The first argument supplied is the name of the ZIP archive to create or 32 | .RI -o 33 | in which case it is ignored and the second argument treated as the 34 | name of the ZIP file. If the ZIP file already exists it will be 35 | overwritten. 36 | .PP 37 | Subsequent arguments specify a list of files to place in the ZIP 38 | archive. If none are specified then an empty archive will be created. 39 | .SH SEE ALSO 40 | .BR miniunzip (1), 41 | .BR zlib (3), 42 | .BR zip (1). 43 | .SH AUTHOR 44 | This program was written by Gilles Vollant. This manual page was 45 | written by Mark Brown . 46 | 47 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/misc/Makefile: -------------------------------------------------------------------------------- 1 | CC= gcc 2 | CXX= g++ 3 | CFLAGS= -g -Wall -O2 #-m64 #-arch ppc 4 | CXXFLAGS= $(CFLAGS) 5 | DFLAGS= -D_FILE_OFFSET_BITS=64 6 | OBJS= 7 | PROG= md5sum-lite md5fa maq2sam-short maq2sam-long wgsim seqtk 8 | INCLUDES= -I.. 9 | SUBDIRS= . 10 | 11 | .SUFFIXES:.c .o 12 | 13 | .c.o: 14 | $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@ 15 | 16 | all:$(PROG) 17 | 18 | lib-recur all-recur clean-recur cleanlocal-recur install-recur: 19 | @target=`echo $@ | sed s/-recur//`; \ 20 | wdir=`pwd`; \ 21 | list='$(SUBDIRS)'; for subdir in $$list; do \ 22 | cd $$subdir; \ 23 | $(MAKE) CC="$(CC)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \ 24 | INCLUDES="$(INCLUDES)" $$target || exit 1; \ 25 | cd $$wdir; \ 26 | done; 27 | 28 | lib: 29 | 30 | seqtk:seqtk.o 31 | $(CC) $(CFLAGS) -o $@ seqtk.o -lm -lz 32 | 33 | wgsim:wgsim.o 34 | $(CC) $(CFLAGS) -o $@ wgsim.o -lm -lz 35 | 36 | md5fa:md5.o md5fa.o md5.h ../kseq.h 37 | $(CC) $(CFLAGS) -o $@ md5.o md5fa.o -lz 38 | 39 | md5sum-lite:md5sum-lite.o 40 | $(CC) $(CFLAGS) -o $@ md5sum-lite.o 41 | 42 | md5sum-lite.o:md5.c md5.h 43 | $(CC) -c $(CFLAGS) -DMD5SUM_MAIN -o $@ md5.c 44 | 45 | maq2sam-short:maq2sam.c 46 | $(CC) $(CFLAGS) -o $@ maq2sam.c -lz 47 | 48 | maq2sam-long:maq2sam.c 49 | $(CC) $(CFLAGS) -DMAQ_LONGREADS -o $@ maq2sam.c -lz 50 | 51 | md5fa.o:md5.h md5fa.c 52 | $(CC) $(CFLAGS) -c -I.. -o $@ md5fa.c 53 | 54 | seqtk.o:seqtk.c ../khash.h ../kseq.h 55 | $(CC) $(CFLAGS) -c -I.. -o $@ seqtk.c 56 | 57 | wgsim.o:wgsim.c ../kseq.h 58 | $(CC) $(CFLAGS) -c -I.. -o $@ wgsim.c 59 | 60 | cleanlocal: 61 | rm -fr gmon.out *.o a.out *.exe *.dSYM $(PROG) *~ *.a 62 | 63 | clean:cleanlocal-recur 64 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/iostream3/test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Test program for gzifstream and gzofstream 3 | * 4 | * by Ludwig Schwardt 5 | * original version by Kevin Ruland 6 | */ 7 | 8 | #include "zfstream.h" 9 | #include // for cout 10 | 11 | int main() { 12 | 13 | gzofstream outf; 14 | gzifstream inf; 15 | char buf[80]; 16 | 17 | outf.open("test1.txt.gz"); 18 | outf << "The quick brown fox sidestepped the lazy canine\n" 19 | << 1.3 << "\nPlan " << 9 << std::endl; 20 | outf.close(); 21 | std::cout << "Wrote the following message to 'test1.txt.gz' (check with zcat or zless):\n" 22 | << "The quick brown fox sidestepped the lazy canine\n" 23 | << 1.3 << "\nPlan " << 9 << std::endl; 24 | 25 | std::cout << "\nReading 'test1.txt.gz' (buffered) produces:\n"; 26 | inf.open("test1.txt.gz"); 27 | while (inf.getline(buf,80,'\n')) { 28 | std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n"; 29 | } 30 | inf.close(); 31 | 32 | outf.rdbuf()->pubsetbuf(0,0); 33 | outf.open("test2.txt.gz"); 34 | outf << setcompression(Z_NO_COMPRESSION) 35 | << "The quick brown fox sidestepped the lazy canine\n" 36 | << 1.3 << "\nPlan " << 9 << std::endl; 37 | outf.close(); 38 | std::cout << "\nWrote the same message to 'test2.txt.gz' in uncompressed form"; 39 | 40 | std::cout << "\nReading 'test2.txt.gz' (unbuffered) produces:\n"; 41 | inf.rdbuf()->pubsetbuf(0,0); 42 | inf.open("test2.txt.gz"); 43 | while (inf.getline(buf,80,'\n')) { 44 | std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n"; 45 | } 46 | inf.close(); 47 | 48 | return 0; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/old/descrip.mms: -------------------------------------------------------------------------------- 1 | # descrip.mms: MMS description file for building zlib on VMS 2 | # written by Martin P.J. Zinser 3 | 4 | cc_defs = 5 | c_deb = 6 | 7 | .ifdef __DECC__ 8 | pref = /prefix=all 9 | .endif 10 | 11 | OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj,\ 12 | deflate.obj, trees.obj, zutil.obj, inflate.obj, infblock.obj,\ 13 | inftrees.obj, infcodes.obj, infutil.obj, inffast.obj 14 | 15 | CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) 16 | 17 | all : example.exe minigzip.exe 18 | @ write sys$output " Example applications available" 19 | libz.olb : libz.olb($(OBJS)) 20 | @ write sys$output " libz available" 21 | 22 | example.exe : example.obj libz.olb 23 | link example,libz.olb/lib 24 | 25 | minigzip.exe : minigzip.obj libz.olb 26 | link minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib 27 | 28 | clean : 29 | delete *.obj;*,libz.olb;* 30 | 31 | 32 | # Other dependencies. 33 | adler32.obj : zutil.h zlib.h zconf.h 34 | compress.obj : zlib.h zconf.h 35 | crc32.obj : zutil.h zlib.h zconf.h 36 | deflate.obj : deflate.h zutil.h zlib.h zconf.h 37 | example.obj : zlib.h zconf.h 38 | gzio.obj : zutil.h zlib.h zconf.h 39 | infblock.obj : zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h 40 | infcodes.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h 41 | inffast.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h 42 | inflate.obj : zutil.h zlib.h zconf.h infblock.h 43 | inftrees.obj : zutil.h zlib.h zconf.h inftrees.h 44 | infutil.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h 45 | minigzip.obj : zlib.h zconf.h 46 | trees.obj : deflate.h zutil.h zlib.h zconf.h 47 | uncompr.obj : zlib.h zconf.h 48 | zutil.obj : zutil.h zlib.h zconf.h 49 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/infback9/infback9.h: -------------------------------------------------------------------------------- 1 | /* infback9.h -- header for using inflateBack9 functions 2 | * Copyright (C) 2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* 7 | * This header file and associated patches provide a decoder for PKWare's 8 | * undocumented deflate64 compression method (method 9). Use with infback9.c, 9 | * inftree9.h, inftree9.c, and inffix9.h. These patches are not supported. 10 | * This should be compiled with zlib, since it uses zutil.h and zutil.o. 11 | * This code has not yet been tested on 16-bit architectures. See the 12 | * comments in zlib.h for inflateBack() usage. These functions are used 13 | * identically, except that there is no windowBits parameter, and a 64K 14 | * window must be provided. Also if int's are 16 bits, then a zero for 15 | * the third parameter of the "out" function actually means 65536UL. 16 | * zlib.h must be included before this header file. 17 | */ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | ZEXTERN int ZEXPORT inflateBack9 OF((z_stream FAR *strm, 24 | in_func in, void FAR *in_desc, 25 | out_func out, void FAR *out_desc)); 26 | ZEXTERN int ZEXPORT inflateBack9End OF((z_stream FAR *strm)); 27 | ZEXTERN int ZEXPORT inflateBack9Init_ OF((z_stream FAR *strm, 28 | unsigned char FAR *window, 29 | const char *version, 30 | int stream_size)); 31 | #define inflateBack9Init(strm, window) \ 32 | inflateBack9Init_((strm), (window), \ 33 | ZLIB_VERSION, sizeof(z_stream)) 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/msdos/Makefile.emx: -------------------------------------------------------------------------------- 1 | # Makefile for zlib. Modified for emx 0.9c by Chr. Spieler, 6/17/98. 2 | # Copyright (C) 1995-1998 Jean-loup Gailly. 3 | # For conditions of distribution and use, see copyright notice in zlib.h 4 | 5 | # To compile, or to compile and test, type: 6 | # 7 | # make -fmakefile.emx; make test -fmakefile.emx 8 | # 9 | 10 | CC=gcc 11 | 12 | #CFLAGS=-MMD -O 13 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 14 | #CFLAGS=-MMD -g -DDEBUG 15 | CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 16 | -Wstrict-prototypes -Wmissing-prototypes 17 | 18 | # If cp.exe is available, replace "copy /Y" with "cp -fp" . 19 | CP=copy /Y 20 | # If gnu install.exe is available, replace $(CP) with ginstall. 21 | INSTALL=$(CP) 22 | # The default value of RM is "rm -f." If "rm.exe" is found, comment out: 23 | RM=del 24 | LDLIBS=-L. -lzlib 25 | LD=$(CC) -s -o 26 | LDSHARED=$(CC) 27 | 28 | INCL=zlib.h zconf.h 29 | LIBS=zlib.a 30 | 31 | AR=ar rcs 32 | 33 | prefix=/usr/local 34 | exec_prefix = $(prefix) 35 | 36 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 37 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 38 | 39 | TEST_OBJS = example.o minigzip.o 40 | 41 | all: example.exe minigzip.exe 42 | 43 | test: all 44 | ./example 45 | echo hello world | .\minigzip | .\minigzip -d 46 | 47 | %.o : %.c 48 | $(CC) $(CFLAGS) -c $< -o $@ 49 | 50 | zlib.a: $(OBJS) 51 | $(AR) $@ $(OBJS) 52 | 53 | %.exe : %.o $(LIBS) 54 | $(LD) $@ $< $(LDLIBS) 55 | 56 | 57 | .PHONY : clean 58 | 59 | clean: 60 | $(RM) *.d 61 | $(RM) *.o 62 | $(RM) *.exe 63 | $(RM) zlib.a 64 | $(RM) foo.gz 65 | 66 | DEPS := $(wildcard *.d) 67 | ifneq ($(DEPS),) 68 | include $(DEPS) 69 | endif 70 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/old/Makefile.emx: -------------------------------------------------------------------------------- 1 | # Makefile for zlib. Modified for emx/rsxnt by Chr. Spieler, 6/16/98. 2 | # Copyright (C) 1995-1998 Jean-loup Gailly. 3 | # For conditions of distribution and use, see copyright notice in zlib.h 4 | 5 | # To compile, or to compile and test, type: 6 | # 7 | # make -fmakefile.emx; make test -fmakefile.emx 8 | # 9 | 10 | CC=gcc -Zwin32 11 | 12 | #CFLAGS=-MMD -O 13 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 14 | #CFLAGS=-MMD -g -DDEBUG 15 | CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 16 | -Wstrict-prototypes -Wmissing-prototypes 17 | 18 | # If cp.exe is available, replace "copy /Y" with "cp -fp" . 19 | CP=copy /Y 20 | # If gnu install.exe is available, replace $(CP) with ginstall. 21 | INSTALL=$(CP) 22 | # The default value of RM is "rm -f." If "rm.exe" is found, comment out: 23 | RM=del 24 | LDLIBS=-L. -lzlib 25 | LD=$(CC) -s -o 26 | LDSHARED=$(CC) 27 | 28 | INCL=zlib.h zconf.h 29 | LIBS=zlib.a 30 | 31 | AR=ar rcs 32 | 33 | prefix=/usr/local 34 | exec_prefix = $(prefix) 35 | 36 | OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \ 37 | gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 38 | 39 | TEST_OBJS = example.o minigzip.o 40 | 41 | all: example.exe minigzip.exe 42 | 43 | test: all 44 | ./example 45 | echo hello world | .\minigzip | .\minigzip -d 46 | 47 | %.o : %.c 48 | $(CC) $(CFLAGS) -c $< -o $@ 49 | 50 | zlib.a: $(OBJS) 51 | $(AR) $@ $(OBJS) 52 | 53 | %.exe : %.o $(LIBS) 54 | $(LD) $@ $< $(LDLIBS) 55 | 56 | 57 | .PHONY : clean 58 | 59 | clean: 60 | $(RM) *.d 61 | $(RM) *.o 62 | $(RM) *.exe 63 | $(RM) zlib.a 64 | $(RM) foo.gz 65 | 66 | DEPS := $(wildcard *.d) 67 | ifneq ($(DEPS),) 68 | include $(DEPS) 69 | endif 70 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_reheader.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "bgzf.h" 4 | #include "bam.h" 5 | 6 | #define BUF_SIZE 0x10000 7 | 8 | int bam_reheader(BGZF *in, const bam_header_t *h, int fd) 9 | { 10 | BGZF *fp; 11 | bam_header_t *old; 12 | int len; 13 | uint8_t *buf; 14 | if (in->open_mode != 'r') return -1; 15 | buf = malloc(BUF_SIZE); 16 | old = bam_header_read(in); 17 | fp = bgzf_fdopen(fd, "w"); 18 | bam_header_write(fp, h); 19 | if (in->block_offset < in->block_length) { 20 | bgzf_write(fp, in->uncompressed_block + in->block_offset, in->block_length - in->block_offset); 21 | bgzf_flush(fp); 22 | } 23 | #ifdef _USE_KNETFILE 24 | while ((len = knet_read(in->x.fpr, buf, BUF_SIZE)) > 0) 25 | fwrite(buf, 1, len, fp->x.fpw); 26 | #else 27 | while (!feof(in->file) && (len = fread(buf, 1, BUF_SIZE, in->file)) > 0) 28 | fwrite(buf, 1, len, fp->file); 29 | #endif 30 | free(buf); 31 | fp->block_offset = in->block_offset = 0; 32 | bgzf_close(fp); 33 | return 0; 34 | } 35 | 36 | int main_reheader(int argc, char *argv[]) 37 | { 38 | bam_header_t *h; 39 | BGZF *in; 40 | if (argc != 3) { 41 | fprintf(stderr, "Usage: samtools reheader \n"); 42 | return 1; 43 | } 44 | { // read the header 45 | tamFile fph = sam_open(argv[1]); 46 | if (fph == 0) { 47 | fprintf(stderr, "[%s] fail to read the header from %s.\n", __func__, argv[1]); 48 | return 1; 49 | } 50 | h = sam_header_read(fph); 51 | sam_close(fph); 52 | } 53 | in = strcmp(argv[2], "-")? bam_open(argv[2], "r") : bam_dopen(fileno(stdin), "r"); 54 | if (in == 0) { 55 | fprintf(stderr, "[%s] fail to open file %s.\n", __func__, argv[2]); 56 | return 1; 57 | } 58 | bam_reheader(in, h, fileno(stdout)); 59 | bgzf_close(in); 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/kprobaln.h: -------------------------------------------------------------------------------- 1 | /* The MIT License 2 | 3 | Copyright (c) 2003-2006, 2008, 2009 by Heng Li 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | 26 | #ifndef LH3_KPROBALN_H_ 27 | #define LH3_KPROBALN_H_ 28 | 29 | #include 30 | 31 | typedef struct { 32 | float d, e; 33 | int bw; 34 | } kpa_par_t; 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | int kpa_glocal(const uint8_t *_ref, int l_ref, const uint8_t *_query, int l_query, const uint8_t *iqual, 41 | const kpa_par_t *c, int *state, uint8_t *q); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | extern kpa_par_t kpa_par_def, kpa_par_alt; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/win32/zlib.def: -------------------------------------------------------------------------------- 1 | ; zlib data compression library 2 | EXPORTS 3 | ; basic functions 4 | zlibVersion 5 | deflate 6 | deflateEnd 7 | inflate 8 | inflateEnd 9 | ; advanced functions 10 | deflateSetDictionary 11 | deflateCopy 12 | deflateReset 13 | deflateParams 14 | deflateTune 15 | deflateBound 16 | deflatePending 17 | deflatePrime 18 | deflateSetHeader 19 | inflateSetDictionary 20 | inflateGetDictionary 21 | inflateSync 22 | inflateCopy 23 | inflateReset 24 | inflateReset2 25 | inflatePrime 26 | inflateMark 27 | inflateGetHeader 28 | inflateBack 29 | inflateBackEnd 30 | zlibCompileFlags 31 | ; utility functions 32 | compress 33 | compress2 34 | compressBound 35 | uncompress 36 | gzopen 37 | gzdopen 38 | gzbuffer 39 | gzsetparams 40 | gzread 41 | gzwrite 42 | gzprintf 43 | gzvprintf 44 | gzputs 45 | gzgets 46 | gzputc 47 | gzgetc 48 | gzungetc 49 | gzflush 50 | gzseek 51 | gzrewind 52 | gztell 53 | gzoffset 54 | gzeof 55 | gzdirect 56 | gzclose 57 | gzclose_r 58 | gzclose_w 59 | gzerror 60 | gzclearerr 61 | ; large file functions 62 | gzopen64 63 | gzseek64 64 | gztell64 65 | gzoffset64 66 | adler32_combine64 67 | crc32_combine64 68 | ; checksum functions 69 | adler32 70 | crc32 71 | adler32_combine 72 | crc32_combine 73 | ; various hacks, don't look :) 74 | deflateInit_ 75 | deflateInit2_ 76 | inflateInit_ 77 | inflateInit2_ 78 | inflateBackInit_ 79 | gzgetc_ 80 | zError 81 | inflateSyncPoint 82 | get_crc_table 83 | inflateUndermine 84 | inflateResetKeep 85 | deflateResetKeep 86 | gzopen_w 87 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/misc/md5fa.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "md5.h" 4 | #include "kseq.h" 5 | 6 | #define HEX_STR "0123456789abcdef" 7 | 8 | KSEQ_INIT(gzFile, gzread) 9 | 10 | static void md5_one(const char *fn) 11 | { 12 | MD5_CTX md5_one, md5_all; 13 | int l, i, k; 14 | gzFile fp; 15 | kseq_t *seq; 16 | unsigned char unordered[16], digest[16]; 17 | 18 | for (l = 0; l < 16; ++l) unordered[l] = 0; 19 | fp = strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(fileno(stdin), "r"); 20 | if (fp == 0) { 21 | fprintf(stderr, "md5fa: %s: No such file or directory\n", fn); 22 | exit(1); 23 | } 24 | 25 | MD5Init(&md5_all); 26 | seq = kseq_init(fp); 27 | while ((l = kseq_read(seq)) >= 0) { 28 | for (i = k = 0; i < seq->seq.l; ++i) { 29 | if (islower(seq->seq.s[i])) seq->seq.s[k++] = toupper(seq->seq.s[i]); 30 | else if (isupper(seq->seq.s[i])) seq->seq.s[k++] = seq->seq.s[i]; 31 | } 32 | MD5Init(&md5_one); 33 | MD5Update(&md5_one, (unsigned char*)seq->seq.s, k); 34 | MD5Final(digest, &md5_one); 35 | for (l = 0; l < 16; ++l) { 36 | printf("%c%c", HEX_STR[digest[l]>>4&0xf], HEX_STR[digest[l]&0xf]); 37 | unordered[l] ^= digest[l]; 38 | } 39 | printf(" %s %s\n", fn, seq->name.s); 40 | MD5Update(&md5_all, (unsigned char*)seq->seq.s, k); 41 | } 42 | MD5Final(digest, &md5_all); 43 | kseq_destroy(seq); 44 | for (l = 0; l < 16; ++l) 45 | printf("%c%c", HEX_STR[digest[l]>>4&0xf], HEX_STR[digest[l]&0xf]); 46 | printf(" %s >ordered\n", fn); 47 | for (l = 0; l < 16; ++l) 48 | printf("%c%c", HEX_STR[unordered[l]>>4&0xf], HEX_STR[unordered[l]&0xf]); 49 | printf(" %s >unordered\n", fn); 50 | } 51 | 52 | int main(int argc, char *argv[]) 53 | { 54 | int i; 55 | if (argc == 1) md5_one("-"); 56 | else for (i = 1; i < argc; ++i) md5_one(argv[i]); 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam2bcf.h: -------------------------------------------------------------------------------- 1 | #ifndef BAM2BCF_H 2 | #define BAM2BCF_H 3 | 4 | #include 5 | #include "errmod.h" 6 | #include "bcftools/bcf.h" 7 | 8 | #define B2B_INDEL_NULL 10000 9 | 10 | typedef struct __bcf_callaux_t { 11 | int capQ, min_baseQ; 12 | int openQ, extQ, tandemQ; // for indels 13 | int min_support; // for collecting indel candidates 14 | double min_frac; // for collecting indel candidates 15 | // for internal uses 16 | int max_bases; 17 | int indel_types[4]; 18 | int maxins, indelreg; 19 | char *inscns; 20 | uint16_t *bases; 21 | errmod_t *e; 22 | void *rghash; 23 | } bcf_callaux_t; 24 | 25 | typedef struct { 26 | int depth, ori_depth, qsum[4]; 27 | int anno[16]; 28 | float p[25]; 29 | int mvd[3]; // mean variant distance, number of variant reads, average read length 30 | } bcf_callret1_t; 31 | 32 | typedef struct { 33 | int a[5]; // alleles: ref, alt, alt2, alt3 34 | int n, n_alleles, shift, ori_ref, unseen; 35 | int anno[16], depth, ori_depth; 36 | uint8_t *PL; 37 | float vdb; // variant distance bias 38 | } bcf_call_t; 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | bcf_callaux_t *bcf_call_init(double theta, int min_baseQ); 45 | void bcf_call_destroy(bcf_callaux_t *bca); 46 | int bcf_call_glfgen(int _n, const bam_pileup1_t *pl, int ref_base, bcf_callaux_t *bca, bcf_callret1_t *r); 47 | int bcf_call_combine(int n, const bcf_callret1_t *calls, int ref_base /*4-bit*/, bcf_call_t *call); 48 | int bcf_call2bcf(int tid, int pos, bcf_call_t *bc, bcf1_t *b, bcf_callret1_t *bcr, int is_SP, 49 | const bcf_callaux_t *bca, const char *ref); 50 | int bcf_call_gap_prep(int n, int *n_plp, bam_pileup1_t **plp, int pos, bcf_callaux_t *bca, const char *ref, 51 | const void *rghash); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/kmin.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, 2010 by Attractive Chaos 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | 25 | #ifndef KMIN_H 26 | #define KMIN_H 27 | 28 | #define KMIN_RADIUS 0.5 29 | #define KMIN_EPS 1e-7 30 | #define KMIN_MAXCALL 50000 31 | 32 | typedef double (*kmin_f)(int, double*, void*); 33 | typedef double (*kmin1_f)(double, void*); 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | double kmin_hj(kmin_f func, int n, double *x, void *data, double r, double eps, int max_calls); 40 | double kmin_brent(kmin1_f func, double a, double b, void *data, double tol, double *xmin); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/asm686/README.686: -------------------------------------------------------------------------------- 1 | This is a patched version of zlib, modified to use 2 | Pentium-Pro-optimized assembly code in the deflation algorithm. The 3 | files changed/added by this patch are: 4 | 5 | README.686 6 | match.S 7 | 8 | The speedup that this patch provides varies, depending on whether the 9 | compiler used to build the original version of zlib falls afoul of the 10 | PPro's speed traps. My own tests show a speedup of around 10-20% at 11 | the default compression level, and 20-30% using -9, against a version 12 | compiled using gcc 2.7.2.3. Your mileage may vary. 13 | 14 | Note that this code has been tailored for the PPro/PII in particular, 15 | and will not perform particuarly well on a Pentium. 16 | 17 | If you are using an assembler other than GNU as, you will have to 18 | translate match.S to use your assembler's syntax. (Have fun.) 19 | 20 | Brian Raiter 21 | breadbox@muppetlabs.com 22 | April, 1998 23 | 24 | 25 | Added for zlib 1.1.3: 26 | 27 | The patches come from 28 | http://www.muppetlabs.com/~breadbox/software/assembly.html 29 | 30 | To compile zlib with this asm file, copy match.S to the zlib directory 31 | then do: 32 | 33 | CFLAGS="-O3 -DASMV" ./configure 34 | make OBJA=match.o 35 | 36 | 37 | Update: 38 | 39 | I've been ignoring these assembly routines for years, believing that 40 | gcc's generated code had caught up with it sometime around gcc 2.95 41 | and the major rearchitecting of the Pentium 4. However, I recently 42 | learned that, despite what I believed, this code still has some life 43 | in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% 44 | faster than the code produced by gcc 4.1. 45 | 46 | In acknowledgement of its continuing usefulness, I've altered the 47 | license to match that of the rest of zlib. Share and Enjoy! 48 | 49 | Brian Raiter 50 | breadbox@muppetlabs.com 51 | April, 2007 52 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/examples/calDepth.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "sam.h" 3 | 4 | typedef struct { 5 | int beg, end; 6 | samfile_t *in; 7 | } tmpstruct_t; 8 | 9 | // callback for bam_fetch() 10 | static int fetch_func(const bam1_t *b, void *data) 11 | { 12 | bam_plbuf_t *buf = (bam_plbuf_t*)data; 13 | bam_plbuf_push(b, buf); 14 | return 0; 15 | } 16 | // callback for bam_plbuf_init() 17 | static int pileup_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pl, void *data) 18 | { 19 | tmpstruct_t *tmp = (tmpstruct_t*)data; 20 | if ((int)pos >= tmp->beg && (int)pos < tmp->end) 21 | printf("%s\t%d\t%d\n", tmp->in->header->target_name[tid], pos + 1, n); 22 | return 0; 23 | } 24 | 25 | int main(int argc, char *argv[]) 26 | { 27 | tmpstruct_t tmp; 28 | if (argc == 1) { 29 | fprintf(stderr, "Usage: calDepth [region]\n"); 30 | return 1; 31 | } 32 | tmp.beg = 0; tmp.end = 0x7fffffff; 33 | tmp.in = samopen(argv[1], "rb", 0); 34 | if (tmp.in == 0) { 35 | fprintf(stderr, "Fail to open BAM file %s\n", argv[1]); 36 | return 1; 37 | } 38 | if (argc == 2) { // if a region is not specified 39 | sampileup(tmp.in, -1, pileup_func, &tmp); 40 | } else { 41 | int ref; 42 | bam_index_t *idx; 43 | bam_plbuf_t *buf; 44 | idx = bam_index_load(argv[1]); // load BAM index 45 | if (idx == 0) { 46 | fprintf(stderr, "BAM indexing file is not available.\n"); 47 | return 1; 48 | } 49 | bam_parse_region(tmp.in->header, argv[2], &ref, &tmp.beg, &tmp.end); // parse the region 50 | if (ref < 0) { 51 | fprintf(stderr, "Invalid region %s\n", argv[2]); 52 | return 1; 53 | } 54 | buf = bam_plbuf_init(pileup_func, &tmp); // initialize pileup 55 | bam_fetch(tmp.in->x.bam, idx, ref, tmp.beg, tmp.end, buf, fetch_func); 56 | bam_plbuf_push(0, buf); // finalize pileup 57 | bam_index_destroy(idx); 58 | bam_plbuf_destroy(buf); 59 | } 60 | samclose(tmp.in); 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/knetfile.h: -------------------------------------------------------------------------------- 1 | #ifndef KNETFILE_H 2 | #define KNETFILE_H 3 | 4 | #include 5 | #include 6 | 7 | #ifndef _WIN32 8 | #define netread(fd, ptr, len) read(fd, ptr, len) 9 | #define netwrite(fd, ptr, len) write(fd, ptr, len) 10 | #define netclose(fd) close(fd) 11 | #else 12 | #include 13 | #define netread(fd, ptr, len) recv(fd, ptr, len, 0) 14 | #define netwrite(fd, ptr, len) send(fd, ptr, len, 0) 15 | #define netclose(fd) closesocket(fd) 16 | #endif 17 | 18 | // FIXME: currently I/O is unbuffered 19 | 20 | #define KNF_TYPE_LOCAL 1 21 | #define KNF_TYPE_FTP 2 22 | #define KNF_TYPE_HTTP 3 23 | 24 | typedef struct knetFile_s { 25 | int type, fd; 26 | int64_t offset; 27 | char *host, *port; 28 | 29 | // the following are for FTP only 30 | int ctrl_fd, pasv_ip[4], pasv_port, max_response, no_reconnect, is_ready; 31 | char *response, *retr, *size_cmd; 32 | int64_t seek_offset; // for lazy seek 33 | int64_t file_size; 34 | 35 | // the following are for HTTP only 36 | char *path, *http_host; 37 | } knetFile; 38 | 39 | #define knet_tell(fp) ((fp)->offset) 40 | #define knet_fileno(fp) ((fp)->fd) 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | #ifdef _WIN32 47 | int knet_win32_init(); 48 | void knet_win32_destroy(); 49 | #endif 50 | 51 | knetFile *knet_open(const char *fn, const char *mode); 52 | 53 | /* 54 | This only works with local files. 55 | */ 56 | knetFile *knet_dopen(int fd, const char *mode); 57 | 58 | /* 59 | If ->is_ready==0, this routine updates ->fd; otherwise, it simply 60 | reads from ->fd. 61 | */ 62 | off_t knet_read(knetFile *fp, void *buf, off_t len); 63 | 64 | /* 65 | This routine only sets ->offset and ->is_ready=0. It does not 66 | communicate with the FTP server. 67 | */ 68 | off_t knet_seek(knetFile *fp, int64_t off, int whence); 69 | int knet_close(knetFile *fp); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/misc/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is adapted from a program in this page: 3 | 4 | http://www.fourmilab.ch/md5/ 5 | 6 | The original source code does not work on 64-bit machines due to the 7 | wrong typedef "uint32". I also added prototypes. 8 | 9 | -lh3 10 | */ 11 | 12 | #ifndef MD5_H 13 | #define MD5_H 14 | 15 | /* The following tests optimise behaviour on little-endian 16 | machines, where there is no need to reverse the byte order 17 | of 32 bit words in the MD5 computation. By default, 18 | HIGHFIRST is defined, which indicates we're running on a 19 | big-endian (most significant byte first) machine, on which 20 | the byteReverse function in md5.c must be invoked. However, 21 | byteReverse is coded in such a way that it is an identity 22 | function when run on a little-endian machine, so calling it 23 | on such a platform causes no harm apart from wasting time. 24 | If the platform is known to be little-endian, we speed 25 | things up by undefining HIGHFIRST, which defines 26 | byteReverse as a null macro. Doing things in this manner 27 | insures we work on new platforms regardless of their byte 28 | order. */ 29 | 30 | #define HIGHFIRST 31 | 32 | #if __LITTLE_ENDIAN__ != 0 33 | #undef HIGHFIRST 34 | #endif 35 | 36 | #include 37 | 38 | struct MD5Context { 39 | uint32_t buf[4]; 40 | uint32_t bits[2]; 41 | unsigned char in[64]; 42 | }; 43 | 44 | void MD5Init(struct MD5Context *ctx); 45 | void MD5Update(struct MD5Context *ctx, unsigned char *buf, unsigned len); 46 | void MD5Final(unsigned char digest[16], struct MD5Context *ctx); 47 | 48 | /* 49 | * This is needed to make RSAREF happy on some MS-DOS compilers. 50 | */ 51 | typedef struct MD5Context MD5_CTX; 52 | 53 | /* Define CHECK_HARDWARE_PROPERTIES to have main,c verify 54 | byte order and uint32_t settings. */ 55 | #define CHECK_HARDWARE_PROPERTIES 56 | 57 | #endif /* !MD5_H */ 58 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/examples/README.examples: -------------------------------------------------------------------------------- 1 | This directory contains examples of the use of zlib and other relevant 2 | programs and documentation. 3 | 4 | enough.c 5 | calculation and justification of ENOUGH parameter in inftrees.h 6 | - calculates the maximum table space used in inflate tree 7 | construction over all possible Huffman codes 8 | 9 | fitblk.c 10 | compress just enough input to nearly fill a requested output size 11 | - zlib isn't designed to do this, but fitblk does it anyway 12 | 13 | gun.c 14 | uncompress a gzip file 15 | - illustrates the use of inflateBack() for high speed file-to-file 16 | decompression using call-back functions 17 | - is approximately twice as fast as gzip -d 18 | - also provides Unix uncompress functionality, again twice as fast 19 | 20 | gzappend.c 21 | append to a gzip file 22 | - illustrates the use of the Z_BLOCK flush parameter for inflate() 23 | - illustrates the use of deflatePrime() to start at any bit 24 | 25 | gzjoin.c 26 | join gzip files without recalculating the crc or recompressing 27 | - illustrates the use of the Z_BLOCK flush parameter for inflate() 28 | - illustrates the use of crc32_combine() 29 | 30 | gzlog.c 31 | gzlog.h 32 | efficiently and robustly maintain a message log file in gzip format 33 | - illustrates use of raw deflate, Z_PARTIAL_FLUSH, deflatePrime(), 34 | and deflateSetDictionary() 35 | - illustrates use of a gzip header extra field 36 | 37 | zlib_how.html 38 | painfully comprehensive description of zpipe.c (see below) 39 | - describes in excruciating detail the use of deflate() and inflate() 40 | 41 | zpipe.c 42 | reads and writes zlib streams from stdin to stdout 43 | - illustrates the proper use of deflate() and inflate() 44 | - deeply commented in zlib_how.html (see above) 45 | 46 | zran.c 47 | index a zlib or gzip stream and randomly access it 48 | - illustrates the use of Z_BLOCK, inflatePrime(), and 49 | inflateSetDictionary() to provide random access 50 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/puff/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-O 2 | 3 | puff: puff.o pufftest.o 4 | 5 | puff.o: puff.h 6 | 7 | pufftest.o: puff.h 8 | 9 | test: puff 10 | puff zeros.raw 11 | 12 | puft: puff.c puff.h pufftest.o 13 | cc -fprofile-arcs -ftest-coverage -o puft puff.c pufftest.o 14 | 15 | # puff full coverage test (should say 100%) 16 | cov: puft 17 | @rm -f *.gcov *.gcda 18 | @puft -w zeros.raw 2>&1 | cat > /dev/null 19 | @echo '04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 20 | @echo '00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 21 | @echo '00 00 00 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 254 22 | @echo '00 01 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 23 | @echo '01 01 00 fe ff 0a' | xxd -r -p | puft -f 2>&1 | cat > /dev/null 24 | @echo '02 7e ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 25 | @echo '02' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 26 | @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 27 | @echo '04 80 49 92 24 49 92 24 71 ff ff 93 11 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 249 28 | @echo '04 c0 81 08 00 00 00 00 20 7f eb 0b 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 29 | @echo '0b 00 00' | xxd -r -p | puft -f 2>&1 | cat > /dev/null 30 | @echo '1a 07' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 31 | @echo '0c c0 81 00 00 00 00 00 90 ff 6b 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 245 32 | @puft -f zeros.raw 2>&1 | cat > /dev/null 33 | @echo 'fc 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 253 34 | @echo '04 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 252 35 | @echo '04 00 24 49' | xxd -r -p | puft 2> /dev/null || test $$? -eq 251 36 | @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 84' | xxd -r -p | puft 2> /dev/null || test $$? -eq 248 37 | @echo '04 00 24 e9 ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 250 38 | @echo '04 00 24 e9 ff 6d' | xxd -r -p | puft 2> /dev/null || test $$? -eq 247 39 | @gcov -n puff.c 40 | 41 | clean: 42 | rm -f puff puft *.o *.gc* 43 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/bcftools/README: -------------------------------------------------------------------------------- 1 | The view command of bcftools calls variants, tests Hardy-Weinberg 2 | equilibrium (HWE), tests allele balances and estimates allele frequency. 3 | 4 | This command calls a site as a potential variant if P(ref|D,F) is below 5 | 0.9 (controlled by the -p option), where D is data and F is the prior 6 | allele frequency spectrum (AFS). 7 | 8 | The view command performs two types of allele balance tests, both based 9 | on Fisher's exact test for 2x2 contingency tables with the row variable 10 | being reference allele or not. In the first table, the column variable 11 | is strand. Two-tail P-value is taken. We test if variant bases tend to 12 | come from one strand. In the second table, the column variable is 13 | whether a base appears in the first or the last 11bp of the read. 14 | One-tail P-value is taken. We test if variant bases tend to occur 15 | towards the end of reads, which is usually an indication of 16 | misalignment. 17 | 18 | Site allele frequency is estimated in two ways. In the first way, the 19 | frequency is esimated as \argmax_f P(D|f) under the assumption of 20 | HWE. Prior AFS is not used. In the second way, the frequency is 21 | estimated as the posterior expectation of allele counts \sum_k 22 | kP(k|D,F), dividied by the total number of haplotypes. HWE is not 23 | assumed, but the estimate depends on the prior AFS. The two estimates 24 | largely agree when the signal is strong, but may differ greatly on weak 25 | sites as in this case, the prior plays an important role. 26 | 27 | To test HWE, we calculate the posterior distribution of genotypes 28 | (ref-hom, het and alt-hom). Chi-square test is performed. It is worth 29 | noting that the model used here is prior dependent and assumes HWE, 30 | which is different from both models for allele frequency estimate. The 31 | new model actually yields a third estimate of site allele frequency. 32 | 33 | The estimate allele frequency spectrum is printed to stderr per 64k 34 | sites. The estimate is in fact only the first round of a EM 35 | procedure. The second model (not the model for HWE testing) is used to 36 | estimate the AFS. -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/minizip/miniunzip.1: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .TH miniunzip 1 "Nov 7, 2001" 3 | .\" Please adjust this date whenever revising the manpage. 4 | .\" 5 | .\" Some roff macros, for reference: 6 | .\" .nh disable hyphenation 7 | .\" .hy enable hyphenation 8 | .\" .ad l left justify 9 | .\" .ad b justify to both left and right margins 10 | .\" .nf disable filling 11 | .\" .fi enable filling 12 | .\" .br insert line break 13 | .\" .sp insert n+1 empty lines 14 | .\" for manpage-specific macros, see man(7) 15 | .SH NAME 16 | miniunzip - uncompress and examine ZIP archives 17 | .SH SYNOPSIS 18 | .B miniunzip 19 | .RI [ -exvlo ] 20 | zipfile [ files_to_extract ] [-d tempdir] 21 | .SH DESCRIPTION 22 | .B minizip 23 | is a simple tool which allows the extraction of compressed file 24 | archives in the ZIP format used by the MS-DOS utility PKZIP. It was 25 | written as a demonstration of the 26 | .IR zlib (3) 27 | library and therefore lack many of the features of the 28 | .IR unzip (1) 29 | program. 30 | .SH OPTIONS 31 | A number of options are supported. With the exception of 32 | .BI \-d\ tempdir 33 | these must be supplied before any 34 | other arguments and are: 35 | .TP 36 | .BI \-l\ ,\ \-\-v 37 | List the files in the archive without extracting them. 38 | .TP 39 | .B \-o 40 | Overwrite files without prompting for confirmation. 41 | .TP 42 | .B \-x 43 | Extract files (default). 44 | .PP 45 | The 46 | .I zipfile 47 | argument is the name of the archive to process. The next argument can be used 48 | to specify a single file to extract from the archive. 49 | 50 | Lastly, the following option can be specified at the end of the command-line: 51 | .TP 52 | .BI \-d\ tempdir 53 | Extract the archive in the directory 54 | .I tempdir 55 | rather than the current directory. 56 | .SH SEE ALSO 57 | .BR minizip (1), 58 | .BR zlib (3), 59 | .BR unzip (1). 60 | .SH AUTHOR 61 | This program was written by Gilles Vollant. This manual page was 62 | written by Mark Brown . The -d tempdir option 63 | was added by Dirk Eddelbuettel . 64 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/amiga/Makefile.sas: -------------------------------------------------------------------------------- 1 | # SMakefile for zlib 2 | # Modified from the standard UNIX Makefile Copyright Jean-loup Gailly 3 | # Osma Ahvenlampi 4 | # Amiga, SAS/C 6.56 & Smake 5 | 6 | CC=sc 7 | CFLAGS=OPT 8 | #CFLAGS=OPT CPU=68030 9 | #CFLAGS=DEBUG=LINE 10 | LDFLAGS=LIB z.lib 11 | 12 | SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \ 13 | NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \ 14 | DEF=POSTINC 15 | 16 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 17 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 18 | 19 | TEST_OBJS = example.o minigzip.o 20 | 21 | all: SCOPTIONS example minigzip 22 | 23 | check: test 24 | test: all 25 | example 26 | echo hello world | minigzip | minigzip -d 27 | 28 | install: z.lib 29 | copy clone zlib.h zconf.h INCLUDE: 30 | copy clone z.lib LIB: 31 | 32 | z.lib: $(OBJS) 33 | oml z.lib r $(OBJS) 34 | 35 | example: example.o z.lib 36 | $(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS) 37 | 38 | minigzip: minigzip.o z.lib 39 | $(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS) 40 | 41 | mostlyclean: clean 42 | clean: 43 | -delete force quiet example minigzip *.o z.lib foo.gz *.lnk SCOPTIONS 44 | 45 | SCOPTIONS: Makefile.sas 46 | copy to $@ ex1.pileup.gz 13 | ex1.glf:ex1.bam ex1.fa 14 | ../samtools pileup -gf ex1.fa ex1.bam > ex1.glf 15 | ex1.glfview.gz:ex1.glf 16 | ../samtools glfview ex1.glf | gzip > ex1.glfview.gz 17 | ex1a.bam:ex1.bam 18 | ../samtools view -h ex1.bam | awk 'BEGIN{FS=OFS="\t"}{if(/^@/)print;else{$$1=$$1"a";print}}' | ../samtools view -bS - > $@ 19 | ex1b.bam:ex1.bam 20 | ../samtools view -h ex1.bam | awk 'BEGIN{FS=OFS="\t"}{if(/^@/)print;else{$$1=$$1"b";print}}' | ../samtools view -bS - > $@ 21 | ex1f.rg: 22 | (echo "@RG ID:ex1 LB:ex1 SM:ex1"; echo "@RG ID:ex1a LB:ex1 SM:ex1"; echo "@RG ID:ex1b LB:ex1b SM:ex1b") > $@ 23 | ex1f.bam:ex1.bam ex1a.bam ex1b.bam ex1f.rg 24 | ../samtools merge -rh ex1f.rg $@ ex1.bam ex1a.bam ex1b.bam 25 | ex1f-rmduppe.bam:ex1f.bam 26 | ../samtools rmdup ex1f.bam $@ 27 | ex1f-rmdupse.bam:ex1f.bam 28 | ../samtools rmdup -S ex1f.bam $@ 29 | 30 | ex1.bcf:ex1.bam ex1.fa.fai 31 | ../samtools mpileup -gf ex1.fa ex1.bam > $@ 32 | 33 | ../bcftools/bcftools: 34 | (cd ../bcftools; make bcftools) 35 | 36 | ../samtools: 37 | (cd ..; make samtools) 38 | 39 | ../libbam.a: 40 | (cd ..; make libbam.a) 41 | 42 | calDepth:../libbam.a calDepth.c 43 | gcc -g -Wall -O2 -I.. calDepth.c -o $@ -L.. -lbam -lm -lz 44 | 45 | clean: 46 | rm -fr *.bam *.bai *.glf* *.fai *.pileup* *~ calDepth *.dSYM ex1*.rg ex1.bcf 47 | 48 | # ../samtools pileup ex1.bam|perl -ape '$_=$F[4];s/(\d+)(??{".{$1}"})|\^.//g;@_=(tr/A-Z//,tr/a-z//);$_=join("\t",@F[0,1],@_)."\n"' 49 | 50 | # ../samtools pileup -cf ex1.fa ex1.bam|perl -ape '$_=$F[8];s/\^.//g;s/(\d+)(??{".{$1}"})|\^.//g;@_=(tr/A-Za-z//,tr/,.//);$_=join("\t",@F[0,1],@_)."\n"' 51 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/infback9/inflate9.h: -------------------------------------------------------------------------------- 1 | /* inflate9.h -- internal inflate state definition 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Possible inflate modes between inflate() calls */ 12 | typedef enum { 13 | TYPE, /* i: waiting for type bits, including last-flag bit */ 14 | STORED, /* i: waiting for stored size (length and complement) */ 15 | TABLE, /* i: waiting for dynamic block table lengths */ 16 | LEN, /* i: waiting for length/lit code */ 17 | DONE, /* finished check, done -- remain here until reset */ 18 | BAD /* got a data error -- remain here until reset */ 19 | } inflate_mode; 20 | 21 | /* 22 | State transitions between above modes - 23 | 24 | (most modes can go to the BAD mode -- not shown for clarity) 25 | 26 | Read deflate blocks: 27 | TYPE -> STORED or TABLE or LEN or DONE 28 | STORED -> TYPE 29 | TABLE -> LENLENS -> CODELENS -> LEN 30 | Read deflate codes: 31 | LEN -> LEN or TYPE 32 | */ 33 | 34 | /* state maintained between inflate() calls. Approximately 7K bytes. */ 35 | struct inflate_state { 36 | /* sliding window */ 37 | unsigned char FAR *window; /* allocated sliding window, if needed */ 38 | /* dynamic table building */ 39 | unsigned ncode; /* number of code length code lengths */ 40 | unsigned nlen; /* number of length code lengths */ 41 | unsigned ndist; /* number of distance code lengths */ 42 | unsigned have; /* number of code lengths in lens[] */ 43 | code FAR *next; /* next available space in codes[] */ 44 | unsigned short lens[320]; /* temporary storage for code lengths */ 45 | unsigned short work[288]; /* work area for code table building */ 46 | code codes[ENOUGH]; /* space for code tables */ 47 | }; 48 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (z_const Bytef *)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/INDEX: -------------------------------------------------------------------------------- 1 | CMakeLists.txt cmake build file 2 | ChangeLog history of changes 3 | FAQ Frequently Asked Questions about zlib 4 | INDEX this file 5 | Makefile dummy Makefile that tells you to ./configure 6 | Makefile.in template for Unix Makefile 7 | README guess what 8 | configure configure script for Unix 9 | make_vms.com makefile for VMS 10 | test/example.c zlib usages examples for build testing 11 | test/minigzip.c minimal gzip-like functionality for build testing 12 | test/infcover.c inf*.c code coverage for build coverage testing 13 | treebuild.xml XML description of source file dependencies 14 | zconf.h.cmakein zconf.h template for cmake 15 | zconf.h.in zconf.h template for configure 16 | zlib.3 Man page for zlib 17 | zlib.3.pdf Man page in PDF format 18 | zlib.map Linux symbol information 19 | zlib.pc.in Template for pkg-config descriptor 20 | zlib.pc.cmakein zlib.pc template for cmake 21 | zlib2ansi perl script to convert source files for C++ compilation 22 | 23 | amiga/ makefiles for Amiga SAS C 24 | as400/ makefiles for AS/400 25 | doc/ documentation for formats and algorithms 26 | msdos/ makefiles for MSDOS 27 | nintendods/ makefile for Nintendo DS 28 | old/ makefiles for various architectures and zlib documentation 29 | files that have not yet been updated for zlib 1.2.x 30 | qnx/ makefiles for QNX 31 | watcom/ makefiles for OpenWatcom 32 | win32/ makefiles for Windows 33 | 34 | zlib public header files (required for library use): 35 | zconf.h 36 | zlib.h 37 | 38 | private source files used to build the zlib library: 39 | adler32.c 40 | compress.c 41 | crc32.c 42 | crc32.h 43 | deflate.c 44 | deflate.h 45 | gzclose.c 46 | gzguts.h 47 | gzlib.c 48 | gzread.c 49 | gzwrite.c 50 | infback.c 51 | inffast.c 52 | inffast.h 53 | inffixed.h 54 | inflate.c 55 | inflate.h 56 | inftrees.c 57 | inftrees.h 58 | trees.c 59 | trees.h 60 | uncompr.c 61 | zutil.c 62 | zutil.h 63 | 64 | source files for sample programs 65 | See examples/README.examples 66 | 67 | unsupported contributions by third parties 68 | See contrib/README.contrib 69 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/amiga/Makefile.pup: -------------------------------------------------------------------------------- 1 | # Amiga powerUP (TM) Makefile 2 | # makefile for libpng and SAS C V6.58/7.00 PPC compiler 3 | # Copyright (C) 1998 by Andreas R. Kleinert 4 | 5 | LIBNAME = libzip.a 6 | 7 | CC = scppc 8 | CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \ 9 | OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 NOVER 10 | AR = ppc-amigaos-ar cr 11 | RANLIB = ppc-amigaos-ranlib 12 | LD = ppc-amigaos-ld -r 13 | LDFLAGS = -o 14 | LDLIBS = LIB:scppc.a LIB:end.o 15 | RM = delete quiet 16 | 17 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 18 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 19 | 20 | TEST_OBJS = example.o minigzip.o 21 | 22 | all: example minigzip 23 | 24 | check: test 25 | test: all 26 | example 27 | echo hello world | minigzip | minigzip -d 28 | 29 | $(LIBNAME): $(OBJS) 30 | $(AR) $@ $(OBJS) 31 | -$(RANLIB) $@ 32 | 33 | example: example.o $(LIBNAME) 34 | $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS) 35 | 36 | minigzip: minigzip.o $(LIBNAME) 37 | $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS) 38 | 39 | mostlyclean: clean 40 | clean: 41 | $(RM) *.o example minigzip $(LIBNAME) foo.gz 42 | 43 | zip: 44 | zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \ 45 | descrip.mms *.[ch] 46 | 47 | tgz: 48 | cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \ 49 | zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch] 50 | 51 | # DO NOT DELETE THIS LINE -- make depend depends on it. 52 | 53 | adler32.o: zlib.h zconf.h 54 | compress.o: zlib.h zconf.h 55 | crc32.o: crc32.h zlib.h zconf.h 56 | deflate.o: deflate.h zutil.h zlib.h zconf.h 57 | example.o: zlib.h zconf.h 58 | gzclose.o: zlib.h zconf.h gzguts.h 59 | gzlib.o: zlib.h zconf.h gzguts.h 60 | gzread.o: zlib.h zconf.h gzguts.h 61 | gzwrite.o: zlib.h zconf.h gzguts.h 62 | inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 63 | inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 64 | infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 65 | inftrees.o: zutil.h zlib.h zconf.h inftrees.h 66 | minigzip.o: zlib.h zconf.h 67 | trees.o: deflate.h zutil.h zlib.h zconf.h trees.h 68 | uncompr.o: zlib.h zconf.h 69 | zutil.o: zutil.h zlib.h zconf.h 70 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/misc/psl2sam.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Author: lh3 4 | 5 | # This script calculates a score using the BLAST scoring 6 | # system. However, I am not sure how to count gap opens and gap 7 | # extensions. It seems to me that column 5-8 are not what I am 8 | # after. This script counts gaps from the last three columns. It does 9 | # not generate reference skip (N) in the CIGAR as it is not easy to 10 | # directly tell which gaps correspond to introns. 11 | 12 | use strict; 13 | use warnings; 14 | use Getopt::Std; 15 | 16 | my %opts = (a=>1, b=>3, q=>5, r=>2); 17 | getopts('a:b:q:r:', \%opts); 18 | die("Usage: psl2sam.pl [-a $opts{a}] [-b $opts{b}] [-q $opts{q}] [-r $opts{r}] \n") if (@ARGV == 0 && -t STDIN); 19 | 20 | my @stack; 21 | my $last = ''; 22 | my ($a, $b, $q, $r) = ($opts{a}, $opts{b}, $opts{q}, $opts{r}); 23 | while (<>) { 24 | next unless (/^\d/); 25 | my @t = split; 26 | my @s; 27 | my $cigar = ''; 28 | if ($t[8] eq '-') { 29 | my $tmp = $t[11]; 30 | $t[11] = $t[10] - $t[12]; 31 | $t[12] = $t[10] - $tmp; 32 | } 33 | @s[0..4] = ($t[9], (($t[8] eq '+')? 0 : 16), $t[13], $t[15]+1, 0); 34 | @s[6..10] = ('*', 0, 0, '*', '*'); 35 | $cigar .= $t[11].'H' if ($t[11]); # 5'-end clipping 36 | my @x = split(',', $t[18]); 37 | my @y = split(',', $t[19]); 38 | my @z = split(',', $t[20]); 39 | my ($y0, $z0) = ($y[0], $z[0]); 40 | my ($gap_open, $gap_ext) = (0, 0, 0); 41 | for (1 .. $t[17]-1) { 42 | my $ly = $y[$_] - $y[$_-1] - $x[$_-1]; 43 | my $lz = $z[$_] - $z[$_-1] - $x[$_-1]; 44 | if ($ly < $lz) { # del: the reference gap is longer 45 | ++$gap_open; 46 | $gap_ext += $lz - $ly; 47 | $cigar .= ($y[$_] - $y0) . 'M'; 48 | $cigar .= ($lz - $ly) . 'D'; 49 | ($y0, $z0) = ($y[$_], $z[$_]); 50 | } elsif ($lz < $ly) { # ins: the query gap is longer 51 | ++$gap_open; 52 | $gap_ext += $ly - $lz; 53 | $cigar .= ($z[$_] - $z0) . 'M'; 54 | $cigar .= ($ly - $lz) . 'I'; 55 | ($y0, $z0) = ($y[$_], $z[$_]); 56 | } 57 | } 58 | $cigar .= ($t[12] - $y0) . 'M'; 59 | $cigar .= ($t[10] - $t[12]).'H' if ($t[10] != $t[12]); # 3'-end clipping 60 | $s[5] = $cigar; 61 | my $score = $a * $t[0] - $b * $t[1] - $q * $gap_open - $r * $gap_ext; 62 | $score = 0 if ($score < 0); 63 | $s[11] = "AS:i:$score"; 64 | print join("\t", @s), "\n"; 65 | } 66 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/kaln.h: -------------------------------------------------------------------------------- 1 | /* The MIT License 2 | 3 | Copyright (c) 2003-2006, 2008, 2009 by Heng Li 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | 26 | #ifndef LH3_KALN_H_ 27 | #define LH3_KALN_H_ 28 | 29 | #include 30 | 31 | #define MINOR_INF -1073741823 32 | 33 | typedef struct { 34 | int gap_open; 35 | int gap_ext; 36 | int gap_end_open; 37 | int gap_end_ext; 38 | 39 | int *matrix; 40 | int row; 41 | int band_width; 42 | } ka_param_t; 43 | 44 | typedef struct { 45 | int iio, iie, ido, ide; 46 | int eio, eie, edo, ede; 47 | int *matrix; 48 | int row; 49 | int band_width; 50 | } ka_param2_t; 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | uint32_t *ka_global_core(uint8_t *seq1, int len1, uint8_t *seq2, int len2, const ka_param_t *ap, 57 | int *_score, int *n_cigar); 58 | int ka_global_score(const uint8_t *_seq1, int len1, const uint8_t *_seq2, int len2, const ka_param2_t *ap); 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | extern ka_param_t ka_param_blast; /* = { 5, 2, 5, 2, aln_sm_blast, 5, 50 }; */ 64 | extern ka_param_t ka_param_qual; // only use this for global alignment!!! 65 | extern ka_param2_t ka_param2_qual; // only use this for global alignment!!! 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/Makefile.mingw: -------------------------------------------------------------------------------- 1 | CC= gcc.exe 2 | AR= ar.exe 3 | CFLAGS= -g -Wall -O2 -fPIC 4 | DFLAGS= -D_USE_KNETFILE -D_CURSES_LIB=2 5 | KNETFILE_O= knetfile.o 6 | LOBJS= bgzf.o kstring.o bam_aux.o bam.o bam_import.o sam.o bam_index.o \ 7 | bam_pileup.o bam_lpileup.o bam_md.o razf.o faidx.o \ 8 | $(KNETFILE_O) bam_sort.o sam_header.o bam_reheader.o kprobaln.o bedidx.o 9 | AOBJS= bam_tview.o bam_plcmd.o sam_view.o \ 10 | bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o \ 11 | bamtk.o kaln.o bam2bcf.o bam2bcf_indel.o errmod.o sample.o \ 12 | cut_target.o phase.o bam_cat.o bam2depth.o 13 | BCFOBJS= bcftools/bcf.o bcftools/fet.o bcftools/bcf2qcall.o bcftools/bcfutils.o \ 14 | bcftools/call1.o bcftools/index.o bcftools/kfunc.o bcftools/em.o \ 15 | bcftools/kmin.o bcftools/prob1.o bcftools/vcf.o bcftools/mut.o 16 | PROG= samtools.exe bcftools.exe 17 | INCLUDES= -I. -Iwin32 18 | SUBDIRS= . 19 | LIBPATH= 20 | 21 | .SUFFIXES:.c .o 22 | 23 | .c.o: 24 | $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@ 25 | 26 | all:$(PROG) 27 | 28 | .PHONY:all lib clean cleanlocal 29 | .PHONY:all-recur lib-recur clean-recur cleanlocal-recur install-recur 30 | 31 | lib:libbam.a 32 | 33 | libbam.a:$(LOBJS) 34 | $(AR) -cru $@ $(LOBJS) 35 | 36 | samtools.exe:$(AOBJS) libbam.a $(BCFOBJS) 37 | $(CC) $(CFLAGS) -o $@ $(AOBJS) $(BCFOBJS) $(LIBPATH) -lm -L. -lbam -Lwin32 -lz -lcurses -lws2_32 38 | 39 | bcftools.exe:$(BCFOBJS) bcftools/main.o kstring.o bgzf.o knetfile.o bedidx.o 40 | $(CC) $(CFLAGS) -o $@ $(BCFOBJS) bcftools/main.o kstring.o bgzf.o knetfile.o bedidx.o -lm -Lwin32 -lz -lws2_32 41 | 42 | razip.o:razf.h 43 | bam.o:bam.h razf.h bam_endian.h kstring.h sam_header.h 44 | sam.o:sam.h bam.h 45 | bam_import.o:bam.h kseq.h khash.h razf.h 46 | bam_pileup.o:bam.h razf.h ksort.h 47 | bam_plcmd.o:bam.h faidx.h bcftools/bcf.h bam2bcf.h 48 | bam_index.o:bam.h khash.h ksort.h razf.h bam_endian.h 49 | bam_lpileup.o:bam.h ksort.h 50 | bam_tview.o:bam.h faidx.h 51 | bam_sort.o:bam.h ksort.h razf.h 52 | bam_md.o:bam.h faidx.h 53 | sam_header.o:sam_header.h khash.h 54 | bcf.o:bcftools/bcf.h 55 | bam2bcf.o:bam2bcf.h errmod.h bcftools/bcf.h 56 | bam2bcf_indel.o:bam2bcf.h 57 | errmod.o:errmod.h 58 | 59 | faidx.o:faidx.h razf.h khash.h 60 | faidx_main.o:faidx.h razf.h 61 | 62 | clean: 63 | rm -fr gmon.out *.o a.out *.exe *.dSYM razip bgzip $(PROG) *~ *.a *.so.* *.so *.dylib 64 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | rm -rf bin/; 4 | 5 | mkdir bin/; 6 | 7 | cd include 8 | echo 'building zlib' 9 | cd zlib-*/; 10 | make clean; 11 | ./configure --prefix=`pwd` 12 | make; 13 | cd ..; 14 | 15 | echo 'building samtools' 16 | cd samtools-*/; 17 | make clean; 18 | make; 19 | cd ..; 20 | cd ..; 21 | 22 | cd src/; 23 | echo 'building ATCGmapMerge' 24 | g++ ATCGmapMerge.cpp -o ../bin/ATCGmapMerge -lz -L ../include/zlib-1.2.8 25 | 26 | echo 'building CGmapSelectByRegion' 27 | g++ CGmapSelectByRegion.cpp -o ../bin/CGmapSelectByRegion 28 | 29 | echo 'building CGmapMethInBed' 30 | g++ CGmapMethInBed.cpp -o ../bin/CGmapMethInBed 31 | 32 | echo 'building CGmapMethInFragReg' 33 | g++ CGmapMethInFragReg.cpp -o ../bin/CGmapMethInFragReg 34 | 35 | echo 'building CGmapFromBAM' 36 | gcc -o ../bin/CGmapFromBAM CGmapFromBAM.c -lz -L ../include/zlib-1.2.8 -lbam -L ../include/samtools-0.1.18; 37 | 38 | echo 'building CGmapToCGbz' 39 | gcc -o ../bin/CGmapToCGbz CGmapToCGbz.c -L ../include/zlib-1.2.8 -lbam -L ../include/samtools-0.1.18 -lz 40 | 41 | echo 'building CGbzToCGmap' 42 | gcc -o ../bin/CGbzToCGmap CGbzToCGmap.c -L ../include/zlib-1.2.8 -lbam -L ../include/samtools-0.1.18 -lz 43 | 44 | echo 'building ATCGmapToATCGbz' 45 | gcc -o ../bin/ATCGmapToATCGbz ATCGmapToATCGbz.c -L ../include/zlib-1.2.8 -lbam -L ../include/samtools-0.1.18 -lz 46 | 47 | echo 'building ATCGbzToATCGmap' 48 | gcc -o ../bin/ATCGbzToATCGmap ATCGbzToATCGmap.c -L ../include/zlib-1.2.8 -lbam -L ../include/samtools-0.1.18 -lz 49 | 50 | echo 'building CGbzFetchRegion' 51 | gcc -o ../bin/CGbzFetchRegion CGbzFetchRegion.c -L ../include/zlib-1.2.8 -lbam -L ../include/samtools-0.1.18 -lz 52 | 53 | echo 'building ATCGbzFetchRegion' 54 | gcc -o ../bin/ATCGbzFetchRegion ATCGbzFetchRegion.c -L ../include/zlib-1.2.8 -lbam -L ../include/samtools-0.1.18 -lz 55 | cd .. 56 | 57 | cd bin 58 | for pr in ../src/*.py ../src/*.pl ../src/*.R; do 59 | pn=`basename $pr | cut -d"." -f1` 60 | echo 'building '`basename $pn` 61 | ln -s $pr $pn 62 | chmod +x $pn 63 | done 64 | cd .. 65 | 66 | echo "" 67 | echo "Installation is finished." 68 | echo "" 69 | echo "Please add the following line to your ~/.bash_profile, and source ~/.bash_profile before running cgmaptools." 70 | echo "" 71 | echo ' export PATH='`pwd`':$PATH' 72 | echo "" -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/vstudio/vc10/testzlib.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {c1f6a2e3-5da5-4955-8653-310d3efe05a9} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {c2aaffdc-2c95-4d6f-8466-4bec5890af2c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {c274fe07-05f2-461c-964b-f6341e4e7eb5} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/ada/readme.txt: -------------------------------------------------------------------------------- 1 | ZLib for Ada thick binding (ZLib.Ada) 2 | Release 1.3 3 | 4 | ZLib.Ada is a thick binding interface to the popular ZLib data 5 | compression library, available at http://www.gzip.org/zlib/. 6 | It provides Ada-style access to the ZLib C library. 7 | 8 | 9 | Here are the main changes since ZLib.Ada 1.2: 10 | 11 | - Attension: ZLib.Read generic routine have a initialization requirement 12 | for Read_Last parameter now. It is a bit incompartible with previous version, 13 | but extends functionality, we could use new parameters Allow_Read_Some and 14 | Flush now. 15 | 16 | - Added Is_Open routines to ZLib and ZLib.Streams packages. 17 | 18 | - Add pragma Assert to check Stream_Element is 8 bit. 19 | 20 | - Fix extraction to buffer with exact known decompressed size. Error reported by 21 | Steve Sangwine. 22 | 23 | - Fix definition of ULong (changed to unsigned_long), fix regression on 64 bits 24 | computers. Patch provided by Pascal Obry. 25 | 26 | - Add Status_Error exception definition. 27 | 28 | - Add pragma Assertion that Ada.Streams.Stream_Element size is 8 bit. 29 | 30 | 31 | How to build ZLib.Ada under GNAT 32 | 33 | You should have the ZLib library already build on your computer, before 34 | building ZLib.Ada. Make the directory of ZLib.Ada sources current and 35 | issue the command: 36 | 37 | gnatmake test -largs -L -lz 38 | 39 | Or use the GNAT project file build for GNAT 3.15 or later: 40 | 41 | gnatmake -Pzlib.gpr -L 42 | 43 | 44 | How to build ZLib.Ada under Aonix ObjectAda for Win32 7.2.2 45 | 46 | 1. Make a project with all *.ads and *.adb files from the distribution. 47 | 2. Build the libz.a library from the ZLib C sources. 48 | 3. Rename libz.a to z.lib. 49 | 4. Add the library z.lib to the project. 50 | 5. Add the libc.lib library from the ObjectAda distribution to the project. 51 | 6. Build the executable using test.adb as a main procedure. 52 | 53 | 54 | How to use ZLib.Ada 55 | 56 | The source files test.adb and read.adb are small demo programs that show 57 | the main functionality of ZLib.Ada. 58 | 59 | The routines from the package specifications are commented. 60 | 61 | 62 | Homepage: http://zlib-ada.sourceforge.net/ 63 | Author: Dmitriy Anisimkov 64 | 65 | Contributors: Pascal Obry , Steve Sangwine 66 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/misc/bowtie2sam.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Contact: lh3 4 | # Version: 0.1.1 5 | 6 | use strict; 7 | use warnings; 8 | use Getopt::Std; 9 | 10 | &bowtie2sam; 11 | exit; 12 | 13 | sub bowtie2sam { 14 | my %opts = (); 15 | die("Usage: bowtie2sam.pl \n") if (@ARGV == 0 && -t STDIN); 16 | # core loop 17 | my (@s, $last, @staging, $k, $best_s, $subbest_s, $best_k); 18 | $last = ''; 19 | while (<>) { 20 | my ($name, $nm) = &bowtie2sam_aux($_, \@s); # read_name, number of mismatches 21 | if ($name eq $last) { 22 | # I do not know whether the multiple hits are ordered on the 23 | # number of mismatches. I assume they are not and so I have to 24 | # keep all these multiple hits in memory. 25 | @{$staging[$k]} = @s; 26 | if ($best_s > $nm) { 27 | $subbest_s = $best_s; 28 | $best_s = $nm; 29 | $best_k = $k; 30 | } elsif ($subbest_s > $nm) { 31 | $subbest_s = $nm; 32 | } 33 | ++$k; 34 | } else { 35 | if ($last) { 36 | if ($best_s == $subbest_s) { 37 | $staging[$best_k][4] = 0; 38 | } elsif ($subbest_s - $best_s == 1) { 39 | $staging[$best_k][4] = 15 if ($staging[$best_k][4] > 15); 40 | } 41 | print join("\t", @{$staging[$best_k]}), "\n"; 42 | } 43 | $k = 1; $best_s = $nm; $subbest_s = 1000; $best_k = 0; 44 | @{$staging[0]} = @s; 45 | $last = $name; 46 | } 47 | } 48 | print join("\t", @{$staging[$best_k]}), "\n" if ($best_k >= 0); 49 | } 50 | 51 | sub bowtie2sam_aux { 52 | my ($line, $s) = @_; 53 | chomp($line); 54 | my @t = split("\t", $line); 55 | my $ret; 56 | @$s = (); 57 | # read name 58 | $s->[0] = $ret = $t[0]; 59 | $s->[0] =~ s/\/[12]$//g; 60 | # initial flag (will be updated later) 61 | $s->[1] = 0; 62 | # read & quality 63 | $s->[9] = $t[4]; $s->[10] = $t[5]; 64 | # cigar 65 | $s->[5] = length($s->[9]) . "M"; 66 | # coor 67 | $s->[2] = $t[2]; $s->[3] = $t[3] + 1; 68 | $s->[1] |= 0x10 if ($t[1] eq '-'); 69 | # mapQ 70 | $s->[4] = $t[6] == 0? 25 : 0; 71 | # mate coordinate 72 | $s->[6] = '*'; $s->[7] = $s->[8] = 0; 73 | # aux 74 | my $nm = @t - 7; 75 | push(@$s, "NM:i:" . (@t-7)); 76 | push(@$s, "X$nm:i:" . ($t[6]+1)); 77 | my $md = ''; 78 | if ($t[7]) { 79 | $_ = $t[7]; 80 | my $a = 0; 81 | while (/(\d+):[ACGTN]>([ACGTN])/gi) { 82 | my ($y, $z) = ($1, $2); 83 | $md .= (int($y)-$a) . $z; 84 | $a += $y - $a + 1; 85 | } 86 | $md .= length($s->[9]) - $a; 87 | } else { 88 | $md = length($s->[9]); 89 | } 90 | push(@$s, "MD:Z:$md"); 91 | return ($ret, $nm); 92 | } 93 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains a .Net wrapper class library for the ZLib1.dll 2 | 3 | The wrapper includes support for inflating/deflating memory buffers, 4 | .Net streaming wrappers for the gz streams part of zlib, and wrappers 5 | for the checksum parts of zlib. See DotZLib/UnitTests.cs for examples. 6 | 7 | Directory structure: 8 | -------------------- 9 | 10 | LICENSE_1_0.txt - License file. 11 | readme.txt - This file. 12 | DotZLib.chm - Class library documentation 13 | DotZLib.build - NAnt build file 14 | DotZLib.sln - Microsoft Visual Studio 2003 solution file 15 | 16 | DotZLib\*.cs - Source files for the class library 17 | 18 | Unit tests: 19 | ----------- 20 | The file DotZLib/UnitTests.cs contains unit tests for use with NUnit 2.1 or higher. 21 | To include unit tests in the build, define nunit before building. 22 | 23 | 24 | Build instructions: 25 | ------------------- 26 | 27 | 1. Using Visual Studio.Net 2003: 28 | Open DotZLib.sln in VS.Net and build from there. Output file (DotZLib.dll) 29 | will be found ./DotZLib/bin/release or ./DotZLib/bin/debug, depending on 30 | you are building the release or debug version of the library. Check 31 | DotZLib/UnitTests.cs for instructions on how to include unit tests in the 32 | build. 33 | 34 | 2. Using NAnt: 35 | Open a command prompt with access to the build environment and run nant 36 | in the same directory as the DotZLib.build file. 37 | You can define 2 properties on the nant command-line to control the build: 38 | debug={true|false} to toggle between release/debug builds (default=true). 39 | nunit={true|false} to include or esclude unit tests (default=true). 40 | Also the target clean will remove binaries. 41 | Output file (DotZLib.dll) will be found in either ./DotZLib/bin/release 42 | or ./DotZLib/bin/debug, depending on whether you are building the release 43 | or debug version of the library. 44 | 45 | Examples: 46 | nant -D:debug=false -D:nunit=false 47 | will build a release mode version of the library without unit tests. 48 | nant 49 | will build a debug version of the library with unit tests 50 | nant clean 51 | will remove all previously built files. 52 | 53 | 54 | --------------------------------- 55 | Copyright (c) Henrik Ravn 2004 56 | 57 | Use, modification and distribution are subject to the Boost Software License, Version 1.0. 58 | (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 59 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/dotzlib/DotZLib/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | // 9 | [assembly: AssemblyTitle("DotZLib")] 10 | [assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("Henrik Ravn")] 13 | [assembly: AssemblyProduct("")] 14 | [assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Revision and Build Numbers 27 | // by using the '*' as shown below: 28 | 29 | [assembly: AssemblyVersion("1.0.*")] 30 | 31 | // 32 | // In order to sign your assembly you must specify a key to use. Refer to the 33 | // Microsoft .NET Framework documentation for more information on assembly signing. 34 | // 35 | // Use the attributes below to control which key is used for signing. 36 | // 37 | // Notes: 38 | // (*) If no key is specified, the assembly is not signed. 39 | // (*) KeyName refers to a key that has been installed in the Crypto Service 40 | // Provider (CSP) on your machine. KeyFile refers to a file which contains 41 | // a key. 42 | // (*) If the KeyFile and the KeyName values are both specified, the 43 | // following processing occurs: 44 | // (1) If the KeyName can be found in the CSP, that key is used. 45 | // (2) If the KeyName does not exist and the KeyFile does exist, the key 46 | // in the KeyFile is installed into the CSP and used. 47 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. 48 | // When specifying the KeyFile, the location of the KeyFile should be 49 | // relative to the project output directory which is 50 | // %Project Directory%\obj\. For example, if your KeyFile is 51 | // located in the project directory, you would specify the AssemblyKeyFile 52 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] 53 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework 54 | // documentation for more information on this. 55 | // 56 | [assembly: AssemblyDelaySign(false)] 57 | [assembly: AssemblyKeyFile("")] 58 | [assembly: AssemblyKeyName("")] 59 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/vstudio/readme.txt: -------------------------------------------------------------------------------- 1 | Building instructions for the DLL versions of Zlib 1.2.8 2 | ======================================================== 3 | 4 | This directory contains projects that build zlib and minizip using 5 | Microsoft Visual C++ 9.0/10.0. 6 | 7 | You don't need to build these projects yourself. You can download the 8 | binaries from: 9 | http://www.winimage.com/zLibDll 10 | 11 | More information can be found at this site. 12 | 13 | 14 | 15 | 16 | 17 | Build instructions for Visual Studio 2008 (32 bits or 64 bits) 18 | -------------------------------------------------------------- 19 | - Uncompress current zlib, including all contrib/* files 20 | - Compile assembly code (with Visual Studio Command Prompt) by running: 21 | bld_ml64.bat (in contrib\masmx64) 22 | bld_ml32.bat (in contrib\masmx86) 23 | - Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008 24 | - Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32" 25 | 26 | Build instructions for Visual Studio 2010 (32 bits or 64 bits) 27 | -------------------------------------------------------------- 28 | - Uncompress current zlib, including all contrib/* files 29 | - Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010 30 | 31 | Build instructions for Visual Studio 2012 (32 bits or 64 bits) 32 | -------------------------------------------------------------- 33 | - Uncompress current zlib, including all contrib/* files 34 | - Open contrib\vstudio\vc11\zlibvc.sln with Microsoft Visual C++ 2012 35 | 36 | 37 | Important 38 | --------- 39 | - To use zlibwapi.dll in your application, you must define the 40 | macro ZLIB_WINAPI when compiling your application's source files. 41 | 42 | 43 | Additional notes 44 | ---------------- 45 | - This DLL, named zlibwapi.dll, is compatible to the old zlib.dll built 46 | by Gilles Vollant from the zlib 1.1.x sources, and distributed at 47 | http://www.winimage.com/zLibDll 48 | It uses the WINAPI calling convention for the exported functions, and 49 | includes the minizip functionality. If your application needs that 50 | particular build of zlib.dll, you can rename zlibwapi.dll to zlib.dll. 51 | 52 | - The new DLL was renamed because there exist several incompatible 53 | versions of zlib.dll on the Internet. 54 | 55 | - There is also an official DLL build of zlib, named zlib1.dll. This one 56 | is exporting the functions using the CDECL convention. See the file 57 | win32\DLL_FAQ.txt found in this zlib distribution. 58 | 59 | - There used to be a ZLIB_DLL macro in zlib 1.1.x, but now this symbol 60 | has a slightly different effect. To avoid compatibility problems, do 61 | not define it here. 62 | 63 | 64 | Gilles Vollant 65 | info@winimage.com 66 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/misc/blast2sam.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | use warnings; 5 | use Getopt::Std; 6 | 7 | &blast2sam; 8 | 9 | sub blast2sam { 10 | my %opts = (); 11 | getopts('s', \%opts); 12 | die("Usage: blast2sam.pl \n") if (-t STDIN && @ARGV == 0); 13 | my ($qlen, $slen, $q, $s, $qbeg, $qend, @sam, @cigar, @cmaux, $show_seq); 14 | $show_seq = defined($opts{s}); 15 | @sam = (); @sam[0,4,6..8,10] = ('', 255, '*', 0, 0, '*'); 16 | while (<>) { 17 | if (@cigar && (/^Query=/ || /Score =.*bits.*Expect/)) { # print 18 | &blast_print_sam(\@sam, \@cigar, \@cmaux, $qlen - $qend); 19 | @cigar = (); 20 | } 21 | if (/^Query= (\S+)/) { 22 | $sam[0] = $1; 23 | } elsif (/\((\S+)\s+letters\)/) { 24 | $qlen = $1; $qlen =~ s/,//g; 25 | } elsif (/^>(\S+)/) { 26 | $sam[2] = $1; 27 | } elsif (/Length = (\d+)/) { 28 | $slen = $1; 29 | } elsif (/Score =\s+(\S+) bits.+Expect(\(\d+\))? = (\S+)/) { # the start of an alignment block 30 | my ($as, $ev) = (int($1 + .499), $3); 31 | $ev = "1$ev" if ($ev =~ /^e/); 32 | @sam[1,3,9,11,12] = (0, 0, '', "AS:i:$as", "EV:Z:$ev"); 33 | @cigar = (); $qbeg = 0; 34 | @cmaux = (0, 0, 0, ''); 35 | } elsif (/Strand = (\S+) \/ (\S+)/) { 36 | $sam[1] |= 0x10 if ($2 eq 'Minus'); 37 | } elsif (/Query\:\s(\d+)\s*(\S+)\s(\d+)/) { 38 | $q = $2; 39 | unless ($qbeg) { 40 | $qbeg = $1; 41 | push(@cigar, ($1-1) . "H") if ($1 > 1); 42 | } 43 | $qend = $3; 44 | if ($show_seq) { 45 | my $x = $q; 46 | $x =~ s/-//g; $sam[9] .= $x; 47 | } 48 | } elsif (/Sbjct\:\s(\d+)\s*(\S+)\s(\d+)/) { 49 | $s = $2; 50 | if ($sam[1] & 0x10) { 51 | $sam[3] = $3; 52 | } else { 53 | $sam[3] = $1 unless ($sam[3]); 54 | } 55 | &aln2cm(\@cigar, \$q, \$s, \@cmaux); 56 | } 57 | } 58 | &blast_print_sam(\@sam, \@cigar, \@cmaux, $qlen - $qend); 59 | } 60 | 61 | sub blast_print_sam { 62 | my ($sam, $cigar, $cmaux, $qrest) = @_; 63 | push(@$cigar, $cmaux->[1] . substr("MDI", $cmaux->[0], 1)); 64 | push(@$cigar, $qrest . 'H') if ($qrest); 65 | if ($sam->[1] & 0x10) { 66 | @$cigar = reverse(@$cigar); 67 | $sam->[9] = reverse($sam->[9]); 68 | $sam->[9] =~ tr/atgcrymkswATGCRYMKSW/tacgyrkmswTACGYRKMSW/; 69 | } 70 | $sam->[9] = '*' if (!$sam->[9]); 71 | $sam->[5] = join('', @$cigar); 72 | print join("\t", @$sam), "\n"; 73 | } 74 | 75 | sub aln2cm { 76 | my ($cigar, $q, $s, $cmaux) = @_; 77 | my $l = length($$q); 78 | for (my $i = 0; $i < $l; ++$i) { 79 | my $op; 80 | # set $op 81 | if (substr($$q, $i, 1) eq '-') { $op = 2; } 82 | elsif (substr($$s, $i, 1) eq '-') { $op = 1; } 83 | else { $op = 0; } 84 | # for CIGAR 85 | if ($cmaux->[0] == $op) { 86 | ++$cmaux->[1]; 87 | } else { 88 | push(@$cigar, $cmaux->[1] . substr("MDI", $cmaux->[0], 1)); 89 | $cmaux->[0] = $op; $cmaux->[1] = 1; 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/misc/zoom2sam.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Contact: lh3 4 | # Version: 0.1.0 5 | 6 | use strict; 7 | use warnings; 8 | use Getopt::Std; 9 | 10 | &zoom2sam; 11 | exit; 12 | 13 | sub mating { 14 | my ($s1, $s2) = @_; 15 | my $isize = 0; 16 | if ($s1->[2] ne '*' && $s1->[2] eq $s2->[2]) { # then calculate $isize 17 | my $x1 = ($s1->[1] & 0x10)? $s1->[3] + length($s1->[9]) : $s1->[3]; 18 | my $x2 = ($s2->[1] & 0x10)? $s2->[3] + length($s2->[9]) : $s2->[3]; 19 | $isize = $x2 - $x1; 20 | } 21 | # update mate coordinate 22 | if ($s2->[2] ne '*') { 23 | @$s1[6..8] = (($s2->[2] eq $s1->[2])? "=" : $s2->[2], $s2->[3], $isize); 24 | $s1->[1] |= 0x20 if ($s2->[1] & 0x10); 25 | } else { 26 | $s1->[1] |= 0x8; 27 | } 28 | if ($s1->[2] ne '*') { 29 | @$s2[6..8] = (($s1->[2] eq $s2->[2])? "=" : $s1->[2], $s1->[3], -$isize); 30 | $s2->[1] |= 0x20 if ($s1->[1] & 0x10); 31 | } else { 32 | $s2->[1] |= 0x8; 33 | } 34 | } 35 | 36 | sub zoom2sam { 37 | my %opts = (); 38 | getopts("p", \%opts); 39 | die("Usage: zoom2sam.pl [-p] 40 | Warnings: This script only supports the default Illumina outputs.\n") if (@ARGV < 2); 41 | my $is_paired = defined($opts{p}); 42 | my $len = shift(@ARGV); 43 | # core loop 44 | my @s1 = (); 45 | my @s2 = (); 46 | my ($s_last, $s_curr) = (\@s1, \@s2); 47 | while (<>) { 48 | &zoom2sam_aux($_, $s_curr, $is_paired, $len); 49 | if (@$s_last != 0 && $s_last->[0] eq $s_curr->[0]) { 50 | &mating($s_last, $s_curr); 51 | print join("\t", @$s_last), "\n"; 52 | print join("\t", @$s_curr), "\n"; 53 | @$s_last = (); @$s_curr = (); 54 | } else { 55 | print join("\t", @$s_last), "\n" if (@$s_last != 0); 56 | my $s = $s_last; $s_last = $s_curr; $s_curr = $s; 57 | } 58 | } 59 | print join("\t", @$s_last), "\n" if (@$s_last != 0); 60 | } 61 | 62 | sub zoom2sam_aux { 63 | my ($line, $s, $is_paired, $len) = @_; 64 | chomp($line); 65 | my @t = split("\t", $line); 66 | @$s = (); 67 | # read name 68 | $s->[0] = $t[0]; 69 | # initial flag (will be updated later) 70 | $s->[1] = 0; 71 | $s->[1] |= 1 | 1<<6 if ($s->[0] =~ /_F$/); 72 | $s->[1] |= 1 | 1<<7 if ($s->[0] =~ /_R$/); 73 | $s->[1] |= 2 if ($is_paired); 74 | # read & quality 75 | $s->[9] = "*"; $s->[10] = "*"; 76 | # cigar 77 | $s->[5] = $len . "M"; 78 | # coor 79 | my @s = split(/\s+/, $t[1]); 80 | $s->[2] = $s[0]; 81 | $t[1] =~ /:(\d+)$/; 82 | $s->[3] = $1 + 1; 83 | if ($s->[0] =~ /_[FR]$/) { 84 | my $u = ($s->[0] =~ /_F$/)? 1 : 0; 85 | my $w = ($t[2] eq '+')? 1 : 0; 86 | $s->[1] |= 0x10 if ($u ^ $w); 87 | $s->[0] =~ s/_[FR]$//; 88 | } else { 89 | $s->[1] |= 0x10 if ($t[2] eq '-'); 90 | } 91 | # mapQ 92 | $s->[4] = 30; 93 | # mate coordinate 94 | $s->[6] = '*'; $s->[7] = $s->[8] = 0; 95 | # aux 96 | push(@$s, "NM:i:$t[3]"); 97 | } 98 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/bam_mate.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "bam.h" 4 | 5 | // currently, this function ONLY works if each read has one hit 6 | void bam_mating_core(bamFile in, bamFile out) 7 | { 8 | bam_header_t *header; 9 | bam1_t *b[2]; 10 | int curr, has_prev; 11 | 12 | header = bam_header_read(in); 13 | bam_header_write(out, header); 14 | 15 | b[0] = bam_init1(); 16 | b[1] = bam_init1(); 17 | curr = 0; has_prev = 0; 18 | while (bam_read1(in, b[curr]) >= 0) { 19 | bam1_t *cur = b[curr], *pre = b[1-curr]; 20 | if (has_prev) { 21 | if (strcmp(bam1_qname(cur), bam1_qname(pre)) == 0) { // identical pair name 22 | cur->core.mtid = pre->core.tid; cur->core.mpos = pre->core.pos; 23 | pre->core.mtid = cur->core.tid; pre->core.mpos = cur->core.pos; 24 | if (pre->core.tid == cur->core.tid && !(cur->core.flag&(BAM_FUNMAP|BAM_FMUNMAP)) 25 | && !(pre->core.flag&(BAM_FUNMAP|BAM_FMUNMAP))) 26 | { 27 | uint32_t cur5, pre5; 28 | cur5 = (cur->core.flag&BAM_FREVERSE)? bam_calend(&cur->core, bam1_cigar(cur)) : cur->core.pos; 29 | pre5 = (pre->core.flag&BAM_FREVERSE)? bam_calend(&pre->core, bam1_cigar(pre)) : pre->core.pos; 30 | cur->core.isize = pre5 - cur5; pre->core.isize = cur5 - pre5; 31 | } else cur->core.isize = pre->core.isize = 0; 32 | if (pre->core.flag&BAM_FREVERSE) cur->core.flag |= BAM_FMREVERSE; 33 | else cur->core.flag &= ~BAM_FMREVERSE; 34 | if (cur->core.flag&BAM_FREVERSE) pre->core.flag |= BAM_FMREVERSE; 35 | else pre->core.flag &= ~BAM_FMREVERSE; 36 | if (cur->core.flag & BAM_FUNMAP) { pre->core.flag |= BAM_FMUNMAP; pre->core.flag &= ~BAM_FPROPER_PAIR; } 37 | if (pre->core.flag & BAM_FUNMAP) { cur->core.flag |= BAM_FMUNMAP; cur->core.flag &= ~BAM_FPROPER_PAIR; } 38 | bam_write1(out, pre); 39 | bam_write1(out, cur); 40 | has_prev = 0; 41 | } else { // unpaired or singleton 42 | pre->core.mtid = -1; pre->core.mpos = -1; pre->core.isize = 0; 43 | if (pre->core.flag & BAM_FPAIRED) { 44 | pre->core.flag |= BAM_FMUNMAP; 45 | pre->core.flag &= ~BAM_FMREVERSE & ~BAM_FPROPER_PAIR; 46 | } 47 | bam_write1(out, pre); 48 | } 49 | } else has_prev = 1; 50 | curr = 1 - curr; 51 | } 52 | if (has_prev) bam_write1(out, b[1-curr]); 53 | bam_header_destroy(header); 54 | bam_destroy1(b[0]); 55 | bam_destroy1(b[1]); 56 | } 57 | 58 | int bam_mating(int argc, char *argv[]) 59 | { 60 | bamFile in, out; 61 | if (argc < 3) { 62 | fprintf(stderr, "samtools fixmate \n"); 63 | return 1; 64 | } 65 | in = (strcmp(argv[1], "-") == 0)? bam_dopen(fileno(stdin), "r") : bam_open(argv[1], "r"); 66 | out = (strcmp(argv[2], "-") == 0)? bam_dopen(fileno(stdout), "w") : bam_open(argv[2], "w"); 67 | bam_mating_core(in, out); 68 | bam_close(in); bam_close(out); 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/delphi/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Overview 3 | ======== 4 | 5 | This directory contains an update to the ZLib interface unit, 6 | distributed by Borland as a Delphi supplemental component. 7 | 8 | The original ZLib unit is Copyright (c) 1997,99 Borland Corp., 9 | and is based on zlib version 1.0.4. There are a series of bugs 10 | and security problems associated with that old zlib version, and 11 | we recommend the users to update their ZLib unit. 12 | 13 | 14 | Summary of modifications 15 | ======================== 16 | 17 | - Improved makefile, adapted to zlib version 1.2.1. 18 | 19 | - Some field types from TZStreamRec are changed from Integer to 20 | Longint, for consistency with the zlib.h header, and for 64-bit 21 | readiness. 22 | 23 | - The zlib_version constant is updated. 24 | 25 | - The new Z_RLE strategy has its corresponding symbolic constant. 26 | 27 | - The allocation and deallocation functions and function types 28 | (TAlloc, TFree, zlibAllocMem and zlibFreeMem) are now cdecl, 29 | and _malloc and _free are added as C RTL stubs. As a result, 30 | the original C sources of zlib can be compiled out of the box, 31 | and linked to the ZLib unit. 32 | 33 | 34 | Suggestions for improvements 35 | ============================ 36 | 37 | Currently, the ZLib unit provides only a limited wrapper around 38 | the zlib library, and much of the original zlib functionality is 39 | missing. Handling compressed file formats like ZIP/GZIP or PNG 40 | cannot be implemented without having this functionality. 41 | Applications that handle these formats are either using their own, 42 | duplicated code, or not using the ZLib unit at all. 43 | 44 | Here are a few suggestions: 45 | 46 | - Checksum class wrappers around adler32() and crc32(), similar 47 | to the Java classes that implement the java.util.zip.Checksum 48 | interface. 49 | 50 | - The ability to read and write raw deflate streams, without the 51 | zlib stream header and trailer. Raw deflate streams are used 52 | in the ZIP file format. 53 | 54 | - The ability to read and write gzip streams, used in the GZIP 55 | file format, and normally produced by the gzip program. 56 | 57 | - The ability to select a different compression strategy, useful 58 | to PNG and MNG image compression, and to multimedia compression 59 | in general. Besides the compression level 60 | 61 | TCompressionLevel = (clNone, clFastest, clDefault, clMax); 62 | 63 | which, in fact, could have used the 'z' prefix and avoided 64 | TColor-like symbols 65 | 66 | TCompressionLevel = (zcNone, zcFastest, zcDefault, zcMax); 67 | 68 | there could be a compression strategy 69 | 70 | TCompressionStrategy = (zsDefault, zsFiltered, zsHuffmanOnly, zsRle); 71 | 72 | - ZIP and GZIP stream handling via TStreams. 73 | 74 | 75 | -- 76 | Cosmin Truta 77 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/vstudio/vc10/zlibstat.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {174213f6-7f66-4ae8-a3a8-a1e0a1e6ffdd} 6 | 7 | 8 | 9 | 10 | Source Files 11 | 12 | 13 | Source Files 14 | 15 | 16 | Source Files 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | 68 | 69 | Source Files 70 | 71 | 72 | 73 | 74 | Source Files 75 | 76 | 77 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | 32 | stream.next_in = (z_const Bytef *)source; 33 | stream.avail_in = (uInt)sourceLen; 34 | #ifdef MAXSEG_64K 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | #endif 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | stream.opaque = (voidpf)0; 45 | 46 | err = deflateInit(&stream, level); 47 | if (err != Z_OK) return err; 48 | 49 | err = deflate(&stream, Z_FINISH); 50 | if (err != Z_STREAM_END) { 51 | deflateEnd(&stream); 52 | return err == Z_OK ? Z_BUF_ERROR : err; 53 | } 54 | *destLen = stream.total_out; 55 | 56 | err = deflateEnd(&stream); 57 | return err; 58 | } 59 | 60 | /* =========================================================================== 61 | */ 62 | int ZEXPORT compress (dest, destLen, source, sourceLen) 63 | Bytef *dest; 64 | uLongf *destLen; 65 | const Bytef *source; 66 | uLong sourceLen; 67 | { 68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 69 | } 70 | 71 | /* =========================================================================== 72 | If the default memLevel or windowBits for deflateInit() is changed, then 73 | this function needs to be updated. 74 | */ 75 | uLong ZEXPORT compressBound (sourceLen) 76 | uLong sourceLen; 77 | { 78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 79 | (sourceLen >> 25) + 13; 80 | } 81 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/delphi/zlibd32.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # For use with Delphi and C++ Builder under Win32 3 | # Updated for zlib 1.2.x by Cosmin Truta 4 | 5 | # ------------ Borland C++ ------------ 6 | 7 | # This project uses the Delphi (fastcall/register) calling convention: 8 | LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl 9 | 10 | CC = bcc32 11 | LD = bcc32 12 | AR = tlib 13 | # do not use "-pr" in CFLAGS 14 | CFLAGS = -a -d -k- -O2 $(LOC) 15 | LDFLAGS = 16 | 17 | 18 | # variables 19 | ZLIB_LIB = zlib.lib 20 | 21 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 22 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 23 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 24 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 25 | 26 | 27 | # targets 28 | all: $(ZLIB_LIB) example.exe minigzip.exe 29 | 30 | .c.obj: 31 | $(CC) -c $(CFLAGS) $*.c 32 | 33 | adler32.obj: adler32.c zlib.h zconf.h 34 | 35 | compress.obj: compress.c zlib.h zconf.h 36 | 37 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 38 | 39 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 40 | 41 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 42 | 43 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 44 | 45 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 46 | 47 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 48 | 49 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 50 | inffast.h inffixed.h 51 | 52 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 53 | inffast.h 54 | 55 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 56 | inffast.h inffixed.h 57 | 58 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 59 | 60 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 61 | 62 | uncompr.obj: uncompr.c zlib.h zconf.h 63 | 64 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 65 | 66 | example.obj: test/example.c zlib.h zconf.h 67 | 68 | minigzip.obj: test/minigzip.c zlib.h zconf.h 69 | 70 | 71 | # For the sake of the old Borland make, 72 | # the command line is cut to fit in the MS-DOS 128 byte limit: 73 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 74 | -del $(ZLIB_LIB) 75 | $(AR) $(ZLIB_LIB) $(OBJP1) 76 | $(AR) $(ZLIB_LIB) $(OBJP2) 77 | 78 | 79 | # testing 80 | test: example.exe minigzip.exe 81 | example 82 | echo hello world | minigzip | minigzip -d 83 | 84 | example.exe: example.obj $(ZLIB_LIB) 85 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 86 | 87 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 88 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 89 | 90 | 91 | # cleanup 92 | clean: 93 | -del *.obj 94 | -del *.exe 95 | -del *.lib 96 | -del *.tds 97 | -del zlib.bak 98 | -del foo.gz 99 | 100 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/pascal/zlibd32.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # For use with Delphi and C++ Builder under Win32 3 | # Updated for zlib 1.2.x by Cosmin Truta 4 | 5 | # ------------ Borland C++ ------------ 6 | 7 | # This project uses the Delphi (fastcall/register) calling convention: 8 | LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl 9 | 10 | CC = bcc32 11 | LD = bcc32 12 | AR = tlib 13 | # do not use "-pr" in CFLAGS 14 | CFLAGS = -a -d -k- -O2 $(LOC) 15 | LDFLAGS = 16 | 17 | 18 | # variables 19 | ZLIB_LIB = zlib.lib 20 | 21 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 22 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 23 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 24 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 25 | 26 | 27 | # targets 28 | all: $(ZLIB_LIB) example.exe minigzip.exe 29 | 30 | .c.obj: 31 | $(CC) -c $(CFLAGS) $*.c 32 | 33 | adler32.obj: adler32.c zlib.h zconf.h 34 | 35 | compress.obj: compress.c zlib.h zconf.h 36 | 37 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 38 | 39 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 40 | 41 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 42 | 43 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 44 | 45 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 46 | 47 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 48 | 49 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 50 | inffast.h inffixed.h 51 | 52 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 53 | inffast.h 54 | 55 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 56 | inffast.h inffixed.h 57 | 58 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 59 | 60 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 61 | 62 | uncompr.obj: uncompr.c zlib.h zconf.h 63 | 64 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 65 | 66 | example.obj: test/example.c zlib.h zconf.h 67 | 68 | minigzip.obj: test/minigzip.c zlib.h zconf.h 69 | 70 | 71 | # For the sake of the old Borland make, 72 | # the command line is cut to fit in the MS-DOS 128 byte limit: 73 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 74 | -del $(ZLIB_LIB) 75 | $(AR) $(ZLIB_LIB) $(OBJP1) 76 | $(AR) $(ZLIB_LIB) $(OBJP2) 77 | 78 | 79 | # testing 80 | test: example.exe minigzip.exe 81 | example 82 | echo hello world | minigzip | minigzip -d 83 | 84 | example.exe: example.obj $(ZLIB_LIB) 85 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 86 | 87 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 88 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 89 | 90 | 91 | # cleanup 92 | clean: 93 | -del *.obj 94 | -del *.exe 95 | -del *.lib 96 | -del *.tds 97 | -del zlib.bak 98 | -del foo.gz 99 | 100 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/sam.h: -------------------------------------------------------------------------------- 1 | #ifndef BAM_SAM_H 2 | #define BAM_SAM_H 3 | 4 | #include "bam.h" 5 | 6 | /*! 7 | @header 8 | 9 | This file provides higher level of I/O routines and unifies the APIs 10 | for SAM and BAM formats. These APIs are more convenient and 11 | recommended. 12 | 13 | @copyright Genome Research Ltd. 14 | */ 15 | 16 | /*! @typedef 17 | @abstract SAM/BAM file handler 18 | @field type type of the handler; bit 1 for BAM, 2 for reading and bit 3-4 for flag format 19 | @field bam BAM file handler; valid if (type&1) == 1 20 | @field tamr SAM file handler for reading; valid if type == 2 21 | @field tamw SAM file handler for writing; valid if type == 0 22 | @field header header struct 23 | */ 24 | typedef struct { 25 | int type; 26 | union { 27 | tamFile tamr; 28 | bamFile bam; 29 | FILE *tamw; 30 | } x; 31 | bam_header_t *header; 32 | } samfile_t; 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /*! 39 | @abstract Open a SAM/BAM file 40 | 41 | @param fn SAM/BAM file name; "-" is recognized as stdin (for 42 | reading) or stdout (for writing). 43 | 44 | @param mode open mode /[rw](b?)(u?)(h?)([xX]?)/: 'r' for reading, 45 | 'w' for writing, 'b' for BAM I/O, 'u' for uncompressed BAM output, 46 | 'h' for outputing header in SAM, 'x' for HEX flag and 'X' for 47 | string flag. If 'b' present, it must immediately follow 'r' or 48 | 'w'. Valid modes are "r", "w", "wh", "wx", "whx", "wX", "whX", 49 | "rb", "wb" and "wbu" exclusively. 50 | 51 | @param aux auxiliary data; if mode[0]=='w', aux points to 52 | bam_header_t; if strcmp(mode, "rb")!=0 and @SQ header lines in SAM 53 | are absent, aux points the file name of the list of the reference; 54 | aux is not used otherwise. If @SQ header lines are present in SAM, 55 | aux is not used, either. 56 | 57 | @return SAM/BAM file handler 58 | */ 59 | samfile_t *samopen(const char *fn, const char *mode, const void *aux); 60 | 61 | /*! 62 | @abstract Close a SAM/BAM handler 63 | @param fp file handler to be closed 64 | */ 65 | void samclose(samfile_t *fp); 66 | 67 | /*! 68 | @abstract Read one alignment 69 | @param fp file handler 70 | @param b alignment 71 | @return bytes read 72 | */ 73 | int samread(samfile_t *fp, bam1_t *b); 74 | 75 | /*! 76 | @abstract Write one alignment 77 | @param fp file handler 78 | @param b alignment 79 | @return bytes written 80 | */ 81 | int samwrite(samfile_t *fp, const bam1_t *b); 82 | 83 | /*! 84 | @abstract Get the pileup for a whole alignment file 85 | @param fp file handler 86 | @param mask mask transferred to bam_plbuf_set_mask() 87 | @param func user defined function called in the pileup process 88 | #param data user provided data for func() 89 | */ 90 | int sampileup(samfile_t *fp, int mask, bam_pileup_f func, void *data); 91 | 92 | char *samfaipath(const char *fn_ref); 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/misc/wgsim_eval.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Contact: lh3 4 | # Version: 0.1.5 5 | 6 | use strict; 7 | use warnings; 8 | use Getopt::Std; 9 | 10 | &wgsim_eval; 11 | exit; 12 | 13 | sub wgsim_eval { 14 | my %opts = (g=>5); 15 | getopts('pcag:', \%opts); 16 | die("Usage: wgsim_eval.pl [-pca] [-g $opts{g}] \n") if (@ARGV == 0 && -t STDIN); 17 | my (@c0, @c1, %fnfp); 18 | my ($max_q, $flag) = (0, 0); 19 | my $gap = $opts{g}; 20 | $flag |= 1 if (defined $opts{p}); 21 | $flag |= 2 if (defined $opts{c}); 22 | while (<>) { 23 | next if (/^\@/); 24 | my @t = split("\t"); 25 | next if (@t < 11); 26 | my $line = $_; 27 | my ($q, $is_correct, $chr, $left, $rght) = (int($t[4]/10), 1, $t[2], $t[3], $t[3]); 28 | $max_q = $q if ($q > $max_q); 29 | # right coordinate 30 | $_ = $t[5]; s/(\d+)[MDN]/$rght+=$1,'x'/eg; 31 | --$rght; 32 | # correct for soft clipping 33 | my ($left0, $rght0) = ($left, $rght); 34 | $left -= $1 if (/^(\d+)[SH]/); 35 | $rght += $1 if (/(\d+)[SH]$/); 36 | $left0 -= $1 if (/(\d+)[SH]$/); 37 | $rght0 += $1 if (/^(\d+)[SH]/); 38 | # skip unmapped reads 39 | next if (($t[1]&0x4) || $chr eq '*'); 40 | # parse read name and check 41 | if ($t[0] =~ /^(\S+)_(\d+)_(\d+)_/) { 42 | if ($1 ne $chr) { # different chr 43 | $is_correct = 0; 44 | } else { 45 | if ($flag & 2) { 46 | if (($t[1]&0x40) && !($t[1]&0x10)) { # F3, forward 47 | $is_correct = 0 if (abs($2 - $left) > $gap && abs($2 - $left0) > $gap); 48 | } elsif (($t[1]&0x40) && ($t[1]&0x10)) { # F3, reverse 49 | $is_correct = 0 if (abs($3 - $rght) > $gap && abs($3 - $rght0) > $gap); 50 | } elsif (($t[1]&0x80) && !($t[1]&0x10)) { # R3, forward 51 | $is_correct = 0 if (abs($3 - $left) > $gap && abs($3 - $left0) > $gap); 52 | } else { # R3, reverse 53 | $is_correct = 0 if (abs($2 - $rght) > $gap && abs($3 - $rght0) > $gap); 54 | } 55 | } else { 56 | if ($t[1] & 0x10) { # reverse 57 | $is_correct = 0 if (abs($3 - $rght) > $gap && abs($3 - $rght0) > $gap); # in case of indels that are close to the end of a reads 58 | } else { 59 | $is_correct = 0 if (abs($2 - $left) > $gap && abs($2 - $left0) > $gap); 60 | } 61 | } 62 | } 63 | } else { 64 | warn("[wgsim_eval] read '$t[0]' was not generated by wgsim?\n"); 65 | next; 66 | } 67 | ++$c0[$q]; 68 | ++$c1[$q] unless ($is_correct); 69 | @{$fnfp{$t[4]}} = (0, 0) unless (defined $fnfp{$t[4]}); 70 | ++$fnfp{$t[4]}[0]; 71 | ++$fnfp{$t[4]}[1] unless ($is_correct); 72 | print STDERR $line if (($flag&1) && !$is_correct && $q > 0); 73 | } 74 | # print 75 | my ($cc0, $cc1) = (0, 0); 76 | if (!defined($opts{a})) { 77 | for (my $i = $max_q; $i >= 0; --$i) { 78 | $c0[$i] = 0 unless (defined $c0[$i]); 79 | $c1[$i] = 0 unless (defined $c1[$i]); 80 | $cc0 += $c0[$i]; $cc1 += $c1[$i]; 81 | printf("%.2dx %12d / %-12d %12d %.3e\n", $i, $c1[$i], $c0[$i], $cc0, $cc1/$cc0) if ($cc0); 82 | } 83 | } else { 84 | for (reverse(sort {$a<=>$b} (keys %fnfp))) { 85 | next if ($_ == 0); 86 | $cc0 += $fnfp{$_}[0]; 87 | $cc1 += $fnfp{$_}[1]; 88 | print join("\t", $_, $cc0, $cc1), "\n"; 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/Makefile: -------------------------------------------------------------------------------- 1 | CC= gcc 2 | CFLAGS= -g -Wall -O2 -fPIC #-m64 #-arch ppc 3 | DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 4 | KNETFILE_O= knetfile.o 5 | LOBJS= bgzf.o kstring.o bam_aux.o bam.o bam_import.o sam.o bam_index.o \ 6 | bam_pileup.o bam_lpileup.o bam_md.o razf.o faidx.o bedidx.o \ 7 | $(KNETFILE_O) bam_sort.o sam_header.o bam_reheader.o kprobaln.o bam_cat.o 8 | AOBJS= bam_tview.o bam_plcmd.o sam_view.o \ 9 | bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o \ 10 | bamtk.o kaln.o bam2bcf.o bam2bcf_indel.o errmod.o sample.o \ 11 | cut_target.o phase.o bam2depth.o 12 | PROG= samtools 13 | INCLUDES= -I. 14 | SUBDIRS= . bcftools misc 15 | LIBPATH= 16 | LIBCURSES= -lcurses # -lXCurses 17 | 18 | .SUFFIXES:.c .o 19 | 20 | .c.o: 21 | $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@ 22 | 23 | all-recur lib-recur clean-recur cleanlocal-recur install-recur: 24 | @target=`echo $@ | sed s/-recur//`; \ 25 | wdir=`pwd`; \ 26 | list='$(SUBDIRS)'; for subdir in $$list; do \ 27 | cd $$subdir; \ 28 | $(MAKE) CC="$(CC)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \ 29 | INCLUDES="$(INCLUDES)" LIBPATH="$(LIBPATH)" $$target || exit 1; \ 30 | cd $$wdir; \ 31 | done; 32 | 33 | all:$(PROG) 34 | 35 | .PHONY:all lib clean cleanlocal 36 | .PHONY:all-recur lib-recur clean-recur cleanlocal-recur install-recur 37 | 38 | lib:libbam.a 39 | 40 | libbam.a:$(LOBJS) 41 | $(AR) -csru $@ $(LOBJS) 42 | 43 | samtools:lib-recur $(AOBJS) 44 | $(CC) $(CFLAGS) -o $@ $(AOBJS) -Lbcftools $(LIBPATH) libbam.a -lbcf $(LIBCURSES) -lm -lz 45 | 46 | razip:razip.o razf.o $(KNETFILE_O) 47 | $(CC) $(CFLAGS) -o $@ razf.o razip.o $(KNETFILE_O) -lz 48 | 49 | bgzip:bgzip.o bgzf.o $(KNETFILE_O) 50 | $(CC) $(CFLAGS) -o $@ bgzf.o bgzip.o $(KNETFILE_O) -lz 51 | 52 | razip.o:razf.h 53 | bam.o:bam.h razf.h bam_endian.h kstring.h sam_header.h 54 | sam.o:sam.h bam.h 55 | bam_import.o:bam.h kseq.h khash.h razf.h 56 | bam_pileup.o:bam.h razf.h ksort.h 57 | bam_plcmd.o:bam.h faidx.h bcftools/bcf.h bam2bcf.h 58 | bam_index.o:bam.h khash.h ksort.h razf.h bam_endian.h 59 | bam_lpileup.o:bam.h ksort.h 60 | bam_tview.o:bam.h faidx.h 61 | bam_sort.o:bam.h ksort.h razf.h 62 | bam_md.o:bam.h faidx.h 63 | sam_header.o:sam_header.h khash.h 64 | bcf.o:bcftools/bcf.h 65 | bam2bcf.o:bam2bcf.h errmod.h bcftools/bcf.h 66 | bam2bcf_indel.o:bam2bcf.h 67 | errmod.o:errmod.h 68 | phase.o:bam.h khash.h ksort.h 69 | bamtk.o:bam.h 70 | 71 | faidx.o:faidx.h razf.h khash.h 72 | faidx_main.o:faidx.h razf.h 73 | 74 | 75 | libbam.1.dylib-local:$(LOBJS) 76 | libtool -dynamic $(LOBJS) -o libbam.1.dylib -lc -lz 77 | 78 | libbam.so.1-local:$(LOBJS) 79 | $(CC) -shared -Wl,-soname,libbam.so -o libbam.so.1 $(LOBJS) -lc -lz 80 | 81 | dylib: 82 | @$(MAKE) cleanlocal; \ 83 | case `uname` in \ 84 | Linux) $(MAKE) CFLAGS="$(CFLAGS) -fPIC" libbam.so.1-local;; \ 85 | Darwin) $(MAKE) CFLAGS="$(CFLAGS) -fPIC" libbam.1.dylib-local;; \ 86 | *) echo 'Unknown OS';; \ 87 | esac 88 | 89 | 90 | cleanlocal: 91 | rm -fr gmon.out *.o a.out *.exe *.dSYM razip bgzip $(PROG) *~ *.a *.so.* *.so *.dylib 92 | 93 | clean:cleanlocal-recur 94 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/infback9/inftree9.h: -------------------------------------------------------------------------------- 1 | /* inftree9.h -- header to use inftree9.c 2 | * Copyright (C) 1995-2008 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 100eeeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1446, which is the sum of 852 for literal/length codes and 594 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 32 6 15" for distance codes returns 594. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in infback9.c. If the root table size is changed, 47 | then these maximum sizes would be need to be recalculated and updated. */ 48 | #define ENOUGH_LENS 852 49 | #define ENOUGH_DISTS 594 50 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 51 | 52 | /* Type of code to build for inflate_table9() */ 53 | typedef enum { 54 | CODES, 55 | LENS, 56 | DISTS 57 | } codetype; 58 | 59 | extern int inflate_table9 OF((codetype type, unsigned short FAR *lens, 60 | unsigned codes, code FAR * FAR *table, 61 | unsigned FAR *bits, unsigned short FAR *work)); 62 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/msdos/Makefile.dj2: -------------------------------------------------------------------------------- 1 | # Makefile for zlib. Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96. 2 | # Copyright (C) 1995-1998 Jean-loup Gailly. 3 | # For conditions of distribution and use, see copyright notice in zlib.h 4 | 5 | # To compile, or to compile and test, type: 6 | # 7 | # make -fmakefile.dj2; make test -fmakefile.dj2 8 | # 9 | # To install libz.a, zconf.h and zlib.h in the djgpp directories, type: 10 | # 11 | # make install -fmakefile.dj2 12 | # 13 | # after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as 14 | # in the sample below if the pattern of the DJGPP distribution is to 15 | # be followed. Remember that, while 'es around <=> are ignored in 16 | # makefiles, they are *not* in batch files or in djgpp.env. 17 | # - - - - - 18 | # [make] 19 | # INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include 20 | # LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib 21 | # BUTT=-m486 22 | # - - - - - 23 | # Alternately, these variables may be defined below, overriding the values 24 | # in djgpp.env, as 25 | # INCLUDE_PATH=c:\usr\include 26 | # LIBRARY_PATH=c:\usr\lib 27 | 28 | CC=gcc 29 | 30 | #CFLAGS=-MMD -O 31 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 32 | #CFLAGS=-MMD -g -DDEBUG 33 | CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 34 | -Wstrict-prototypes -Wmissing-prototypes 35 | 36 | # If cp.exe is available, replace "copy /Y" with "cp -fp" . 37 | CP=copy /Y 38 | # If gnu install.exe is available, replace $(CP) with ginstall. 39 | INSTALL=$(CP) 40 | # The default value of RM is "rm -f." If "rm.exe" is found, comment out: 41 | RM=del 42 | LDLIBS=-L. -lz 43 | LD=$(CC) -s -o 44 | LDSHARED=$(CC) 45 | 46 | INCL=zlib.h zconf.h 47 | LIBS=libz.a 48 | 49 | AR=ar rcs 50 | 51 | prefix=/usr/local 52 | exec_prefix = $(prefix) 53 | 54 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 55 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 56 | 57 | OBJA = 58 | # to use the asm code: make OBJA=match.o 59 | 60 | TEST_OBJS = example.o minigzip.o 61 | 62 | all: example.exe minigzip.exe 63 | 64 | check: test 65 | test: all 66 | ./example 67 | echo hello world | .\minigzip | .\minigzip -d 68 | 69 | %.o : %.c 70 | $(CC) $(CFLAGS) -c $< -o $@ 71 | 72 | libz.a: $(OBJS) $(OBJA) 73 | $(AR) $@ $(OBJS) $(OBJA) 74 | 75 | %.exe : %.o $(LIBS) 76 | $(LD) $@ $< $(LDLIBS) 77 | 78 | # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . 79 | 80 | .PHONY : uninstall clean 81 | 82 | install: $(INCL) $(LIBS) 83 | -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH) 84 | -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH) 85 | $(INSTALL) zlib.h $(INCLUDE_PATH) 86 | $(INSTALL) zconf.h $(INCLUDE_PATH) 87 | $(INSTALL) libz.a $(LIBRARY_PATH) 88 | 89 | uninstall: 90 | $(RM) $(INCLUDE_PATH)\zlib.h 91 | $(RM) $(INCLUDE_PATH)\zconf.h 92 | $(RM) $(LIBRARY_PATH)\libz.a 93 | 94 | clean: 95 | $(RM) *.d 96 | $(RM) *.o 97 | $(RM) *.exe 98 | $(RM) libz.a 99 | $(RM) foo.gz 100 | 101 | DEPS := $(wildcard *.d) 102 | ifneq ($(DEPS),) 103 | include $(DEPS) 104 | endif 105 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/iostream/zfstream.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef zfstream_h 3 | #define zfstream_h 4 | 5 | #include 6 | #include "zlib.h" 7 | 8 | class gzfilebuf : public streambuf { 9 | 10 | public: 11 | 12 | gzfilebuf( ); 13 | virtual ~gzfilebuf(); 14 | 15 | gzfilebuf *open( const char *name, int io_mode ); 16 | gzfilebuf *attach( int file_descriptor, int io_mode ); 17 | gzfilebuf *close(); 18 | 19 | int setcompressionlevel( int comp_level ); 20 | int setcompressionstrategy( int comp_strategy ); 21 | 22 | inline int is_open() const { return (file !=NULL); } 23 | 24 | virtual streampos seekoff( streamoff, ios::seek_dir, int ); 25 | 26 | virtual int sync(); 27 | 28 | protected: 29 | 30 | virtual int underflow(); 31 | virtual int overflow( int = EOF ); 32 | 33 | private: 34 | 35 | gzFile file; 36 | short mode; 37 | short own_file_descriptor; 38 | 39 | int flushbuf(); 40 | int fillbuf(); 41 | 42 | }; 43 | 44 | class gzfilestream_common : virtual public ios { 45 | 46 | friend class gzifstream; 47 | friend class gzofstream; 48 | friend gzofstream &setcompressionlevel( gzofstream &, int ); 49 | friend gzofstream &setcompressionstrategy( gzofstream &, int ); 50 | 51 | public: 52 | virtual ~gzfilestream_common(); 53 | 54 | void attach( int fd, int io_mode ); 55 | void open( const char *name, int io_mode ); 56 | void close(); 57 | 58 | protected: 59 | gzfilestream_common(); 60 | 61 | private: 62 | gzfilebuf *rdbuf(); 63 | 64 | gzfilebuf buffer; 65 | 66 | }; 67 | 68 | class gzifstream : public gzfilestream_common, public istream { 69 | 70 | public: 71 | 72 | gzifstream(); 73 | gzifstream( const char *name, int io_mode = ios::in ); 74 | gzifstream( int fd, int io_mode = ios::in ); 75 | 76 | virtual ~gzifstream(); 77 | 78 | }; 79 | 80 | class gzofstream : public gzfilestream_common, public ostream { 81 | 82 | public: 83 | 84 | gzofstream(); 85 | gzofstream( const char *name, int io_mode = ios::out ); 86 | gzofstream( int fd, int io_mode = ios::out ); 87 | 88 | virtual ~gzofstream(); 89 | 90 | }; 91 | 92 | template class gzomanip { 93 | friend gzofstream &operator<<(gzofstream &, const gzomanip &); 94 | public: 95 | gzomanip(gzofstream &(*f)(gzofstream &, T), T v) : func(f), val(v) { } 96 | private: 97 | gzofstream &(*func)(gzofstream &, T); 98 | T val; 99 | }; 100 | 101 | template gzofstream &operator<<(gzofstream &s, const gzomanip &m) 102 | { 103 | return (*m.func)(s, m.val); 104 | } 105 | 106 | inline gzofstream &setcompressionlevel( gzofstream &s, int l ) 107 | { 108 | (s.rdbuf())->setcompressionlevel(l); 109 | return s; 110 | } 111 | 112 | inline gzofstream &setcompressionstrategy( gzofstream &s, int l ) 113 | { 114 | (s.rdbuf())->setcompressionstrategy(l); 115 | return s; 116 | } 117 | 118 | inline gzomanip setcompressionlevel(int l) 119 | { 120 | return gzomanip(&setcompressionlevel,l); 121 | } 122 | 123 | inline gzomanip setcompressionstrategy(int l) 124 | { 125 | return gzomanip(&setcompressionstrategy,l); 126 | } 127 | 128 | #endif 129 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/win32/Makefile.bor: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Borland C++ for Win32 3 | # 4 | # Usage: 5 | # make -f win32/Makefile.bor 6 | # make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj 7 | 8 | # ------------ Borland C++ ------------ 9 | 10 | # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 11 | # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or 12 | # added to the declaration of LOC here: 13 | LOC = $(LOCAL_ZLIB) 14 | 15 | CC = bcc32 16 | AS = bcc32 17 | LD = bcc32 18 | AR = tlib 19 | CFLAGS = -a -d -k- -O2 $(LOC) 20 | ASFLAGS = $(LOC) 21 | LDFLAGS = $(LOC) 22 | 23 | 24 | # variables 25 | ZLIB_LIB = zlib.lib 26 | 27 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 28 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 29 | #OBJA = 30 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 31 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 32 | #OBJPA= 33 | 34 | 35 | # targets 36 | all: $(ZLIB_LIB) example.exe minigzip.exe 37 | 38 | .c.obj: 39 | $(CC) -c $(CFLAGS) $< 40 | 41 | .asm.obj: 42 | $(AS) -c $(ASFLAGS) $< 43 | 44 | adler32.obj: adler32.c zlib.h zconf.h 45 | 46 | compress.obj: compress.c zlib.h zconf.h 47 | 48 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 49 | 50 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 51 | 52 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 53 | 54 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 55 | 56 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 57 | 58 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 59 | 60 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 61 | inffast.h inffixed.h 62 | 63 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 64 | inffast.h 65 | 66 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 67 | inffast.h inffixed.h 68 | 69 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 70 | 71 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 72 | 73 | uncompr.obj: uncompr.c zlib.h zconf.h 74 | 75 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 76 | 77 | example.obj: test/example.c zlib.h zconf.h 78 | 79 | minigzip.obj: test/minigzip.c zlib.h zconf.h 80 | 81 | 82 | # For the sake of the old Borland make, 83 | # the command line is cut to fit in the MS-DOS 128 byte limit: 84 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA) 85 | -del $(ZLIB_LIB) 86 | $(AR) $(ZLIB_LIB) $(OBJP1) 87 | $(AR) $(ZLIB_LIB) $(OBJP2) 88 | $(AR) $(ZLIB_LIB) $(OBJPA) 89 | 90 | 91 | # testing 92 | test: example.exe minigzip.exe 93 | example 94 | echo hello world | minigzip | minigzip -d 95 | 96 | example.exe: example.obj $(ZLIB_LIB) 97 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 98 | 99 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 100 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 101 | 102 | 103 | # cleanup 104 | clean: 105 | -del $(ZLIB_LIB) 106 | -del *.obj 107 | -del *.exe 108 | -del *.tds 109 | -del zlib.bak 110 | -del foo.gz 111 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/msdos/Makefile.tc: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Turbo C 2.01, Turbo C++ 1.01 3 | # Last updated: 15-Mar-2003 4 | 5 | # To use, do "make -fmakefile.tc" 6 | # To compile in small model, set below: MODEL=s 7 | 8 | # WARNING: the small model is supported but only for small values of 9 | # MAX_WBITS and MAX_MEM_LEVEL. For example: 10 | # -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 11 | # If you wish to reduce the memory requirements (default 256K for big 12 | # objects plus a few K), you can add to CFLAGS below: 13 | # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 14 | # See zconf.h for details about the memory requirements. 15 | 16 | # ------------ Turbo C 2.01, Turbo C++ 1.01 ------------ 17 | MODEL=l 18 | CC=tcc 19 | LD=tcc 20 | AR=tlib 21 | # CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 22 | CFLAGS=-O2 -G -Z -m$(MODEL) 23 | LDFLAGS=-m$(MODEL) -f- 24 | 25 | 26 | # variables 27 | ZLIB_LIB = zlib_$(MODEL).lib 28 | 29 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 30 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 31 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 32 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 33 | 34 | 35 | # targets 36 | all: $(ZLIB_LIB) example.exe minigzip.exe 37 | 38 | .c.obj: 39 | $(CC) -c $(CFLAGS) $*.c 40 | 41 | adler32.obj: adler32.c zlib.h zconf.h 42 | 43 | compress.obj: compress.c zlib.h zconf.h 44 | 45 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 46 | 47 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 48 | 49 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 50 | 51 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 52 | 53 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 54 | 55 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 56 | 57 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 58 | inffast.h inffixed.h 59 | 60 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 61 | inffast.h 62 | 63 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 64 | inffast.h inffixed.h 65 | 66 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 67 | 68 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 69 | 70 | uncompr.obj: uncompr.c zlib.h zconf.h 71 | 72 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 73 | 74 | example.obj: test/example.c zlib.h zconf.h 75 | 76 | minigzip.obj: test/minigzip.c zlib.h zconf.h 77 | 78 | 79 | # the command line is cut to fit in the MS-DOS 128 byte limit: 80 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 81 | -del $(ZLIB_LIB) 82 | $(AR) $(ZLIB_LIB) $(OBJP1) 83 | $(AR) $(ZLIB_LIB) $(OBJP2) 84 | 85 | example.exe: example.obj $(ZLIB_LIB) 86 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 87 | 88 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 89 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 90 | 91 | test: example.exe minigzip.exe 92 | example 93 | echo hello world | minigzip | minigzip -d 94 | 95 | clean: 96 | -del *.obj 97 | -del *.lib 98 | -del *.exe 99 | -del zlib_*.bak 100 | -del foo.gz 101 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/misc/soap2sam.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Contact: lh3 4 | # Version: 0.1.1 5 | 6 | use strict; 7 | use warnings; 8 | use Getopt::Std; 9 | 10 | &soap2sam; 11 | exit; 12 | 13 | sub mating { 14 | my ($s1, $s2) = @_; 15 | my $isize = 0; 16 | if ($s1->[2] ne '*' && $s1->[2] eq $s2->[2]) { # then calculate $isize 17 | my $x1 = ($s1->[1] & 0x10)? $s1->[3] + length($s1->[9]) : $s1->[3]; 18 | my $x2 = ($s2->[1] & 0x10)? $s2->[3] + length($s2->[9]) : $s2->[3]; 19 | $isize = $x2 - $x1; 20 | } 21 | # update mate coordinate 22 | if ($s2->[2] ne '*') { 23 | @$s1[6..8] = (($s2->[2] eq $s1->[2])? "=" : $s2->[2], $s2->[3], $isize); 24 | $s1->[1] |= 0x20 if ($s2->[1] & 0x10); 25 | } else { 26 | $s1->[1] |= 0x8; 27 | } 28 | if ($s1->[2] ne '*') { 29 | @$s2[6..8] = (($s1->[2] eq $s2->[2])? "=" : $s1->[2], $s1->[3], -$isize); 30 | $s2->[1] |= 0x20 if ($s1->[1] & 0x10); 31 | } else { 32 | $s2->[1] |= 0x8; 33 | } 34 | } 35 | 36 | sub soap2sam { 37 | my %opts = (); 38 | getopts("p", \%opts); 39 | die("Usage: soap2sam.pl [-p] \n") if (@ARGV == 0 && -t STDIN); 40 | my $is_paired = defined($opts{p}); 41 | # core loop 42 | my @s1 = (); 43 | my @s2 = (); 44 | my ($s_last, $s_curr) = (\@s1, \@s2); 45 | while (<>) { 46 | s/[\177-\377]|[\000-\010]|[\012-\040]//g; 47 | next if (&soap2sam_aux($_, $s_curr, $is_paired) < 0); 48 | if (@$s_last != 0 && $s_last->[0] eq $s_curr->[0]) { 49 | &mating($s_last, $s_curr); 50 | print join("\t", @$s_last), "\n"; 51 | print join("\t", @$s_curr), "\n"; 52 | @$s_last = (); @$s_curr = (); 53 | } else { 54 | print join("\t", @$s_last), "\n" if (@$s_last != 0); 55 | my $s = $s_last; $s_last = $s_curr; $s_curr = $s; 56 | } 57 | } 58 | print join("\t", @$s_last), "\n" if (@$s_last != 0); 59 | } 60 | 61 | sub soap2sam_aux { 62 | my ($line, $s, $is_paired) = @_; 63 | chomp($line); 64 | my @t = split(/\s+/, $line); 65 | return -1 if (@t < 9 || $line =~ /^\s/ || !$t[0]); 66 | @$s = (); 67 | # fix SOAP-2.1.x bugs 68 | @t = @t[0..2,4..$#t] unless ($t[3] =~ /^\d+$/); 69 | # read name 70 | $s->[0] = $t[0]; 71 | $s->[0] =~ s/\/[12]$//g; 72 | # initial flag (will be updated later) 73 | $s->[1] = 0; 74 | $s->[1] |= 1 | 1<<($t[4] eq 'a'? 6 : 7); 75 | $s->[1] |= 2 if ($is_paired); 76 | # read & quality 77 | $s->[9] = $t[1]; 78 | $s->[10] = (length($t[2]) > length($t[1]))? substr($t[2], 0, length($t[1])) : $t[2]; 79 | # cigar 80 | $s->[5] = length($s->[9]) . "M"; 81 | # coor 82 | $s->[2] = $t[7]; $s->[3] = $t[8]; 83 | $s->[1] |= 0x10 if ($t[6] eq '-'); 84 | # mapQ 85 | $s->[4] = $t[3] == 1? 30 : 0; 86 | # mate coordinate 87 | $s->[6] = '*'; $s->[7] = $s->[8] = 0; 88 | # aux 89 | push(@$s, "NM:i:$t[9]"); 90 | my $md = ''; 91 | if ($t[9]) { 92 | my @x; 93 | for (10 .. $#t) { 94 | push(@x, sprintf("%.3d,$1", $2)) if ($t[$_] =~ /^([ACGT])->(\d+)/i); 95 | } 96 | @x = sort(@x); 97 | my $a = 0; 98 | for (@x) { 99 | my ($y, $z) = split(","); 100 | $md .= (int($y)-$a) . $z; 101 | $a += $y - $a + 1; 102 | } 103 | $md .= length($t[1]) - $a; 104 | } else { 105 | $md = length($t[1]); 106 | } 107 | push(@$s, "MD:Z:$md"); 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /include/samtools-0.1.18/kstring.h: -------------------------------------------------------------------------------- 1 | #ifndef KSTRING_H 2 | #define KSTRING_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #ifndef kroundup32 9 | #define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) 10 | #endif 11 | 12 | #ifndef KSTRING_T 13 | #define KSTRING_T kstring_t 14 | typedef struct __kstring_t { 15 | size_t l, m; 16 | char *s; 17 | } kstring_t; 18 | #endif 19 | 20 | typedef struct { 21 | uint64_t tab[4]; 22 | int sep, finished; 23 | const char *p; // end of the current token 24 | } ks_tokaux_t; 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | int ksprintf(kstring_t *s, const char *fmt, ...); 31 | int ksplit_core(char *s, int delimiter, int *_max, int **_offsets); 32 | char *kstrstr(const char *str, const char *pat, int **_prep); 33 | char *kstrnstr(const char *str, const char *pat, int n, int **_prep); 34 | void *kmemmem(const void *_str, int n, const void *_pat, int m, int **_prep); 35 | 36 | /* kstrtok() is similar to strtok_r() except that str is not 37 | * modified and both str and sep can be NULL. For efficiency, it is 38 | * actually recommended to set both to NULL in the subsequent calls 39 | * if sep is not changed. */ 40 | char *kstrtok(const char *str, const char *sep, ks_tokaux_t *aux); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | static inline int kputsn(const char *p, int l, kstring_t *s) 47 | { 48 | if (s->l + l + 1 >= s->m) { 49 | s->m = s->l + l + 2; 50 | kroundup32(s->m); 51 | s->s = (char*)realloc(s->s, s->m); 52 | } 53 | memcpy(s->s + s->l, p, l); 54 | s->l += l; 55 | s->s[s->l] = 0; 56 | return l; 57 | } 58 | 59 | static inline int kputs(const char *p, kstring_t *s) 60 | { 61 | return kputsn(p, strlen(p), s); 62 | } 63 | 64 | static inline int kputc(int c, kstring_t *s) 65 | { 66 | if (s->l + 1 >= s->m) { 67 | s->m = s->l + 2; 68 | kroundup32(s->m); 69 | s->s = (char*)realloc(s->s, s->m); 70 | } 71 | s->s[s->l++] = c; 72 | s->s[s->l] = 0; 73 | return c; 74 | } 75 | 76 | static inline int kputw(int c, kstring_t *s) 77 | { 78 | char buf[16]; 79 | int l, x; 80 | if (c == 0) return kputc('0', s); 81 | for (l = 0, x = c < 0? -c : c; x > 0; x /= 10) buf[l++] = x%10 + '0'; 82 | if (c < 0) buf[l++] = '-'; 83 | if (s->l + l + 1 >= s->m) { 84 | s->m = s->l + l + 2; 85 | kroundup32(s->m); 86 | s->s = (char*)realloc(s->s, s->m); 87 | } 88 | for (x = l - 1; x >= 0; --x) s->s[s->l++] = buf[x]; 89 | s->s[s->l] = 0; 90 | return 0; 91 | } 92 | 93 | static inline int kputuw(unsigned c, kstring_t *s) 94 | { 95 | char buf[16]; 96 | int l, i; 97 | unsigned x; 98 | if (c == 0) return kputc('0', s); 99 | for (l = 0, x = c; x > 0; x /= 10) buf[l++] = x%10 + '0'; 100 | if (s->l + l + 1 >= s->m) { 101 | s->m = s->l + l + 2; 102 | kroundup32(s->m); 103 | s->s = (char*)realloc(s->s, s->m); 104 | } 105 | for (i = l - 1; i >= 0; --i) s->s[s->l++] = buf[i]; 106 | s->s[s->l] = 0; 107 | return 0; 108 | } 109 | 110 | static inline int *ksplit(kstring_t *s, int delimiter, int *n) 111 | { 112 | int max = 0, *offsets = 0; 113 | *n = ksplit_core(s->s, delimiter, &max, &offsets); 114 | return offsets; 115 | } 116 | 117 | #endif 118 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/pascal/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory contains a Pascal (Delphi, Kylix) interface to the 3 | zlib data compression library. 4 | 5 | 6 | Directory listing 7 | ================= 8 | 9 | zlibd32.mak makefile for Borland C++ 10 | example.pas usage example of zlib 11 | zlibpas.pas the Pascal interface to zlib 12 | readme.txt this file 13 | 14 | 15 | Compatibility notes 16 | =================== 17 | 18 | - Although the name "zlib" would have been more normal for the 19 | zlibpas unit, this name is already taken by Borland's ZLib unit. 20 | This is somehow unfortunate, because that unit is not a genuine 21 | interface to the full-fledged zlib functionality, but a suite of 22 | class wrappers around zlib streams. Other essential features, 23 | such as checksums, are missing. 24 | It would have been more appropriate for that unit to have a name 25 | like "ZStreams", or something similar. 26 | 27 | - The C and zlib-supplied types int, uInt, long, uLong, etc. are 28 | translated directly into Pascal types of similar sizes (Integer, 29 | LongInt, etc.), to avoid namespace pollution. In particular, 30 | there is no conversion of unsigned int into a Pascal unsigned 31 | integer. The Word type is non-portable and has the same size 32 | (16 bits) both in a 16-bit and in a 32-bit environment, unlike 33 | Integer. Even if there is a 32-bit Cardinal type, there is no 34 | real need for unsigned int in zlib under a 32-bit environment. 35 | 36 | - Except for the callbacks, the zlib function interfaces are 37 | assuming the calling convention normally used in Pascal 38 | (__pascal for DOS and Windows16, __fastcall for Windows32). 39 | Since the cdecl keyword is used, the old Turbo Pascal does 40 | not work with this interface. 41 | 42 | - The gz* function interfaces are not translated, to avoid 43 | interfacing problems with the C runtime library. Besides, 44 | gzprintf(gzFile file, const char *format, ...) 45 | cannot be translated into Pascal. 46 | 47 | 48 | Legal issues 49 | ============ 50 | 51 | The zlibpas interface is: 52 | Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler. 53 | Copyright (C) 1998 by Bob Dellaca. 54 | Copyright (C) 2003 by Cosmin Truta. 55 | 56 | The example program is: 57 | Copyright (C) 1995-2003 by Jean-loup Gailly. 58 | Copyright (C) 1998,1999,2000 by Jacques Nomssi Nzali. 59 | Copyright (C) 2003 by Cosmin Truta. 60 | 61 | This software is provided 'as-is', without any express or implied 62 | warranty. In no event will the author be held liable for any damages 63 | arising from the use of this software. 64 | 65 | Permission is granted to anyone to use this software for any purpose, 66 | including commercial applications, and to alter it and redistribute it 67 | freely, subject to the following restrictions: 68 | 69 | 1. The origin of this software must not be misrepresented; you must not 70 | claim that you wrote the original software. If you use this software 71 | in a product, an acknowledgment in the product documentation would be 72 | appreciated but is not required. 73 | 2. Altered source versions must be plainly marked as such, and must not be 74 | misrepresented as being the original software. 75 | 3. This notice may not be removed or altered from any source distribution. 76 | 77 | -------------------------------------------------------------------------------- /include/zlib-1.2.8/contrib/puff/README: -------------------------------------------------------------------------------- 1 | Puff -- A Simple Inflate 2 | 3 Mar 2003 3 | Mark Adler 4 | madler@alumni.caltech.edu 5 | 6 | What this is -- 7 | 8 | puff.c provides the routine puff() to decompress the deflate data format. It 9 | does so more slowly than zlib, but the code is about one-fifth the size of the 10 | inflate code in zlib, and written to be very easy to read. 11 | 12 | Why I wrote this -- 13 | 14 | puff.c was written to document the deflate format unambiguously, by virtue of 15 | being working C code. It is meant to supplement RFC 1951, which formally 16 | describes the deflate format. I have received many questions on details of the 17 | deflate format, and I hope that reading this code will answer those questions. 18 | puff.c is heavily commented with details of the deflate format, especially 19 | those little nooks and cranies of the format that might not be obvious from a 20 | specification. 21 | 22 | puff.c may also be useful in applications where code size or memory usage is a 23 | very limited resource, and speed is not as important. 24 | 25 | How to use it -- 26 | 27 | Well, most likely you should just be reading puff.c and using zlib for actual 28 | applications, but if you must ... 29 | 30 | Include puff.h in your code, which provides this prototype: 31 | 32 | int puff(unsigned char *dest, /* pointer to destination pointer */ 33 | unsigned long *destlen, /* amount of output space */ 34 | unsigned char *source, /* pointer to source data pointer */ 35 | unsigned long *sourcelen); /* amount of input available */ 36 | 37 | Then you can call puff() to decompress a deflate stream that is in memory in 38 | its entirety at source, to a sufficiently sized block of memory for the 39 | decompressed data at dest. puff() is the only external symbol in puff.c The 40 | only C library functions that puff.c needs are setjmp() and longjmp(), which 41 | are used to simplify error checking in the code to improve readabilty. puff.c 42 | does no memory allocation, and uses less than 2K bytes off of the stack. 43 | 44 | If destlen is not enough space for the uncompressed data, then inflate will 45 | return an error without writing more than destlen bytes. Note that this means 46 | that in order to decompress the deflate data successfully, you need to know 47 | the size of the uncompressed data ahead of time. 48 | 49 | If needed, puff() can determine the size of the uncompressed data with no 50 | output space. This is done by passing dest equal to (unsigned char *)0. Then 51 | the initial value of *destlen is ignored and *destlen is set to the length of 52 | the uncompressed data. So if the size of the uncompressed data is not known, 53 | then two passes of puff() can be used--first to determine the size, and second 54 | to do the actual inflation after allocating the appropriate memory. Not 55 | pretty, but it works. (This is one of the reasons you should be using zlib.) 56 | 57 | The deflate format is self-terminating. If the deflate stream does not end 58 | in *sourcelen bytes, puff() will return an error without reading at or past 59 | endsource. 60 | 61 | On return, *sourcelen is updated to the amount of input data consumed, and 62 | *destlen is updated to the size of the uncompressed data. See the comments 63 | in puff.c for the possible return codes for puff(). 64 | --------------------------------------------------------------------------------