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.
Files changed (440) hide show
  1. pyfastk-0.1.0/FASTK/FastK.c +561 -0
  2. pyfastk-0.1.0/FASTK/FastK.h +156 -0
  3. pyfastk-0.1.0/FASTK/Fastcat.c +631 -0
  4. pyfastk-0.1.0/FASTK/Fastmerge.c +1048 -0
  5. pyfastk-0.1.0/FASTK/Fastrm.c +167 -0
  6. pyfastk-0.1.0/FASTK/Fastxfer.c +243 -0
  7. pyfastk-0.1.0/FASTK/HTSLIB/INSTALL +244 -0
  8. pyfastk-0.1.0/FASTK/HTSLIB/LICENSE +69 -0
  9. pyfastk-0.1.0/FASTK/HTSLIB/Makefile +632 -0
  10. pyfastk-0.1.0/FASTK/HTSLIB/NEWS +949 -0
  11. pyfastk-0.1.0/FASTK/HTSLIB/README +5 -0
  12. pyfastk-0.1.0/FASTK/HTSLIB/README.large_positions.md +234 -0
  13. pyfastk-0.1.0/FASTK/HTSLIB/aclocal.m4 +174 -0
  14. pyfastk-0.1.0/FASTK/HTSLIB/bcf_sr_sort.c +684 -0
  15. pyfastk-0.1.0/FASTK/HTSLIB/bcf_sr_sort.h +108 -0
  16. pyfastk-0.1.0/FASTK/HTSLIB/bgzf.c +2483 -0
  17. pyfastk-0.1.0/FASTK/HTSLIB/bgzip.1 +180 -0
  18. pyfastk-0.1.0/FASTK/HTSLIB/bgzip.c +422 -0
  19. pyfastk-0.1.0/FASTK/HTSLIB/config.h +8 -0
  20. pyfastk-0.1.0/FASTK/HTSLIB/config.mk.in +114 -0
  21. pyfastk-0.1.0/FASTK/HTSLIB/configure.ac +421 -0
  22. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram.h +61 -0
  23. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_codecs.c +2257 -0
  24. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_codecs.h +196 -0
  25. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_decode.c +3397 -0
  26. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_decode.h +117 -0
  27. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_encode.c +3392 -0
  28. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_encode.h +115 -0
  29. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_external.c +396 -0
  30. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_index.c +772 -0
  31. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_index.h +115 -0
  32. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_io.c +5015 -0
  33. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_io.h +942 -0
  34. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_samtools.c +123 -0
  35. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_samtools.h +98 -0
  36. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_stats.c +212 -0
  37. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_stats.h +59 -0
  38. pyfastk-0.1.0/FASTK/HTSLIB/cram/cram_structs.h +865 -0
  39. pyfastk-0.1.0/FASTK/HTSLIB/cram/mFILE.c +668 -0
  40. pyfastk-0.1.0/FASTK/HTSLIB/cram/mFILE.h +93 -0
  41. pyfastk-0.1.0/FASTK/HTSLIB/cram/misc.h +77 -0
  42. pyfastk-0.1.0/FASTK/HTSLIB/cram/open_trace_file.c +437 -0
  43. pyfastk-0.1.0/FASTK/HTSLIB/cram/open_trace_file.h +125 -0
  44. pyfastk-0.1.0/FASTK/HTSLIB/cram/os.h +204 -0
  45. pyfastk-0.1.0/FASTK/HTSLIB/cram/pooled_alloc.c +205 -0
  46. pyfastk-0.1.0/FASTK/HTSLIB/cram/pooled_alloc.h +66 -0
  47. pyfastk-0.1.0/FASTK/HTSLIB/cram/rANS_byte.h +352 -0
  48. pyfastk-0.1.0/FASTK/HTSLIB/cram/rANS_static.c +909 -0
  49. pyfastk-0.1.0/FASTK/HTSLIB/cram/rANS_static.h +51 -0
  50. pyfastk-0.1.0/FASTK/HTSLIB/cram/string_alloc.c +162 -0
  51. pyfastk-0.1.0/FASTK/HTSLIB/cram/string_alloc.h +69 -0
  52. pyfastk-0.1.0/FASTK/HTSLIB/errmod.c +208 -0
  53. pyfastk-0.1.0/FASTK/HTSLIB/faidx.5 +238 -0
  54. pyfastk-0.1.0/FASTK/HTSLIB/faidx.c +951 -0
  55. pyfastk-0.1.0/FASTK/HTSLIB/header.c +2715 -0
  56. pyfastk-0.1.0/FASTK/HTSLIB/header.h +319 -0
  57. pyfastk-0.1.0/FASTK/HTSLIB/hfile.c +1189 -0
  58. pyfastk-0.1.0/FASTK/HTSLIB/hfile_gcs.c +138 -0
  59. pyfastk-0.1.0/FASTK/HTSLIB/hfile_internal.h +201 -0
  60. pyfastk-0.1.0/FASTK/HTSLIB/hfile_libcurl.c +1504 -0
  61. pyfastk-0.1.0/FASTK/HTSLIB/hfile_net.c +112 -0
  62. pyfastk-0.1.0/FASTK/HTSLIB/hfile_s3.c +1258 -0
  63. pyfastk-0.1.0/FASTK/HTSLIB/hfile_s3_write.c +896 -0
  64. pyfastk-0.1.0/FASTK/HTSLIB/hts.c +4048 -0
  65. pyfastk-0.1.0/FASTK/HTSLIB/hts_internal.h +127 -0
  66. pyfastk-0.1.0/FASTK/HTSLIB/hts_os.c +59 -0
  67. pyfastk-0.1.0/FASTK/HTSLIB/htsfile.1 +94 -0
  68. pyfastk-0.1.0/FASTK/HTSLIB/htsfile.c +329 -0
  69. pyfastk-0.1.0/FASTK/HTSLIB/htslib/bgzf.h +454 -0
  70. pyfastk-0.1.0/FASTK/HTSLIB/htslib/cram.h +549 -0
  71. pyfastk-0.1.0/FASTK/HTSLIB/htslib/faidx.h +334 -0
  72. pyfastk-0.1.0/FASTK/HTSLIB/htslib/hfile.h +322 -0
  73. pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts.h +1341 -0
  74. pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts_defs.h +112 -0
  75. pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts_endian.h +354 -0
  76. pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts_log.h +96 -0
  77. pyfastk-0.1.0/FASTK/HTSLIB/htslib/hts_os.h +80 -0
  78. pyfastk-0.1.0/FASTK/HTSLIB/htslib/kbitset.h +203 -0
  79. pyfastk-0.1.0/FASTK/HTSLIB/htslib/kfunc.h +91 -0
  80. pyfastk-0.1.0/FASTK/HTSLIB/htslib/khash.h +669 -0
  81. pyfastk-0.1.0/FASTK/HTSLIB/htslib/khash_str2int.h +133 -0
  82. pyfastk-0.1.0/FASTK/HTSLIB/htslib/klist.h +136 -0
  83. pyfastk-0.1.0/FASTK/HTSLIB/htslib/knetfile.h +109 -0
  84. pyfastk-0.1.0/FASTK/HTSLIB/htslib/kroundup.h +76 -0
  85. pyfastk-0.1.0/FASTK/HTSLIB/htslib/kseq.h +252 -0
  86. pyfastk-0.1.0/FASTK/HTSLIB/htslib/ksort.h +320 -0
  87. pyfastk-0.1.0/FASTK/HTSLIB/htslib/kstring.h +389 -0
  88. pyfastk-0.1.0/FASTK/HTSLIB/htslib/regidx.h +244 -0
  89. pyfastk-0.1.0/FASTK/HTSLIB/htslib/sam.h +1789 -0
  90. pyfastk-0.1.0/FASTK/HTSLIB/htslib/synced_bcf_reader.h +383 -0
  91. pyfastk-0.1.0/FASTK/HTSLIB/htslib/tbx.h +142 -0
  92. pyfastk-0.1.0/FASTK/HTSLIB/htslib/thread_pool.h +377 -0
  93. pyfastk-0.1.0/FASTK/HTSLIB/htslib/vcf.h +1465 -0
  94. pyfastk-0.1.0/FASTK/HTSLIB/htslib/vcf_sweep.h +57 -0
  95. pyfastk-0.1.0/FASTK/HTSLIB/htslib/vcfutils.h +144 -0
  96. pyfastk-0.1.0/FASTK/HTSLIB/htslib-s3-plugin.7 +122 -0
  97. pyfastk-0.1.0/FASTK/HTSLIB/htslib.mk +191 -0
  98. pyfastk-0.1.0/FASTK/HTSLIB/htslib.pc.in +15 -0
  99. pyfastk-0.1.0/FASTK/HTSLIB/htslib.pc.tmp +15 -0
  100. pyfastk-0.1.0/FASTK/HTSLIB/htslib_static.mk +2 -0
  101. pyfastk-0.1.0/FASTK/HTSLIB/htslib_vars.mk +54 -0
  102. pyfastk-0.1.0/FASTK/HTSLIB/kfunc.c +283 -0
  103. pyfastk-0.1.0/FASTK/HTSLIB/knetfile.c +645 -0
  104. pyfastk-0.1.0/FASTK/HTSLIB/kstring.c +437 -0
  105. pyfastk-0.1.0/FASTK/HTSLIB/m4/hts_hide_dynamic_syms.m4 +65 -0
  106. pyfastk-0.1.0/FASTK/HTSLIB/m4/hts_prog_cc_warnings.m4 +208 -0
  107. pyfastk-0.1.0/FASTK/HTSLIB/md5.c +388 -0
  108. pyfastk-0.1.0/FASTK/HTSLIB/multipart.c +267 -0
  109. pyfastk-0.1.0/FASTK/HTSLIB/os/lzma_stub.h +85 -0
  110. pyfastk-0.1.0/FASTK/HTSLIB/os/rand.c +97 -0
  111. pyfastk-0.1.0/FASTK/HTSLIB/plugin.c +185 -0
  112. pyfastk-0.1.0/FASTK/HTSLIB/probaln.c +312 -0
  113. pyfastk-0.1.0/FASTK/HTSLIB/realn.c +290 -0
  114. pyfastk-0.1.0/FASTK/HTSLIB/regidx.c +686 -0
  115. pyfastk-0.1.0/FASTK/HTSLIB/region.c +276 -0
  116. pyfastk-0.1.0/FASTK/HTSLIB/sam.5 +68 -0
  117. pyfastk-0.1.0/FASTK/HTSLIB/sam.c +4749 -0
  118. pyfastk-0.1.0/FASTK/HTSLIB/sam_internal.h +101 -0
  119. pyfastk-0.1.0/FASTK/HTSLIB/synced_bcf_reader.c +1293 -0
  120. pyfastk-0.1.0/FASTK/HTSLIB/tabix.1 +182 -0
  121. pyfastk-0.1.0/FASTK/HTSLIB/tabix.c +676 -0
  122. pyfastk-0.1.0/FASTK/HTSLIB/tbx.c +478 -0
  123. pyfastk-0.1.0/FASTK/HTSLIB/test/auxf#values.sam +5 -0
  124. pyfastk-0.1.0/FASTK/HTSLIB/test/auxf#values_java.cram +0 -0
  125. pyfastk-0.1.0/FASTK/HTSLIB/test/auxf.fa +2 -0
  126. pyfastk-0.1.0/FASTK/HTSLIB/test/auxf.fa.fai +1 -0
  127. pyfastk-0.1.0/FASTK/HTSLIB/test/bgziptest.txt +1 -0
  128. pyfastk-0.1.0/FASTK/HTSLIB/test/bgziptest.txt.gz +0 -0
  129. pyfastk-0.1.0/FASTK/HTSLIB/test/bgziptest.txt.gz.gzi +0 -0
  130. pyfastk-0.1.0/FASTK/HTSLIB/test/c1#bounds.sam +4 -0
  131. pyfastk-0.1.0/FASTK/HTSLIB/test/c1#clip.sam +8 -0
  132. pyfastk-0.1.0/FASTK/HTSLIB/test/c1#noseq.sam +10 -0
  133. pyfastk-0.1.0/FASTK/HTSLIB/test/c1#pad1.sam +10 -0
  134. pyfastk-0.1.0/FASTK/HTSLIB/test/c1#pad2.sam +14 -0
  135. pyfastk-0.1.0/FASTK/HTSLIB/test/c1#pad3.sam +14 -0
  136. pyfastk-0.1.0/FASTK/HTSLIB/test/c1#unknown.sam +9 -0
  137. pyfastk-0.1.0/FASTK/HTSLIB/test/c1.fa +2 -0
  138. pyfastk-0.1.0/FASTK/HTSLIB/test/c1.fa.fai +1 -0
  139. pyfastk-0.1.0/FASTK/HTSLIB/test/c2#pad.sam +26 -0
  140. pyfastk-0.1.0/FASTK/HTSLIB/test/c2.fa +2 -0
  141. pyfastk-0.1.0/FASTK/HTSLIB/test/c2.fa.fai +1 -0
  142. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#1.sam +2 -0
  143. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#1000.sam +1005 -0
  144. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#2.sam +3 -0
  145. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#5.sam +11 -0
  146. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#5b.sam +12 -0
  147. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#5b_java.cram +0 -0
  148. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#large_seq.sam +3 -0
  149. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#supp.sam +6 -0
  150. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#tag_depadded.sam +11 -0
  151. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#tag_padded.sam +11 -0
  152. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#unmap.sam +6 -0
  153. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#unmap1.sam +20 -0
  154. pyfastk-0.1.0/FASTK/HTSLIB/test/ce#unmap2.sam +29 -0
  155. pyfastk-0.1.0/FASTK/HTSLIB/test/ce.fa +20803 -0
  156. pyfastk-0.1.0/FASTK/HTSLIB/test/ce.fa.fai +7 -0
  157. pyfastk-0.1.0/FASTK/HTSLIB/test/colons.bam +0 -0
  158. pyfastk-0.1.0/FASTK/HTSLIB/test/colons.bam.bai +0 -0
  159. pyfastk-0.1.0/FASTK/HTSLIB/test/compare_sam.pl +213 -0
  160. pyfastk-0.1.0/FASTK/HTSLIB/test/cross_validate.sh +145 -0
  161. pyfastk-0.1.0/FASTK/HTSLIB/test/emptyfile +0 -0
  162. pyfastk-0.1.0/FASTK/HTSLIB/test/faidx.fa +21 -0
  163. pyfastk-0.1.0/FASTK/HTSLIB/test/fastqs.fq +500 -0
  164. pyfastk-0.1.0/FASTK/HTSLIB/test/fastqs_README.txt +109 -0
  165. pyfastk-0.1.0/FASTK/HTSLIB/test/fieldarith.c +74 -0
  166. pyfastk-0.1.0/FASTK/HTSLIB/test/fieldarith.sam +15 -0
  167. pyfastk-0.1.0/FASTK/HTSLIB/test/formatcols.vcf +6 -0
  168. pyfastk-0.1.0/FASTK/HTSLIB/test/formatmissing-out.vcf +6 -0
  169. pyfastk-0.1.0/FASTK/HTSLIB/test/formatmissing.vcf +6 -0
  170. pyfastk-0.1.0/FASTK/HTSLIB/test/fuzz/hts_open_fuzzer.c +151 -0
  171. pyfastk-0.1.0/FASTK/HTSLIB/test/header_syms.pl +104 -0
  172. pyfastk-0.1.0/FASTK/HTSLIB/test/hfile.c +311 -0
  173. pyfastk-0.1.0/FASTK/HTSLIB/test/hts_endian.c +512 -0
  174. pyfastk-0.1.0/FASTK/HTSLIB/test/index.bam.bai +0 -0
  175. pyfastk-0.1.0/FASTK/HTSLIB/test/index.bam.csi +0 -0
  176. pyfastk-0.1.0/FASTK/HTSLIB/test/index.bcf.csi +0 -0
  177. pyfastk-0.1.0/FASTK/HTSLIB/test/index.cram.crai +0 -0
  178. pyfastk-0.1.0/FASTK/HTSLIB/test/index.sam +190 -0
  179. pyfastk-0.1.0/FASTK/HTSLIB/test/index.sam.gz.bai +0 -0
  180. pyfastk-0.1.0/FASTK/HTSLIB/test/index.sam.gz.csi +0 -0
  181. pyfastk-0.1.0/FASTK/HTSLIB/test/index.vcf +728 -0
  182. pyfastk-0.1.0/FASTK/HTSLIB/test/index.vcf.gz.csi +0 -0
  183. pyfastk-0.1.0/FASTK/HTSLIB/test/index.vcf.gz.tbi +0 -0
  184. pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/index.expected1.vcf +6 -0
  185. pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/index.expected2.vcf +1 -0
  186. pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/index.vcf +216 -0
  187. pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/longref.sam +96 -0
  188. pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/longref_itr.expected.sam +26 -0
  189. pyfastk-0.1.0/FASTK/HTSLIB/test/longrefs/longref_multi.expected.sam +46 -0
  190. pyfastk-0.1.0/FASTK/HTSLIB/test/maintainer/check_copyright.pl +95 -0
  191. pyfastk-0.1.0/FASTK/HTSLIB/test/maintainer/check_spaces.pl +92 -0
  192. pyfastk-0.1.0/FASTK/HTSLIB/test/md#1.sam +12 -0
  193. pyfastk-0.1.0/FASTK/HTSLIB/test/md.fa +3 -0
  194. pyfastk-0.1.0/FASTK/HTSLIB/test/md.fa.fai +1 -0
  195. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad1.out +10 -0
  196. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad1.sam +47 -0
  197. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad2.out +10 -0
  198. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad2.sam +55 -0
  199. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad3.out +5 -0
  200. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/c1#pad3.sam +53 -0
  201. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_D.out +11 -0
  202. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_D.sam +36 -0
  203. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_DI.out +12 -0
  204. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_DI.sam +40 -0
  205. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_I.out +11 -0
  206. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_I.sam +41 -0
  207. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_ID.out +12 -0
  208. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_ID.sam +45 -0
  209. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_N.out +11 -0
  210. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_N.sam +40 -0
  211. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_N2.out +13 -0
  212. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_N2.sam +46 -0
  213. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_P.out +10 -0
  214. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mp_P.sam +41 -0
  215. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/mpileup.tst +73 -0
  216. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/small.bam +0 -0
  217. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/small.out +322 -0
  218. pyfastk-0.1.0/FASTK/HTSLIB/test/mpileup/test-pileup.sh +34 -0
  219. pyfastk-0.1.0/FASTK/HTSLIB/test/no_hdr_sq_1.bam +0 -0
  220. pyfastk-0.1.0/FASTK/HTSLIB/test/no_hdr_sq_1.bam.csi +0 -0
  221. pyfastk-0.1.0/FASTK/HTSLIB/test/no_hdr_sq_1.expected.sam +16 -0
  222. pyfastk-0.1.0/FASTK/HTSLIB/test/noroundtrip-out.vcf +9 -0
  223. pyfastk-0.1.0/FASTK/HTSLIB/test/noroundtrip.vcf +8 -0
  224. pyfastk-0.1.0/FASTK/HTSLIB/test/pileup.c +255 -0
  225. pyfastk-0.1.0/FASTK/HTSLIB/test/range.bam +0 -0
  226. pyfastk-0.1.0/FASTK/HTSLIB/test/range.bam.bai +0 -0
  227. pyfastk-0.1.0/FASTK/HTSLIB/test/range.cram +0 -0
  228. pyfastk-0.1.0/FASTK/HTSLIB/test/range.cram.crai +0 -0
  229. pyfastk-0.1.0/FASTK/HTSLIB/test/range.out +17 -0
  230. pyfastk-0.1.0/FASTK/HTSLIB/test/realn01.fa +13 -0
  231. pyfastk-0.1.0/FASTK/HTSLIB/test/realn01.fa.fai +1 -0
  232. pyfastk-0.1.0/FASTK/HTSLIB/test/realn01.sam +8 -0
  233. pyfastk-0.1.0/FASTK/HTSLIB/test/realn01_exp-a.sam +8 -0
  234. pyfastk-0.1.0/FASTK/HTSLIB/test/realn01_exp-e.sam +8 -0
  235. pyfastk-0.1.0/FASTK/HTSLIB/test/realn01_exp.sam +8 -0
  236. pyfastk-0.1.0/FASTK/HTSLIB/test/realn02-r.sam +12 -0
  237. pyfastk-0.1.0/FASTK/HTSLIB/test/realn02.fa +71 -0
  238. pyfastk-0.1.0/FASTK/HTSLIB/test/realn02.fa.fai +1 -0
  239. pyfastk-0.1.0/FASTK/HTSLIB/test/realn02.sam +12 -0
  240. pyfastk-0.1.0/FASTK/HTSLIB/test/realn02_exp-a.sam +12 -0
  241. pyfastk-0.1.0/FASTK/HTSLIB/test/realn02_exp-e.sam +12 -0
  242. pyfastk-0.1.0/FASTK/HTSLIB/test/realn02_exp.sam +12 -0
  243. pyfastk-0.1.0/FASTK/HTSLIB/test/sam.c +1834 -0
  244. pyfastk-0.1.0/FASTK/HTSLIB/test/simple_test_driver.sh +190 -0
  245. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/bed_file.Y.100200.out +1 -0
  246. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/bed_file.bed +39 -0
  247. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/gff_file.X.2934832.2935190.out +4 -0
  248. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/gff_file.gff +70 -0
  249. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/large_chr.20.1.2147483647.out +9 -0
  250. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/large_chr.vcf +18 -0
  251. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/tabix.tst +65 -0
  252. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/test-tabix.sh +35 -0
  253. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/vcf_file.1.3000151.out +1 -0
  254. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/vcf_file.2.3199812.out +1 -0
  255. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/vcf_file.bcf +0 -0
  256. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix/vcf_file.vcf +37 -0
  257. pyfastk-0.1.0/FASTK/HTSLIB/test/tabix.out +1 -0
  258. pyfastk-0.1.0/FASTK/HTSLIB/test/test-bcf-sr.c +142 -0
  259. pyfastk-0.1.0/FASTK/HTSLIB/test/test-bcf-sr.pl +566 -0
  260. pyfastk-0.1.0/FASTK/HTSLIB/test/test-bcf-translate.c +201 -0
  261. pyfastk-0.1.0/FASTK/HTSLIB/test/test-bcf-translate.out +18 -0
  262. pyfastk-0.1.0/FASTK/HTSLIB/test/test-logging.pl +96 -0
  263. pyfastk-0.1.0/FASTK/HTSLIB/test/test-parse-reg.c +204 -0
  264. pyfastk-0.1.0/FASTK/HTSLIB/test/test-regidx.c +472 -0
  265. pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-api.c +545 -0
  266. pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-api.out +29 -0
  267. pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-hdr-in.vcf +25 -0
  268. pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-hdr.out +16 -0
  269. pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-sweep.c +114 -0
  270. pyfastk-0.1.0/FASTK/HTSLIB/test/test-vcf-sweep.out +4 -0
  271. pyfastk-0.1.0/FASTK/HTSLIB/test/test.pl +955 -0
  272. pyfastk-0.1.0/FASTK/HTSLIB/test/test_bgzf.c +1007 -0
  273. pyfastk-0.1.0/FASTK/HTSLIB/test/test_index.c +83 -0
  274. pyfastk-0.1.0/FASTK/HTSLIB/test/test_kstring.c +305 -0
  275. pyfastk-0.1.0/FASTK/HTSLIB/test/test_realn.c +169 -0
  276. pyfastk-0.1.0/FASTK/HTSLIB/test/test_str2int.c +155 -0
  277. pyfastk-0.1.0/FASTK/HTSLIB/test/test_view.c +426 -0
  278. pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads1.c +47 -0
  279. pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads2.c +45 -0
  280. pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads3.c +50 -0
  281. pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads4.c +68 -0
  282. pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads5.c +66 -0
  283. pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads6.c +108 -0
  284. pyfastk-0.1.0/FASTK/HTSLIB/test/thrash_threads7.c +119 -0
  285. pyfastk-0.1.0/FASTK/HTSLIB/test/thread_pool.md +58 -0
  286. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#MD.sam +22 -0
  287. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#MD2.sam +20 -0
  288. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#blank.sam +1 -0
  289. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#large_aux.sam +4 -0
  290. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#large_aux2.sam +11 -0
  291. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#large_aux_java.cram +0 -0
  292. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#minimal.sam +10 -0
  293. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#pair.sam +7 -0
  294. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#repeated.sam +7 -0
  295. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#rg.sam +13 -0
  296. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#tlen.sam +34 -0
  297. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#tlen2.sam +36 -0
  298. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#triplet.sam +7 -0
  299. pyfastk-0.1.0/FASTK/HTSLIB/test/xx#unsorted.sam +8 -0
  300. pyfastk-0.1.0/FASTK/HTSLIB/test/xx.fa +7 -0
  301. pyfastk-0.1.0/FASTK/HTSLIB/test/xx.fa.fai +3 -0
  302. pyfastk-0.1.0/FASTK/HTSLIB/textutils.c +448 -0
  303. pyfastk-0.1.0/FASTK/HTSLIB/textutils_internal.h +297 -0
  304. pyfastk-0.1.0/FASTK/HTSLIB/thread_pool.c +1434 -0
  305. pyfastk-0.1.0/FASTK/HTSLIB/thread_pool_internal.h +169 -0
  306. pyfastk-0.1.0/FASTK/HTSLIB/vcf.5 +120 -0
  307. pyfastk-0.1.0/FASTK/HTSLIB/vcf.c +4609 -0
  308. pyfastk-0.1.0/FASTK/HTSLIB/vcf_sweep.c +188 -0
  309. pyfastk-0.1.0/FASTK/HTSLIB/vcfutils.c +834 -0
  310. pyfastk-0.1.0/FASTK/HTSLIB/version.sh +54 -0
  311. pyfastk-0.1.0/FASTK/Haplex.c +546 -0
  312. pyfastk-0.1.0/FASTK/Histex.c +274 -0
  313. pyfastk-0.1.0/FASTK/Homex.c +493 -0
  314. pyfastk-0.1.0/FASTK/KmerMap.c +257 -0
  315. pyfastk-0.1.0/FASTK/LIBDEFLATE/.cirrus.yml +8 -0
  316. pyfastk-0.1.0/FASTK/LIBDEFLATE/.travis.yml +71 -0
  317. pyfastk-0.1.0/FASTK/LIBDEFLATE/COPYING +21 -0
  318. pyfastk-0.1.0/FASTK/LIBDEFLATE/Makefile +330 -0
  319. pyfastk-0.1.0/FASTK/LIBDEFLATE/Makefile.msc +65 -0
  320. pyfastk-0.1.0/FASTK/LIBDEFLATE/NEWS +129 -0
  321. pyfastk-0.1.0/FASTK/LIBDEFLATE/README.md +243 -0
  322. pyfastk-0.1.0/FASTK/LIBDEFLATE/common/common_defs.h +366 -0
  323. pyfastk-0.1.0/FASTK/LIBDEFLATE/common/compiler_gcc.h +159 -0
  324. pyfastk-0.1.0/FASTK/LIBDEFLATE/common/compiler_msc.h +96 -0
  325. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/adler32.c +130 -0
  326. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/adler32_vec_template.h +124 -0
  327. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/aligned_malloc.c +57 -0
  328. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/aligned_malloc.h +13 -0
  329. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/adler32_impl.h +120 -0
  330. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/cpu_features.c +119 -0
  331. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/cpu_features.h +37 -0
  332. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/crc32_impl.h +166 -0
  333. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/arm/matchfinder_impl.h +93 -0
  334. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/bt_matchfinder.h +355 -0
  335. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/crc32.c +313 -0
  336. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/crc32_table.h +526 -0
  337. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/crc32_vec_template.h +61 -0
  338. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/decompress_template.h +421 -0
  339. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/deflate_compress.c +2826 -0
  340. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/deflate_compress.h +14 -0
  341. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/deflate_constants.h +66 -0
  342. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/deflate_decompress.c +997 -0
  343. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/gzip_compress.c +95 -0
  344. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/gzip_constants.h +45 -0
  345. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/gzip_decompress.c +148 -0
  346. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/hc_matchfinder.h +403 -0
  347. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/lib_common.h +35 -0
  348. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/matchfinder_common.h +168 -0
  349. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/unaligned.h +202 -0
  350. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/adler32_impl.h +332 -0
  351. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/cpu_features.c +139 -0
  352. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/cpu_features.h +41 -0
  353. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/crc32_impl.h +87 -0
  354. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/crc32_pclmul_template.h +262 -0
  355. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/decompress_impl.h +26 -0
  356. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/x86/matchfinder_impl.h +164 -0
  357. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/zlib_compress.c +87 -0
  358. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/zlib_constants.h +21 -0
  359. pyfastk-0.1.0/FASTK/LIBDEFLATE/lib/zlib_decompress.c +91 -0
  360. pyfastk-0.1.0/FASTK/LIBDEFLATE/libdeflate.h +323 -0
  361. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/benchmark.c +632 -0
  362. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/checksum.c +195 -0
  363. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/detect.sh +62 -0
  364. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/gzip.c +641 -0
  365. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/prog_util.c +473 -0
  366. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/prog_util.h +158 -0
  367. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_checksums.c +186 -0
  368. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_incomplete_codes.c +385 -0
  369. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_slow_decompression.c +472 -0
  370. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_util.c +245 -0
  371. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/test_util.h +68 -0
  372. pyfastk-0.1.0/FASTK/LIBDEFLATE/programs/tgetopt.c +118 -0
  373. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/Makefile +12 -0
  374. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/deflate_compress/fuzz.c +40 -0
  375. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/deflate_compress/inputs/0 +0 -0
  376. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/deflate_decompress/fuzz.c +28 -0
  377. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/deflate_decompress/inputs/0 +5 -0
  378. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/gzip_decompress/fuzz.c +28 -0
  379. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/gzip_decompress/inputs/0 +0 -0
  380. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/prepare_for_fuzz.sh +14 -0
  381. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/zlib_decompress/fuzz.c +28 -0
  382. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/afl-fuzz/zlib_decompress/inputs/0 +5 -0
  383. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/android_build.sh +115 -0
  384. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/checksum_benchmarks.sh +162 -0
  385. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/exec_tests.sh +32 -0
  386. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/gen_crc32_multipliers.c +108 -0
  387. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/gen_crc32_table.c +100 -0
  388. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/gzip_tests.sh +438 -0
  389. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/make-windows-releases +22 -0
  390. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/mips_build.sh +9 -0
  391. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/msc_test.bat +3 -0
  392. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/pgo_build.sh +23 -0
  393. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/produce_gzip_benchmark_table.sh +37 -0
  394. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/run_tests.sh +376 -0
  395. pyfastk-0.1.0/FASTK/LIBDEFLATE/tools/windows_build.sh +10 -0
  396. pyfastk-0.1.0/FASTK/LICENSE +34 -0
  397. pyfastk-0.1.0/FASTK/LSDsort.c +271 -0
  398. pyfastk-0.1.0/FASTK/Logex.c +1580 -0
  399. pyfastk-0.1.0/FASTK/MSDsort.c +544 -0
  400. pyfastk-0.1.0/FASTK/Makefile +88 -0
  401. pyfastk-0.1.0/FASTK/ONElib.c +4194 -0
  402. pyfastk-0.1.0/FASTK/ONElib.h +464 -0
  403. pyfastk-0.1.0/FASTK/Profex.c +240 -0
  404. pyfastk-0.1.0/FASTK/README.md +1069 -0
  405. pyfastk-0.1.0/FASTK/Symmex.c +544 -0
  406. pyfastk-0.1.0/FASTK/Tabex.c +408 -0
  407. pyfastk-0.1.0/FASTK/Vennex.c +352 -0
  408. pyfastk-0.1.0/FASTK/count.c +1914 -0
  409. pyfastk-0.1.0/FASTK/gene_core.c +409 -0
  410. pyfastk-0.1.0/FASTK/gene_core.h +127 -0
  411. pyfastk-0.1.0/FASTK/io.c +2719 -0
  412. pyfastk-0.1.0/FASTK/libfastk.c +1805 -0
  413. pyfastk-0.1.0/FASTK/libfastk.h +121 -0
  414. pyfastk-0.1.0/FASTK/merge.c +1006 -0
  415. pyfastk-0.1.0/FASTK/split.c +2131 -0
  416. pyfastk-0.1.0/FASTK/table.c +533 -0
  417. pyfastk-0.1.0/MANIFEST.in +3 -0
  418. pyfastk-0.1.0/PKG-INFO +58 -0
  419. pyfastk-0.1.0/README.md +49 -0
  420. pyfastk-0.1.0/pyproject.toml +42 -0
  421. pyfastk-0.1.0/setup.cfg +4 -0
  422. pyfastk-0.1.0/setup.py +57 -0
  423. pyfastk-0.1.0/src/pyfastk/__init__.py +4 -0
  424. pyfastk-0.1.0/src/pyfastk/_fastk.c +34474 -0
  425. pyfastk-0.1.0/src/pyfastk/_fastk.pyx +625 -0
  426. pyfastk-0.1.0/src/pyfastk/_logex.py +111 -0
  427. pyfastk-0.1.0/src/pyfastk/py.typed +0 -0
  428. pyfastk-0.1.0/src/pyfastk.egg-info/PKG-INFO +58 -0
  429. pyfastk-0.1.0/src/pyfastk.egg-info/SOURCES.txt +438 -0
  430. pyfastk-0.1.0/src/pyfastk.egg-info/dependency_links.txt +1 -0
  431. pyfastk-0.1.0/src/pyfastk.egg-info/requires.txt +1 -0
  432. pyfastk-0.1.0/src/pyfastk.egg-info/top_level.txt +1 -0
  433. pyfastk-0.1.0/tests/test_build.py +465 -0
  434. pyfastk-0.1.0/tests/test_construction.py +68 -0
  435. pyfastk-0.1.0/tests/test_delete.py +95 -0
  436. pyfastk-0.1.0/tests/test_histogram.py +150 -0
  437. pyfastk-0.1.0/tests/test_kmers.py +167 -0
  438. pyfastk-0.1.0/tests/test_logex.py +253 -0
  439. pyfastk-0.1.0/tests/test_lookup.py +158 -0
  440. 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