pyfastk 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyfastk-0.1.0/FASTK/FastK.c +561 -0
- pyfastk-0.1.0/FASTK/FastK.h +156 -0
- pyfastk-0.1.0/FASTK/Fastcat.c +631 -0
- pyfastk-0.1.0/FASTK/Fastmerge.c +1048 -0
- pyfastk-0.1.0/FASTK/Fastrm.c +167 -0
- pyfastk-0.1.0/FASTK/Fastxfer.c +243 -0
- pyfastk-0.1.0/FASTK/HTSLIB/INSTALL +244 -0
- pyfastk-0.1.0/FASTK/HTSLIB/LICENSE +69 -0
- pyfastk-0.1.0/FASTK/HTSLIB/Makefile +632 -0
- pyfastk-0.1.0/FASTK/HTSLIB/NEWS +949 -0
- pyfastk-0.1.0/FASTK/HTSLIB/README +5 -0
- pyfastk-0.1.0/FASTK/HTSLIB/README.large_positions.md +234 -0
- pyfastk-0.1.0/FASTK/HTSLIB/aclocal.m4 +174 -0
- pyfastk-0.1.0/FASTK/HTSLIB/bcf_sr_sort.c +684 -0
- pyfastk-0.1.0/FASTK/HTSLIB/bcf_sr_sort.h +108 -0
- pyfastk-0.1.0/FASTK/HTSLIB/bgzf.c +2483 -0
- pyfastk-0.1.0/FASTK/HTSLIB/bgzip.1 +180 -0
- pyfastk-0.1.0/FASTK/HTSLIB/bgzip.c +422 -0
- pyfastk-0.1.0/FASTK/HTSLIB/config.h +8 -0
- pyfastk-0.1.0/FASTK/HTSLIB/config.mk.in +114 -0
- pyfastk-0.1.0/FASTK/HTSLIB/configure.ac +421 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram.h +61 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_codecs.c +2257 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_codecs.h +196 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_decode.c +3397 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_decode.h +117 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_encode.c +3392 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_encode.h +115 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_external.c +396 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_index.c +772 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_index.h +115 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_io.c +5015 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_io.h +942 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_samtools.c +123 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_samtools.h +98 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_stats.c +212 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_stats.h +59 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_structs.h +865 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/mFILE.c +668 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/mFILE.h +93 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/misc.h +77 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/open_trace_file.c +437 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/open_trace_file.h +125 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/os.h +204 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/pooled_alloc.c +205 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/pooled_alloc.h +66 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/rANS_byte.h +352 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/rANS_static.c +909 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/rANS_static.h +51 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/string_alloc.c +162 -0
- pyfastk-0.1.0/FASTK/HTSLIB/cram/string_alloc.h +69 -0
- pyfastk-0.1.0/FASTK/HTSLIB/errmod.c +208 -0
- pyfastk-0.1.0/FASTK/HTSLIB/faidx.5 +238 -0
- pyfastk-0.1.0/FASTK/HTSLIB/faidx.c +951 -0
- pyfastk-0.1.0/FASTK/HTSLIB/header.c +2715 -0
- pyfastk-0.1.0/FASTK/HTSLIB/header.h +319 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hfile.c +1189 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hfile_gcs.c +138 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hfile_internal.h +201 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hfile_libcurl.c +1504 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hfile_net.c +112 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hfile_s3.c +1258 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hfile_s3_write.c +896 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hts.c +4048 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hts_internal.h +127 -0
- pyfastk-0.1.0/FASTK/HTSLIB/hts_os.c +59 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htsfile.1 +94 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htsfile.c +329 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/bgzf.h +454 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/cram.h +549 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/faidx.h +334 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/hfile.h +322 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts.h +1341 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts_defs.h +112 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts_endian.h +354 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts_log.h +96 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts_os.h +80 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/kbitset.h +203 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/kfunc.h +91 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/khash.h +669 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/khash_str2int.h +133 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/klist.h +136 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/knetfile.h +109 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/kroundup.h +76 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/kseq.h +252 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/ksort.h +320 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/kstring.h +389 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/regidx.h +244 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/sam.h +1789 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/synced_bcf_reader.h +383 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/tbx.h +142 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/thread_pool.h +377 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/vcf.h +1465 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/vcf_sweep.h +57 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib/vcfutils.h +144 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib-s3-plugin.7 +122 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib.mk +191 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib.pc.in +15 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib.pc.tmp +15 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib_static.mk +2 -0
- pyfastk-0.1.0/FASTK/HTSLIB/htslib_vars.mk +54 -0
- pyfastk-0.1.0/FASTK/HTSLIB/kfunc.c +283 -0
- pyfastk-0.1.0/FASTK/HTSLIB/knetfile.c +645 -0
- pyfastk-0.1.0/FASTK/HTSLIB/kstring.c +437 -0
- pyfastk-0.1.0/FASTK/HTSLIB/m4/hts_hide_dynamic_syms.m4 +65 -0
- pyfastk-0.1.0/FASTK/HTSLIB/m4/hts_prog_cc_warnings.m4 +208 -0
- pyfastk-0.1.0/FASTK/HTSLIB/md5.c +388 -0
- pyfastk-0.1.0/FASTK/HTSLIB/multipart.c +267 -0
- pyfastk-0.1.0/FASTK/HTSLIB/os/lzma_stub.h +85 -0
- pyfastk-0.1.0/FASTK/HTSLIB/os/rand.c +97 -0
- pyfastk-0.1.0/FASTK/HTSLIB/plugin.c +185 -0
- pyfastk-0.1.0/FASTK/HTSLIB/probaln.c +312 -0
- pyfastk-0.1.0/FASTK/HTSLIB/realn.c +290 -0
- pyfastk-0.1.0/FASTK/HTSLIB/regidx.c +686 -0
- pyfastk-0.1.0/FASTK/HTSLIB/region.c +276 -0
- pyfastk-0.1.0/FASTK/HTSLIB/sam.5 +68 -0
- pyfastk-0.1.0/FASTK/HTSLIB/sam.c +4749 -0
- pyfastk-0.1.0/FASTK/HTSLIB/sam_internal.h +101 -0
- pyfastk-0.1.0/FASTK/HTSLIB/synced_bcf_reader.c +1293 -0
- pyfastk-0.1.0/FASTK/HTSLIB/tabix.1 +182 -0
- pyfastk-0.1.0/FASTK/HTSLIB/tabix.c +676 -0
- pyfastk-0.1.0/FASTK/HTSLIB/tbx.c +478 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/auxf#values.sam +5 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/auxf#values_java.cram +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/auxf.fa +2 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/auxf.fa.fai +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/bgziptest.txt +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/bgziptest.txt.gz +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/bgziptest.txt.gz.gzi +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c1#bounds.sam +4 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c1#clip.sam +8 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c1#noseq.sam +10 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c1#pad1.sam +10 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c1#pad2.sam +14 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c1#pad3.sam +14 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c1#unknown.sam +9 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c1.fa +2 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c1.fa.fai +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c2#pad.sam +26 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c2.fa +2 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/c2.fa.fai +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#1.sam +2 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#1000.sam +1005 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#2.sam +3 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#5.sam +11 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#5b.sam +12 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#5b_java.cram +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#large_seq.sam +3 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#supp.sam +6 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#tag_depadded.sam +11 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#tag_padded.sam +11 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#unmap.sam +6 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#unmap1.sam +20 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce#unmap2.sam +29 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce.fa +20803 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/ce.fa.fai +7 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/colons.bam +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/colons.bam.bai +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/compare_sam.pl +213 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/cross_validate.sh +145 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/emptyfile +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/faidx.fa +21 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/fastqs.fq +500 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/fastqs_README.txt +109 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/fieldarith.c +74 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/fieldarith.sam +15 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/formatcols.vcf +6 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/formatmissing-out.vcf +6 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/formatmissing.vcf +6 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/fuzz/hts_open_fuzzer.c +151 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/header_syms.pl +104 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/hfile.c +311 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/hts_endian.c +512 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.bam.bai +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.bam.csi +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.bcf.csi +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.cram.crai +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.sam +190 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.sam.gz.bai +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.sam.gz.csi +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.vcf +728 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.vcf.gz.csi +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/index.vcf.gz.tbi +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/index.expected1.vcf +6 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/index.expected2.vcf +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/index.vcf +216 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/longref.sam +96 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/longref_itr.expected.sam +26 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/longref_multi.expected.sam +46 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/maintainer/check_copyright.pl +95 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/maintainer/check_spaces.pl +92 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/md#1.sam +12 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/md.fa +3 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/md.fa.fai +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad1.out +10 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad1.sam +47 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad2.out +10 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad2.sam +55 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad3.out +5 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad3.sam +53 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_D.out +11 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_D.sam +36 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_DI.out +12 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_DI.sam +40 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_I.out +11 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_I.sam +41 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_ID.out +12 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_ID.sam +45 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_N.out +11 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_N.sam +40 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_N2.out +13 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_N2.sam +46 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_P.out +10 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_P.sam +41 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mpileup.tst +73 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/small.bam +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/small.out +322 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/test-pileup.sh +34 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/no_hdr_sq_1.bam +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/no_hdr_sq_1.bam.csi +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/no_hdr_sq_1.expected.sam +16 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/noroundtrip-out.vcf +9 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/noroundtrip.vcf +8 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/pileup.c +255 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/range.bam +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/range.bam.bai +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/range.cram +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/range.cram.crai +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/range.out +17 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn01.fa +13 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn01.fa.fai +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn01.sam +8 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn01_exp-a.sam +8 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn01_exp-e.sam +8 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn01_exp.sam +8 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn02-r.sam +12 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn02.fa +71 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn02.fa.fai +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn02.sam +12 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn02_exp-a.sam +12 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn02_exp-e.sam +12 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/realn02_exp.sam +12 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/sam.c +1834 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/simple_test_driver.sh +190 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/bed_file.Y.100200.out +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/bed_file.bed +39 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/gff_file.X.2934832.2935190.out +4 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/gff_file.gff +70 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/large_chr.20.1.2147483647.out +9 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/large_chr.vcf +18 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/tabix.tst +65 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/test-tabix.sh +35 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/vcf_file.1.3000151.out +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/vcf_file.2.3199812.out +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/vcf_file.bcf +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/vcf_file.vcf +37 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/tabix.out +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-bcf-sr.c +142 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-bcf-sr.pl +566 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-bcf-translate.c +201 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-bcf-translate.out +18 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-logging.pl +96 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-parse-reg.c +204 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-regidx.c +472 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-api.c +545 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-api.out +29 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-hdr-in.vcf +25 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-hdr.out +16 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-sweep.c +114 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-sweep.out +4 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test.pl +955 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test_bgzf.c +1007 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test_index.c +83 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test_kstring.c +305 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test_realn.c +169 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test_str2int.c +155 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/test_view.c +426 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads1.c +47 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads2.c +45 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads3.c +50 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads4.c +68 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads5.c +66 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads6.c +108 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads7.c +119 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/thread_pool.md +58 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#MD.sam +22 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#MD2.sam +20 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#blank.sam +1 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#large_aux.sam +4 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#large_aux2.sam +11 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#large_aux_java.cram +0 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#minimal.sam +10 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#pair.sam +7 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#repeated.sam +7 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#rg.sam +13 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#tlen.sam +34 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#tlen2.sam +36 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#triplet.sam +7 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx#unsorted.sam +8 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx.fa +7 -0
- pyfastk-0.1.0/FASTK/HTSLIB/test/xx.fa.fai +3 -0
- pyfastk-0.1.0/FASTK/HTSLIB/textutils.c +448 -0
- pyfastk-0.1.0/FASTK/HTSLIB/textutils_internal.h +297 -0
- pyfastk-0.1.0/FASTK/HTSLIB/thread_pool.c +1434 -0
- pyfastk-0.1.0/FASTK/HTSLIB/thread_pool_internal.h +169 -0
- pyfastk-0.1.0/FASTK/HTSLIB/vcf.5 +120 -0
- pyfastk-0.1.0/FASTK/HTSLIB/vcf.c +4609 -0
- pyfastk-0.1.0/FASTK/HTSLIB/vcf_sweep.c +188 -0
- pyfastk-0.1.0/FASTK/HTSLIB/vcfutils.c +834 -0
- pyfastk-0.1.0/FASTK/HTSLIB/version.sh +54 -0
- pyfastk-0.1.0/FASTK/Haplex.c +546 -0
- pyfastk-0.1.0/FASTK/Histex.c +274 -0
- pyfastk-0.1.0/FASTK/Homex.c +493 -0
- pyfastk-0.1.0/FASTK/KmerMap.c +257 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/.cirrus.yml +8 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/.travis.yml +71 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/COPYING +21 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/Makefile +330 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/Makefile.msc +65 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/NEWS +129 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/README.md +243 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/common/common_defs.h +366 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/common/compiler_gcc.h +159 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/common/compiler_msc.h +96 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/adler32.c +130 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/adler32_vec_template.h +124 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/aligned_malloc.c +57 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/aligned_malloc.h +13 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/adler32_impl.h +120 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/cpu_features.c +119 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/cpu_features.h +37 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/crc32_impl.h +166 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/matchfinder_impl.h +93 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/bt_matchfinder.h +355 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/crc32.c +313 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/crc32_table.h +526 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/crc32_vec_template.h +61 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/decompress_template.h +421 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/deflate_compress.c +2826 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/deflate_compress.h +14 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/deflate_constants.h +66 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/deflate_decompress.c +997 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/gzip_compress.c +95 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/gzip_constants.h +45 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/gzip_decompress.c +148 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/hc_matchfinder.h +403 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/lib_common.h +35 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/matchfinder_common.h +168 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/unaligned.h +202 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/adler32_impl.h +332 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/cpu_features.c +139 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/cpu_features.h +41 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/crc32_impl.h +87 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/crc32_pclmul_template.h +262 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/decompress_impl.h +26 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/matchfinder_impl.h +164 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/zlib_compress.c +87 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/zlib_constants.h +21 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/zlib_decompress.c +91 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/libdeflate.h +323 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/benchmark.c +632 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/checksum.c +195 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/detect.sh +62 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/gzip.c +641 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/prog_util.c +473 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/prog_util.h +158 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_checksums.c +186 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_incomplete_codes.c +385 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_slow_decompression.c +472 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_util.c +245 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_util.h +68 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/tgetopt.c +118 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/Makefile +12 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/deflate_compress/fuzz.c +40 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/deflate_compress/inputs/0 +0 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/deflate_decompress/fuzz.c +28 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/deflate_decompress/inputs/0 +5 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/gzip_decompress/fuzz.c +28 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/gzip_decompress/inputs/0 +0 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/prepare_for_fuzz.sh +14 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/zlib_decompress/fuzz.c +28 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/zlib_decompress/inputs/0 +5 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/android_build.sh +115 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/checksum_benchmarks.sh +162 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/exec_tests.sh +32 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/gen_crc32_multipliers.c +108 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/gen_crc32_table.c +100 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/gzip_tests.sh +438 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/make-windows-releases +22 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/mips_build.sh +9 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/msc_test.bat +3 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/pgo_build.sh +23 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/produce_gzip_benchmark_table.sh +37 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/run_tests.sh +376 -0
- pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/windows_build.sh +10 -0
- pyfastk-0.1.0/FASTK/LICENSE +34 -0
- pyfastk-0.1.0/FASTK/LSDsort.c +271 -0
- pyfastk-0.1.0/FASTK/Logex.c +1580 -0
- pyfastk-0.1.0/FASTK/MSDsort.c +544 -0
- pyfastk-0.1.0/FASTK/Makefile +88 -0
- pyfastk-0.1.0/FASTK/ONElib.c +4194 -0
- pyfastk-0.1.0/FASTK/ONElib.h +464 -0
- pyfastk-0.1.0/FASTK/Profex.c +240 -0
- pyfastk-0.1.0/FASTK/README.md +1069 -0
- pyfastk-0.1.0/FASTK/Symmex.c +544 -0
- pyfastk-0.1.0/FASTK/Tabex.c +408 -0
- pyfastk-0.1.0/FASTK/Vennex.c +352 -0
- pyfastk-0.1.0/FASTK/count.c +1914 -0
- pyfastk-0.1.0/FASTK/gene_core.c +409 -0
- pyfastk-0.1.0/FASTK/gene_core.h +127 -0
- pyfastk-0.1.0/FASTK/io.c +2719 -0
- pyfastk-0.1.0/FASTK/libfastk.c +1805 -0
- pyfastk-0.1.0/FASTK/libfastk.h +121 -0
- pyfastk-0.1.0/FASTK/merge.c +1006 -0
- pyfastk-0.1.0/FASTK/split.c +2131 -0
- pyfastk-0.1.0/FASTK/table.c +533 -0
- pyfastk-0.1.0/MANIFEST.in +3 -0
- pyfastk-0.1.0/PKG-INFO +58 -0
- pyfastk-0.1.0/README.md +49 -0
- pyfastk-0.1.0/pyproject.toml +42 -0
- pyfastk-0.1.0/setup.cfg +4 -0
- pyfastk-0.1.0/setup.py +57 -0
- pyfastk-0.1.0/src/pyfastk/__init__.py +4 -0
- pyfastk-0.1.0/src/pyfastk/_fastk.c +34474 -0
- pyfastk-0.1.0/src/pyfastk/_fastk.pyx +625 -0
- pyfastk-0.1.0/src/pyfastk/_logex.py +111 -0
- pyfastk-0.1.0/src/pyfastk/py.typed +0 -0
- pyfastk-0.1.0/src/pyfastk.egg-info/PKG-INFO +58 -0
- pyfastk-0.1.0/src/pyfastk.egg-info/SOURCES.txt +438 -0
- pyfastk-0.1.0/src/pyfastk.egg-info/dependency_links.txt +1 -0
- pyfastk-0.1.0/src/pyfastk.egg-info/requires.txt +1 -0
- pyfastk-0.1.0/src/pyfastk.egg-info/top_level.txt +1 -0
- pyfastk-0.1.0/tests/test_build.py +465 -0
- pyfastk-0.1.0/tests/test_construction.py +68 -0
- pyfastk-0.1.0/tests/test_delete.py +95 -0
- pyfastk-0.1.0/tests/test_histogram.py +150 -0
- pyfastk-0.1.0/tests/test_kmers.py +167 -0
- pyfastk-0.1.0/tests/test_logex.py +253 -0
- pyfastk-0.1.0/tests/test_lookup.py +158 -0
- pyfastk-0.1.0/tests/test_profile.py +76 -0
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
/********************************************************************************************
|
|
2
|
+
*
|
|
3
|
+
* FastK: a rapid disk-based k-mer counter for high-fidelity shotgun data sets.
|
|
4
|
+
* Uses a novel minimizer-based distribution scheme that permits problems of
|
|
5
|
+
* arbitrary size, and a two-staged "super-mer then weighted k-mer" sort to acheive
|
|
6
|
+
* greater speed when error rates are low (1% or less). Directly produces sequence
|
|
7
|
+
* profiles.
|
|
8
|
+
*
|
|
9
|
+
* Author: Gene Myers
|
|
10
|
+
* Date : October, 2020
|
|
11
|
+
*
|
|
12
|
+
*********************************************************************************************/
|
|
13
|
+
|
|
14
|
+
#include <stdio.h>
|
|
15
|
+
#include <stdlib.h>
|
|
16
|
+
#include <string.h>
|
|
17
|
+
#include <ctype.h>
|
|
18
|
+
#include <unistd.h>
|
|
19
|
+
#include <fcntl.h>
|
|
20
|
+
#include <dirent.h>
|
|
21
|
+
#include <sys/resource.h>
|
|
22
|
+
#include <math.h>
|
|
23
|
+
#include <time.h>
|
|
24
|
+
|
|
25
|
+
#include "libfastk.h"
|
|
26
|
+
#include "FastK.h"
|
|
27
|
+
|
|
28
|
+
#ifdef DEVELOPER
|
|
29
|
+
|
|
30
|
+
int DO_STAGE; // Which step to perform
|
|
31
|
+
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
static char *Usage[] = { "[-k<int(40)>] [-t[<int(1)>]] [-p[:<table>[.ktab]]] [-c] [-bc<int>]",
|
|
35
|
+
"[-v] [-N<path_name>] [-P<dir($TMPDIR)>] [-M<int(12)>] [-T<int(4)>]",
|
|
36
|
+
" <source>[.cram|.[bs]am|.db|.dam|.f[ast][aq][.gz] ..."
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Option Settings
|
|
40
|
+
|
|
41
|
+
int VERBOSE; // show progress
|
|
42
|
+
int NTHREADS; // # of threads to run with
|
|
43
|
+
int ITHREADS; // # of threads possible for input
|
|
44
|
+
int64 SORT_MEMORY; // GB of memory for downstream KMcount sorts
|
|
45
|
+
char *SORT_PATH; // where to put external files
|
|
46
|
+
|
|
47
|
+
int KMER; // desired K-mer length
|
|
48
|
+
int DO_TABLE; // Zero or table cutoff
|
|
49
|
+
int DO_PROFILE; // Do or not
|
|
50
|
+
Kmer_Stream *PRO_TABLE; // Kmer stream of profile option (only if relative profile)
|
|
51
|
+
char *PRO_NAME; // Name of profile table
|
|
52
|
+
int BC_PREFIX; // Ignore prefix of each sequence of this length
|
|
53
|
+
char *OUT_NAME; // Prefix root for all output file names
|
|
54
|
+
int COMPRESS; // Homopoloymer compress input
|
|
55
|
+
|
|
56
|
+
// Major parameters, sizes of things
|
|
57
|
+
|
|
58
|
+
int NPARTS; // # of k-mer buckets to use
|
|
59
|
+
int SMER; // size of a super-mer for sorts
|
|
60
|
+
int64 KMAX; // max k-mers in any part
|
|
61
|
+
int64 NMAX; // max super-mers in any part
|
|
62
|
+
int64 RMAX; // max run index for any thread
|
|
63
|
+
|
|
64
|
+
int MOD_LEN; // length of minimizer buffer (power of 2)
|
|
65
|
+
int MOD_MSK; // mask for minimzer buffer
|
|
66
|
+
|
|
67
|
+
int MAX_SUPER; // = (KMER - PAD_LEN) + 1
|
|
68
|
+
|
|
69
|
+
int SLEN_BITS; // # of bits needed to encode the length of a super-mer (less KMER-1)
|
|
70
|
+
uint64 SLEN_BIT_MASK; // Bit-mask for super-mer lengths
|
|
71
|
+
|
|
72
|
+
int RUN_BITS; // # of bits encoding largest run index
|
|
73
|
+
int RUN_BYTES; // # of bytes encoding largest run index
|
|
74
|
+
|
|
75
|
+
int SLEN_BYTES; // # of bytes encoding length of a super-mer
|
|
76
|
+
int PLEN_BYTES; // # of bytes encoding length of a compressed profile segment
|
|
77
|
+
int PROF_BYTES; // # of bytes encoding RUN_BYTES+PLEN_BYTES
|
|
78
|
+
int IDX_BYTES; // # of bytes for table prefix index
|
|
79
|
+
|
|
80
|
+
int SLEN_BYTE_MASK; // Byte-mask for super-mer lengths
|
|
81
|
+
|
|
82
|
+
int KMER_BYTES; // # of bytes encoding a KMER
|
|
83
|
+
int SMER_BYTES; // # of bytes encoding a super-mer
|
|
84
|
+
int KMAX_BYTES; // # of bytes to encode an int in [0,KMAX)
|
|
85
|
+
|
|
86
|
+
int KMER_WORD; // bytes to hold a k-mer entry
|
|
87
|
+
int SMER_WORD; // bytes to hold a super-mer entry
|
|
88
|
+
int TMER_WORD; // bytes to hold a k-mer table entry
|
|
89
|
+
int CMER_WORD; // bytes to hold a count/index entry
|
|
90
|
+
|
|
91
|
+
static struct rusage Itime;
|
|
92
|
+
static struct timespec Iwall;
|
|
93
|
+
|
|
94
|
+
static struct rusage Mtime;
|
|
95
|
+
static struct timespec Mwall;
|
|
96
|
+
|
|
97
|
+
static void startTime()
|
|
98
|
+
{ getrusage(RUSAGE_SELF,&Itime);
|
|
99
|
+
clock_gettime(CLOCK_MONOTONIC,&Iwall);
|
|
100
|
+
Mtime = Itime;
|
|
101
|
+
Mwall = Iwall;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
void timeTo(FILE *f, int all)
|
|
105
|
+
{ struct rusage now;
|
|
106
|
+
struct timespec today;
|
|
107
|
+
struct rusage *t;
|
|
108
|
+
struct timespec *w;
|
|
109
|
+
int usecs, umics;
|
|
110
|
+
int ssecs, smics;
|
|
111
|
+
int tsecs, tmics;
|
|
112
|
+
int64 mem;
|
|
113
|
+
|
|
114
|
+
getrusage(RUSAGE_SELF, &now);
|
|
115
|
+
clock_gettime(CLOCK_MONOTONIC,&today);
|
|
116
|
+
|
|
117
|
+
if (all)
|
|
118
|
+
{ t = &Itime;
|
|
119
|
+
w = &Iwall;
|
|
120
|
+
fprintf (f,"\nTotal Resources:");
|
|
121
|
+
}
|
|
122
|
+
else
|
|
123
|
+
{ t = &Mtime;
|
|
124
|
+
w = &Mwall;
|
|
125
|
+
fprintf (f,"\n Resources for phase:");
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
usecs = now.ru_utime.tv_sec - t->ru_utime.tv_sec;
|
|
130
|
+
umics = now.ru_utime.tv_usec - t->ru_utime.tv_usec;
|
|
131
|
+
if (umics < 0)
|
|
132
|
+
{ umics += 1000000;
|
|
133
|
+
usecs -= 1;
|
|
134
|
+
}
|
|
135
|
+
if (usecs >= 60)
|
|
136
|
+
fprintf (f," %d:%02d.%03du",usecs/60,usecs%60,umics/1000);
|
|
137
|
+
else
|
|
138
|
+
fprintf (f," %d.%03du",usecs,umics/1000);
|
|
139
|
+
|
|
140
|
+
ssecs = now.ru_stime.tv_sec - t->ru_stime.tv_sec;
|
|
141
|
+
smics = now.ru_stime.tv_usec - t->ru_stime.tv_usec;
|
|
142
|
+
if (smics < 0)
|
|
143
|
+
{ smics += 1000000;
|
|
144
|
+
ssecs -= 1;
|
|
145
|
+
}
|
|
146
|
+
if (ssecs >= 60)
|
|
147
|
+
fprintf (f," %d:%02d.%03ds",ssecs/60,ssecs%60,smics/1000);
|
|
148
|
+
else
|
|
149
|
+
fprintf (f," %d.%03ds",ssecs,smics/1000);
|
|
150
|
+
|
|
151
|
+
tsecs = today.tv_sec - w->tv_sec;
|
|
152
|
+
tmics = today.tv_nsec/1000 - w->tv_nsec/1000;
|
|
153
|
+
if (tmics < 0)
|
|
154
|
+
{ tmics += 1000000;
|
|
155
|
+
tsecs -= 1;
|
|
156
|
+
}
|
|
157
|
+
if (tsecs >= 60)
|
|
158
|
+
fprintf (f," %d:%02d.%03dw",tsecs/60,tsecs%60,tmics/1000);
|
|
159
|
+
else
|
|
160
|
+
fprintf (f," %d.%03dw",tsecs,tmics/1000);
|
|
161
|
+
|
|
162
|
+
fprintf(f," %.1f%%",(100.*(usecs+ssecs) + (umics+smics)/10000.)/(tsecs+tmics/1000000.));
|
|
163
|
+
|
|
164
|
+
if (all)
|
|
165
|
+
{ mem = now.ru_maxrss/1000000;
|
|
166
|
+
fprintf(f," ");
|
|
167
|
+
Print_Number(mem,0,f);
|
|
168
|
+
fprintf(f,"MB");
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
fprintf(f,"\n");
|
|
172
|
+
|
|
173
|
+
Mtime = now;
|
|
174
|
+
Mwall = today;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
static char *PATH;
|
|
178
|
+
static char *ROOT;
|
|
179
|
+
static Input_Partition *IOPACK;
|
|
180
|
+
|
|
181
|
+
void Clean_Exit(int status)
|
|
182
|
+
{ char *command;
|
|
183
|
+
|
|
184
|
+
fprintf(stderr,"\n*** Error Exit %d ***\n",status);
|
|
185
|
+
|
|
186
|
+
if (ROOT != NULL)
|
|
187
|
+
{ command = Malloc(3*strlen(ROOT) + 3*strlen(PATH) + strlen(SORT_PATH) + 500,"Command string");
|
|
188
|
+
if (command == NULL)
|
|
189
|
+
goto could_not;
|
|
190
|
+
|
|
191
|
+
sprintf(command,"rm -f %s/%s.hist %s/%s.ktab %s/%s.prof",PATH,ROOT,PATH,ROOT,PATH,ROOT);
|
|
192
|
+
if (system(command) != 0)
|
|
193
|
+
goto could_not;
|
|
194
|
+
|
|
195
|
+
sprintf(command,"rm -f %s/.%s.ktab.* %s/.%s.pidx.* %s/.%s.prof.*",
|
|
196
|
+
PATH,ROOT,PATH,ROOT,PATH,ROOT);
|
|
197
|
+
system(command);
|
|
198
|
+
if (system(command) != 0)
|
|
199
|
+
goto could_not;
|
|
200
|
+
|
|
201
|
+
sprintf(command,"rm -f %s/%s.*.[TLP]*",SORT_PATH,ROOT);
|
|
202
|
+
system(command);
|
|
203
|
+
if (system(command) != 0)
|
|
204
|
+
goto could_not;
|
|
205
|
+
|
|
206
|
+
sprintf(command,"Fastrm -f %s/%s.U*.ktab",SORT_PATH,ROOT);
|
|
207
|
+
system(command);
|
|
208
|
+
if (system(command) != 0)
|
|
209
|
+
goto could_not;
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (IOPACK != NULL)
|
|
214
|
+
Free_Input_Partition(IOPACK);
|
|
215
|
+
|
|
216
|
+
exit (status);
|
|
217
|
+
|
|
218
|
+
could_not:
|
|
219
|
+
fprintf(stderr,"\n Could not clean up !\n");
|
|
220
|
+
exit (1);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
int main(int argc, char *argv[])
|
|
224
|
+
{
|
|
225
|
+
startTime();
|
|
226
|
+
|
|
227
|
+
{ int i, j, k;
|
|
228
|
+
int flags[128];
|
|
229
|
+
int memory;
|
|
230
|
+
char *eptr;
|
|
231
|
+
|
|
232
|
+
ARG_INIT("FastK")
|
|
233
|
+
|
|
234
|
+
KMER = 40;
|
|
235
|
+
SORT_MEMORY = 12000000000ll;
|
|
236
|
+
NTHREADS = 4;
|
|
237
|
+
SORT_PATH = getenv("TMPDIR");
|
|
238
|
+
if (SORT_PATH == NULL)
|
|
239
|
+
SORT_PATH = "/tmp";
|
|
240
|
+
DO_TABLE = 0;
|
|
241
|
+
DO_PROFILE = 0;
|
|
242
|
+
PRO_TABLE = NULL;
|
|
243
|
+
PRO_NAME = NULL;
|
|
244
|
+
BC_PREFIX = 0;
|
|
245
|
+
OUT_NAME = NULL;
|
|
246
|
+
#ifdef DEVELOPER
|
|
247
|
+
DO_STAGE = 0;
|
|
248
|
+
#endif
|
|
249
|
+
|
|
250
|
+
j = 1;
|
|
251
|
+
for (i = 1; i < argc; i++)
|
|
252
|
+
if (argv[i][0] == '-')
|
|
253
|
+
switch (argv[i][1])
|
|
254
|
+
{ default:
|
|
255
|
+
ARG_FLAGS("vcpt")
|
|
256
|
+
break;
|
|
257
|
+
case 'b':
|
|
258
|
+
if (argv[i][2] != 'c')
|
|
259
|
+
{ fprintf(stderr,"\n%s: -%s is not a legal optional argument\n",Prog_Name,argv[i]);
|
|
260
|
+
Clean_Exit(1);
|
|
261
|
+
}
|
|
262
|
+
argv[i] += 1;
|
|
263
|
+
ARG_NON_NEGATIVE(BC_PREFIX,"Bar code prefiex")
|
|
264
|
+
argv[i] -= 1;
|
|
265
|
+
break;
|
|
266
|
+
case 'k':
|
|
267
|
+
ARG_POSITIVE(KMER,"K-mer length")
|
|
268
|
+
break;
|
|
269
|
+
case 'p':
|
|
270
|
+
if (argv[i][2] != ':')
|
|
271
|
+
{ ARG_FLAGS("vcpt");
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
PRO_NAME = argv[i]+3;
|
|
275
|
+
PRO_TABLE = Open_Kmer_Stream(PRO_NAME);
|
|
276
|
+
if (PRO_TABLE == NULL)
|
|
277
|
+
{ fprintf(stderr,"%s: Cannot open FastK table %s\n",Prog_Name,PRO_NAME);
|
|
278
|
+
exit (1);
|
|
279
|
+
}
|
|
280
|
+
DO_PROFILE = 1;
|
|
281
|
+
break;
|
|
282
|
+
case 't':
|
|
283
|
+
if (argv[i][2] == '\0' || isalpha(argv[i][2]))
|
|
284
|
+
{ ARG_FLAGS("vcpt");
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
ARG_POSITIVE(DO_TABLE,"Cutoff for k-mer table")
|
|
288
|
+
break;
|
|
289
|
+
case 'M':
|
|
290
|
+
ARG_POSITIVE(memory,"GB of memory for sorting step")
|
|
291
|
+
SORT_MEMORY = memory * 1000000000ll;
|
|
292
|
+
break;
|
|
293
|
+
case 'N':
|
|
294
|
+
OUT_NAME = argv[i]+2;
|
|
295
|
+
break;
|
|
296
|
+
case 'P':
|
|
297
|
+
SORT_PATH = argv[i]+2;
|
|
298
|
+
break;
|
|
299
|
+
case 'T':
|
|
300
|
+
ARG_POSITIVE(NTHREADS,"Number of threads")
|
|
301
|
+
break;
|
|
302
|
+
#ifdef DEVELOPER
|
|
303
|
+
case '1':
|
|
304
|
+
DO_STAGE = 1;
|
|
305
|
+
break;
|
|
306
|
+
case '2':
|
|
307
|
+
DO_STAGE = 2;
|
|
308
|
+
break;
|
|
309
|
+
case '3':
|
|
310
|
+
DO_STAGE = 3;
|
|
311
|
+
break;
|
|
312
|
+
case '4':
|
|
313
|
+
DO_STAGE = 4;
|
|
314
|
+
break;
|
|
315
|
+
#endif
|
|
316
|
+
}
|
|
317
|
+
else
|
|
318
|
+
argv[j++] = argv[i];
|
|
319
|
+
argc = j;
|
|
320
|
+
|
|
321
|
+
VERBOSE = flags['v']; // Globally declared in filter.h
|
|
322
|
+
COMPRESS = flags['c'];
|
|
323
|
+
if (flags['t'])
|
|
324
|
+
DO_TABLE = 1;
|
|
325
|
+
if (flags['p'])
|
|
326
|
+
DO_PROFILE = 1;
|
|
327
|
+
|
|
328
|
+
if (PRO_TABLE != NULL)
|
|
329
|
+
{ if (PRO_TABLE->kmer != KMER)
|
|
330
|
+
{ fprintf(stderr,"%s: -p table k-mer size (%d) != k-mer specified (%d)\n",
|
|
331
|
+
Prog_Name,PRO_TABLE->kmer,KMER);
|
|
332
|
+
exit (1);
|
|
333
|
+
}
|
|
334
|
+
if (DO_TABLE && VERBOSE)
|
|
335
|
+
fprintf(stderr,"%s: Warning: -p:%s overides -t option\n",Prog_Name,PRO_NAME);
|
|
336
|
+
DO_TABLE = 0;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (argc < 2)
|
|
340
|
+
{ fprintf(stderr,"\nUsage: %s %s\n",Prog_Name,Usage[0]);
|
|
341
|
+
fprintf(stderr," %*s %s\n",(int) strlen(Prog_Name),"",Usage[1]);
|
|
342
|
+
fprintf(stderr," %*s %s\n",(int) strlen(Prog_Name),"",Usage[2]);
|
|
343
|
+
fprintf(stderr,"\n");
|
|
344
|
+
fprintf(stderr," -v: Verbose mode, output statistics as proceed.\n");
|
|
345
|
+
fprintf(stderr," -T: Use -T threads.\n");
|
|
346
|
+
fprintf(stderr," -N: Use given path for output directory and root name prefix.\n");
|
|
347
|
+
fprintf(stderr," -P: Place block level sorts in directory -P.\n");
|
|
348
|
+
fprintf(stderr," -M: Use -M GB of memory in downstream sorting steps of KMcount.\n");
|
|
349
|
+
fprintf(stderr,"\n");
|
|
350
|
+
fprintf(stderr," -k: k-mer size.\n");
|
|
351
|
+
fprintf(stderr," -t: Produce table of sorted k-mers & counts >= level specified\n");
|
|
352
|
+
fprintf(stderr," -p: Produce sequence count profiles (w.r.t. table if given)\n");
|
|
353
|
+
fprintf(stderr," -bc: Ignore prefix of each read of given length (e.g. bar code)\n");
|
|
354
|
+
fprintf(stderr," -c: Homopolymer compress every sequence\n");
|
|
355
|
+
exit (1);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Get full path strong for sorting subdirectory (in variable SORT_PATH)
|
|
360
|
+
|
|
361
|
+
{ char *cpath, *spath;
|
|
362
|
+
DIR *dirp;
|
|
363
|
+
|
|
364
|
+
if (SORT_PATH[0] != '/')
|
|
365
|
+
{ cpath = getcwd(NULL,0);
|
|
366
|
+
if (SORT_PATH[0] == '.')
|
|
367
|
+
{ if (SORT_PATH[1] == '/')
|
|
368
|
+
spath = Catenate(cpath,SORT_PATH+2,"","");
|
|
369
|
+
else if (SORT_PATH[1] == '\0')
|
|
370
|
+
spath = cpath;
|
|
371
|
+
else
|
|
372
|
+
{ fprintf(stderr,"\n%s: -P option: . not followed by /\n",Prog_Name);
|
|
373
|
+
exit (1);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
else
|
|
377
|
+
spath = Catenate(cpath,"/",SORT_PATH,"");
|
|
378
|
+
SORT_PATH = Strdup(spath,"Allocating path");
|
|
379
|
+
free(cpath);
|
|
380
|
+
}
|
|
381
|
+
else
|
|
382
|
+
SORT_PATH = Strdup(SORT_PATH,"Allocating path");
|
|
383
|
+
|
|
384
|
+
if ((dirp = opendir(SORT_PATH)) == NULL)
|
|
385
|
+
{ fprintf(stderr,"\n%s: -P option: cannot open directory %s\n",Prog_Name,SORT_PATH);
|
|
386
|
+
exit (1);
|
|
387
|
+
}
|
|
388
|
+
closedir(dirp);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
{ Input_Partition *io;
|
|
392
|
+
DATA_BLOCK *block;
|
|
393
|
+
int64 gsize;
|
|
394
|
+
int rsize, val;
|
|
395
|
+
|
|
396
|
+
ROOT = PATH = NULL;
|
|
397
|
+
IOPACK = NULL;
|
|
398
|
+
|
|
399
|
+
io = Partition_Input(argc,argv);
|
|
400
|
+
|
|
401
|
+
IOPACK = io;
|
|
402
|
+
if (OUT_NAME == NULL)
|
|
403
|
+
{ ROOT = First_Root(io);
|
|
404
|
+
PATH = First_Pwd (io);
|
|
405
|
+
}
|
|
406
|
+
else
|
|
407
|
+
{ ROOT = Root(OUT_NAME,"");
|
|
408
|
+
PATH = PathTo(OUT_NAME);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
if (VERBOSE)
|
|
412
|
+
fprintf(stderr,"\nDetermining minimizer scheme & partition for %s\n",ROOT);
|
|
413
|
+
|
|
414
|
+
// Determine number of buckets and padded minimzer scheme based on first
|
|
415
|
+
// block of the data set
|
|
416
|
+
|
|
417
|
+
block = Get_First_Block(io,1000000000);
|
|
418
|
+
|
|
419
|
+
KMER_BYTES = (KMER*2+7) >> 3;
|
|
420
|
+
|
|
421
|
+
rsize = KMER_BYTES + 2;
|
|
422
|
+
gsize = block->totlen - KMER*block->nreads;
|
|
423
|
+
if (gsize < block->totlen/3)
|
|
424
|
+
{ fprintf(stderr,
|
|
425
|
+
"\n%s: Warming Sequences are on average smaller than 1.5x k-mer size!\n",
|
|
426
|
+
Prog_Name);
|
|
427
|
+
}
|
|
428
|
+
gsize = gsize*block->ratio*rsize;
|
|
429
|
+
NPARTS = (gsize-1)/SORT_MEMORY + 1;
|
|
430
|
+
|
|
431
|
+
if (VERBOSE)
|
|
432
|
+
{ double est = gsize/(1.*rsize);
|
|
433
|
+
if (est >= 5.e8)
|
|
434
|
+
fprintf(stderr," Estimate %.3fG",est/1.e9);
|
|
435
|
+
else if (est >= 5.e5)
|
|
436
|
+
fprintf(stderr," Estimate %.3fM",est/1.e6);
|
|
437
|
+
else
|
|
438
|
+
fprintf(stderr," Estimate %.3fK",est/1.e3);
|
|
439
|
+
fprintf(stderr," %d-%smers\n",KMER,COMPRESS?"hoco-":"");
|
|
440
|
+
if (NPARTS > 1)
|
|
441
|
+
fprintf(stderr," Dividing data into %d blocks\n",NPARTS);
|
|
442
|
+
else
|
|
443
|
+
fprintf(stderr," Handling data in a single block\n");
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
MOD_LEN = 1;
|
|
447
|
+
while (MOD_LEN < KMER)
|
|
448
|
+
MOD_LEN <<= 1;
|
|
449
|
+
MOD_LEN <<= 1;
|
|
450
|
+
MOD_MSK = MOD_LEN-1;
|
|
451
|
+
|
|
452
|
+
MAX_SUPER = Determine_Scheme(block);
|
|
453
|
+
|
|
454
|
+
Free_First_Block(block);
|
|
455
|
+
|
|
456
|
+
SMER = MAX_SUPER + KMER - 1;
|
|
457
|
+
|
|
458
|
+
SLEN_BITS = 0;
|
|
459
|
+
for (val = MAX_SUPER; val > 0; val >>= 1)
|
|
460
|
+
SLEN_BITS += 1;
|
|
461
|
+
SLEN_BIT_MASK = (0x1u << SLEN_BITS)-1;
|
|
462
|
+
SLEN_BYTES = (SLEN_BITS+7) >> 3;
|
|
463
|
+
|
|
464
|
+
SMER_BYTES = (SMER*2+7) >> 3;
|
|
465
|
+
SMER_WORD = SMER_BYTES + SLEN_BYTES;
|
|
466
|
+
KMER_WORD = KMER_BYTES + 2;
|
|
467
|
+
PLEN_BYTES = (SLEN_BITS+8) >> 3;
|
|
468
|
+
TMER_WORD = KMER_BYTES + 2;
|
|
469
|
+
|
|
470
|
+
// Make sure you can open (NPARTS + 2) * NTHREADS + tid files and then set up data structures
|
|
471
|
+
// for each such file. tid is typically 3 unless using valgrind or other instrumentation.
|
|
472
|
+
|
|
473
|
+
{ struct rlimit rlp;
|
|
474
|
+
int tid;
|
|
475
|
+
uint64 nfiles;
|
|
476
|
+
|
|
477
|
+
tid = open(".xxx",O_CREAT|O_TRUNC|O_WRONLY,S_IRWXU);
|
|
478
|
+
close(tid);
|
|
479
|
+
unlink(".xxx");
|
|
480
|
+
|
|
481
|
+
nfiles = (NPARTS+3)*NTHREADS + tid;
|
|
482
|
+
getrlimit(RLIMIT_NOFILE,&rlp);
|
|
483
|
+
if (nfiles > rlp.rlim_max)
|
|
484
|
+
{ fprintf(stderr,"\n%s: Cannot open %lld files simultaneously\n",Prog_Name,nfiles);
|
|
485
|
+
Clean_Exit(1);
|
|
486
|
+
}
|
|
487
|
+
rlp.rlim_cur = nfiles;
|
|
488
|
+
setrlimit(RLIMIT_NOFILE,&rlp);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
#ifdef DEVELOPER
|
|
492
|
+
if (DO_STAGE == 1)
|
|
493
|
+
{ Split_Kmers(io,ROOT);
|
|
494
|
+
if (PRO_TABLE != NULL)
|
|
495
|
+
Split_Table(ROOT);
|
|
496
|
+
}
|
|
497
|
+
#else
|
|
498
|
+
Split_Kmers(io,ROOT);
|
|
499
|
+
if (VERBOSE)
|
|
500
|
+
timeTo(stderr,0);
|
|
501
|
+
if (PRO_TABLE != NULL)
|
|
502
|
+
{ Split_Table(ROOT);
|
|
503
|
+
if (VERBOSE)
|
|
504
|
+
timeTo(stderr,0);
|
|
505
|
+
}
|
|
506
|
+
#endif
|
|
507
|
+
|
|
508
|
+
Free_Input_Partition(io);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
#ifdef DEVELOPER
|
|
512
|
+
if (DO_STAGE == 2)
|
|
513
|
+
Sorting(PATH,ROOT);
|
|
514
|
+
#else
|
|
515
|
+
Sorting(PATH,ROOT);
|
|
516
|
+
if (VERBOSE)
|
|
517
|
+
timeTo(stderr,0);
|
|
518
|
+
#endif
|
|
519
|
+
|
|
520
|
+
if (DO_TABLE > 0)
|
|
521
|
+
#ifdef DEVELOPER
|
|
522
|
+
if (DO_STAGE == 3)
|
|
523
|
+
Merge_Tables(PATH,ROOT);
|
|
524
|
+
#else
|
|
525
|
+
{ Merge_Tables(PATH,ROOT);
|
|
526
|
+
if (VERBOSE)
|
|
527
|
+
timeTo(stderr,0);
|
|
528
|
+
}
|
|
529
|
+
#endif
|
|
530
|
+
|
|
531
|
+
if (DO_PROFILE > 0)
|
|
532
|
+
#ifdef DEVELOPER
|
|
533
|
+
if (DO_STAGE == 4)
|
|
534
|
+
Merge_Profiles(PATH,ROOT);
|
|
535
|
+
#else
|
|
536
|
+
{ Merge_Profiles(PATH,ROOT);
|
|
537
|
+
if (VERBOSE)
|
|
538
|
+
timeTo(stderr,0);
|
|
539
|
+
}
|
|
540
|
+
#endif
|
|
541
|
+
|
|
542
|
+
#ifndef DEVELOPER
|
|
543
|
+
free(NUM_RID);
|
|
544
|
+
#endif
|
|
545
|
+
|
|
546
|
+
free(PATH);
|
|
547
|
+
free(ROOT);
|
|
548
|
+
free(SORT_PATH);
|
|
549
|
+
|
|
550
|
+
if (PRO_TABLE != NULL)
|
|
551
|
+
Free_Kmer_Stream(PRO_TABLE);
|
|
552
|
+
|
|
553
|
+
Catenate(NULL,NULL,NULL,NULL); // frees internal buffers of these routines
|
|
554
|
+
Numbered_Suffix(NULL,0,NULL);
|
|
555
|
+
free(Prog_Name);
|
|
556
|
+
|
|
557
|
+
if (VERBOSE)
|
|
558
|
+
timeTo(stderr,1);
|
|
559
|
+
|
|
560
|
+
exit (0);
|
|
561
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/********************************************************************************************
|
|
2
|
+
*
|
|
3
|
+
* FastK: a rapid disk-based k-mer counter for high-fidelity shotgun data sets.
|
|
4
|
+
* Uses a novel minimizer-based distribution scheme that permits problems of
|
|
5
|
+
* arbitrary size, and a two-staged "super-mer then weighted k-mer" sort to acheive
|
|
6
|
+
* greater speed when error rates are low (1% or less). Directly produces read
|
|
7
|
+
* profiles.
|
|
8
|
+
*
|
|
9
|
+
* Author: Gene Myers
|
|
10
|
+
* Date : October, 2020
|
|
11
|
+
*
|
|
12
|
+
*********************************************************************************************/
|
|
13
|
+
|
|
14
|
+
#ifndef _KMERS
|
|
15
|
+
#define _KMERS
|
|
16
|
+
|
|
17
|
+
#undef DEVELOPER
|
|
18
|
+
|
|
19
|
+
#define IO_BUF_LEN 4096 // number of uint's in bit stuffed IO buffer for each part+thread
|
|
20
|
+
#define IO_UBITS 64
|
|
21
|
+
#define IO_UBYTES 8
|
|
22
|
+
#define IO_UTYPE uint64
|
|
23
|
+
|
|
24
|
+
#define NPANELS 4
|
|
25
|
+
|
|
26
|
+
#ifdef DEVELOPER
|
|
27
|
+
|
|
28
|
+
extern int DO_STAGE; // Stage to run if code development (not for users)
|
|
29
|
+
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
// Option Settings
|
|
33
|
+
|
|
34
|
+
extern int VERBOSE; // show progress
|
|
35
|
+
extern int64 SORT_MEMORY; // Memory available for each k-mer sort
|
|
36
|
+
extern int KMER; // desired K-mer length
|
|
37
|
+
extern int NTHREADS; // # of threads to run with
|
|
38
|
+
extern int ITHREADS; // # of threads possible for input
|
|
39
|
+
extern char *SORT_PATH; // where to put external files
|
|
40
|
+
|
|
41
|
+
extern int DO_TABLE; // Zero or table cutoff
|
|
42
|
+
extern int DO_PROFILE; // Do or not
|
|
43
|
+
extern Kmer_Stream *PRO_TABLE; // Kmer stream of profile option (only if relative profile)
|
|
44
|
+
extern char *PRO_NAME; // Name of profile table
|
|
45
|
+
extern int BC_PREFIX; // Ignore prefix of each read of this length
|
|
46
|
+
extern int COMPRESS; // Homopolymer compress the input
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
// Sizes and numbers of items (k-mers, super-mers, reads, positions)
|
|
50
|
+
|
|
51
|
+
extern int NPARTS; // number of k-mer buckets
|
|
52
|
+
extern int SMER; // max size of a super-mer (= MAX_SUPER + KMER - 1)ZZ
|
|
53
|
+
extern int64 KMAX; // max k-mers in any part
|
|
54
|
+
extern int64 NMAX; // max super-mers in any part
|
|
55
|
+
|
|
56
|
+
extern int MOD_LEN; // length of minimizer buffer (power of 2)
|
|
57
|
+
extern int MOD_MSK; // mask for minimzer buffer
|
|
58
|
+
|
|
59
|
+
extern int MAX_SUPER; // = (KMER - PAD_LEN) + 1
|
|
60
|
+
|
|
61
|
+
extern int SLEN_BITS; // # of bits needed to encode the length of a super-mer (less KMER-1)
|
|
62
|
+
extern uint64 SLEN_BIT_MASK; // Bit-mask for super-mer lengths
|
|
63
|
+
|
|
64
|
+
extern int RUN_BITS; // # of bits encoding largest run index
|
|
65
|
+
extern int RUN_BYTES; // # of bytes encoding largest run index
|
|
66
|
+
|
|
67
|
+
extern int SLEN_BYTES; // # of bytes encoding Length of a super-mer
|
|
68
|
+
extern int PLEN_BYTES; // # of bytes encoding length of a compressed profile segment
|
|
69
|
+
extern int PROF_BYTES; // # of bytes encoding RUN+PLEN_BYTES
|
|
70
|
+
extern int IDX_BYTES; // # of bytes for table prefix index
|
|
71
|
+
|
|
72
|
+
extern int KMER_BYTES; // # of bytes encoding a KMER
|
|
73
|
+
extern int SMER_BYTES; // # of bytes encoding a super-mer
|
|
74
|
+
extern int KMAX_BYTES; // # of bytes to encode an int in [0,KMAX)
|
|
75
|
+
|
|
76
|
+
extern int KMER_WORD; // # of bytes in a k-mer entry
|
|
77
|
+
extern int SMER_WORD; // # of bytes in a super-mer entry
|
|
78
|
+
extern int TMER_WORD; // bytes to hold a k-mer/count table entry
|
|
79
|
+
extern int CMER_WORD; // bytes to hold a count/position entry
|
|
80
|
+
|
|
81
|
+
extern int64 *NUM_RID; // [i] for i in [0,ITHREADS) = # of super-mers per vertical stripe
|
|
82
|
+
|
|
83
|
+
extern uint8 Comp[256]; // complement of 4bp byte code
|
|
84
|
+
|
|
85
|
+
// IO Module Interface
|
|
86
|
+
|
|
87
|
+
typedef struct
|
|
88
|
+
{ int64 totlen; // total # of bases in data set
|
|
89
|
+
int nreads; // # of reads in data set
|
|
90
|
+
double ratio; // ratio of file size to portion read (first block only)
|
|
91
|
+
int64 maxbps; // size of bases array
|
|
92
|
+
int maxrds; // size of boff array
|
|
93
|
+
char *bases; // concatenation of 0-terminated read strings
|
|
94
|
+
int *boff; // read i is at bases+boff[i], boff[n] = total bytes
|
|
95
|
+
int rem; // Length of remainder of current sequence to process
|
|
96
|
+
char *next; // Remainder of current input sequence (overlaps by KMER-1) with last
|
|
97
|
+
// sequence in this block buffer now.
|
|
98
|
+
} DATA_BLOCK;
|
|
99
|
+
|
|
100
|
+
typedef void *Input_Partition;
|
|
101
|
+
|
|
102
|
+
Input_Partition *Partition_Input(int argc, char *argv[]);
|
|
103
|
+
|
|
104
|
+
DATA_BLOCK *Get_First_Block(Input_Partition *part, int64 numbps);
|
|
105
|
+
|
|
106
|
+
void Free_First_Block(DATA_BLOCK *block);
|
|
107
|
+
|
|
108
|
+
char *First_Root(Input_Partition *part);
|
|
109
|
+
char *First_Pwd (Input_Partition *part);
|
|
110
|
+
|
|
111
|
+
void Scan_All_Input(Input_Partition *part);
|
|
112
|
+
|
|
113
|
+
void Free_Input_Partition(Input_Partition *part);
|
|
114
|
+
|
|
115
|
+
// Stages
|
|
116
|
+
|
|
117
|
+
void Clean_Exit(int status);
|
|
118
|
+
|
|
119
|
+
int Determine_Scheme(DATA_BLOCK *block);
|
|
120
|
+
|
|
121
|
+
void Split_Kmers(Input_Partition *io, char *root);
|
|
122
|
+
|
|
123
|
+
void Distribute_Block(DATA_BLOCK *block, int tid);
|
|
124
|
+
|
|
125
|
+
void Split_Table(char *root);
|
|
126
|
+
|
|
127
|
+
void Sorting(char *path, char *root);
|
|
128
|
+
|
|
129
|
+
void Merge_Tables(char *path, char *root);
|
|
130
|
+
|
|
131
|
+
void Merge_Profiles(char *path, char *root);
|
|
132
|
+
|
|
133
|
+
// Sorts
|
|
134
|
+
|
|
135
|
+
typedef struct
|
|
136
|
+
{ int beg; // [beg,end) first byte with sorted data at off
|
|
137
|
+
int end;
|
|
138
|
+
int64 off;
|
|
139
|
+
int64 khist[256];
|
|
140
|
+
int64 count[0x8000];
|
|
141
|
+
int64 max_inst;
|
|
142
|
+
int byte1; // used internallly by sort
|
|
143
|
+
} Range;
|
|
144
|
+
|
|
145
|
+
void Supermer_Sort(uint8 *array, int64 nelem, int rsize, int ksize,
|
|
146
|
+
int64 *part, int nthreads, Range *panels);
|
|
147
|
+
|
|
148
|
+
void Weighted_Kmer_Sort(uint8 *array, int64 nelem, int rsize, int ksize,
|
|
149
|
+
int64 *part, int nthreads, Range *panels);
|
|
150
|
+
|
|
151
|
+
void MSD_Sort(uint8 *array, int64 nelem, int rsize, int ksize,
|
|
152
|
+
int64 *part, int nthreads, Range *panels);
|
|
153
|
+
|
|
154
|
+
void *LSD_Sort(int64 nelem, void *src, void *trg, int rsize, int *bytes);
|
|
155
|
+
|
|
156
|
+
#endif // _KMERS
|