ngs_server 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +4 -0
  3. data/Rakefile +2 -0
  4. data/bin/ngs_server +58 -0
  5. data/data/holder.txt +0 -0
  6. data/ext/bamtools/CMakeLists.txt +49 -0
  7. data/ext/bamtools/LICENSE +22 -0
  8. data/ext/bamtools/README +60 -0
  9. data/ext/bamtools/Tutorial_Toolkit_BamTools-1.0.pdf +0 -0
  10. data/ext/bamtools/docs/Doxyfile +1601 -0
  11. data/ext/bamtools/extconf.rb +9 -0
  12. data/ext/bamtools/src/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
  13. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/DependInfo.cmake +13 -0
  14. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/build.make +65 -0
  15. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/cmake_clean.cmake +8 -0
  16. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/depend.internal +3 -0
  17. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/depend.make +3 -0
  18. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/progress.make +2 -0
  19. data/ext/bamtools/src/CMakeFiles/progress.marks +1 -0
  20. data/ext/bamtools/src/CMakeLists.txt +18 -0
  21. data/ext/bamtools/src/ExportHeader.cmake +31 -0
  22. data/ext/bamtools/src/Makefile +182 -0
  23. data/ext/bamtools/src/api/BamAlignment.cpp +2432 -0
  24. data/ext/bamtools/src/api/BamAlignment.h +206 -0
  25. data/ext/bamtools/src/api/BamAux.h +456 -0
  26. data/ext/bamtools/src/api/BamConstants.h +127 -0
  27. data/ext/bamtools/src/api/BamIndex.h +79 -0
  28. data/ext/bamtools/src/api/BamMultiReader.cpp +395 -0
  29. data/ext/bamtools/src/api/BamMultiReader.h +126 -0
  30. data/ext/bamtools/src/api/BamReader.cpp +369 -0
  31. data/ext/bamtools/src/api/BamReader.h +117 -0
  32. data/ext/bamtools/src/api/BamWriter.cpp +142 -0
  33. data/ext/bamtools/src/api/BamWriter.h +63 -0
  34. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/DependInfo.cmake +14 -0
  35. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/build.make +80 -0
  36. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/cmake_clean.cmake +8 -0
  37. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/depend.internal +3 -0
  38. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/depend.make +3 -0
  39. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/progress.make +2 -0
  40. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamAlignment.cpp.o +0 -0
  41. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamMultiReader.cpp.o +0 -0
  42. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamReader.cpp.o +0 -0
  43. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamWriter.cpp.o +0 -0
  44. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/CXX.includecache +596 -0
  45. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/DependInfo.cmake +41 -0
  46. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamHeader.cpp.o +0 -0
  47. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamProgram.cpp.o +0 -0
  48. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamProgramChain.cpp.o +0 -0
  49. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamReadGroup.cpp.o +0 -0
  50. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamReadGroupDictionary.cpp.o +0 -0
  51. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamSequence.cpp.o +0 -0
  52. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamSequenceDictionary.cpp.o +0 -0
  53. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/build.make +675 -0
  54. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/cmake_clean.cmake +32 -0
  55. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/cmake_clean_target.cmake +3 -0
  56. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/depend.internal +295 -0
  57. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/depend.make +295 -0
  58. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/flags.make +8 -0
  59. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamHeader_p.cpp.o +0 -0
  60. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamIndexFactory_p.cpp.o +0 -0
  61. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamMultiReader_p.cpp.o +0 -0
  62. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamRandomAccessController_p.cpp.o +0 -0
  63. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamReader_p.cpp.o +0 -0
  64. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamStandardIndex_p.cpp.o +0 -0
  65. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamToolsIndex_p.cpp.o +0 -0
  66. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamWriter_p.cpp.o +0 -0
  67. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BgzfStream_p.cpp.o +0 -0
  68. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/SamFormatParser_p.cpp.o +0 -0
  69. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/SamFormatPrinter_p.cpp.o +0 -0
  70. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/SamHeaderValidator_p.cpp.o +0 -0
  71. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/link.txt +2 -0
  72. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/progress.make +24 -0
  73. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamAlignment.cpp.o +0 -0
  74. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamMultiReader.cpp.o +0 -0
  75. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamReader.cpp.o +0 -0
  76. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamWriter.cpp.o +0 -0
  77. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/CXX.includecache +596 -0
  78. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/DependInfo.cmake +47 -0
  79. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamHeader.cpp.o +0 -0
  80. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamProgram.cpp.o +0 -0
  81. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamProgramChain.cpp.o +0 -0
  82. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamReadGroup.cpp.o +0 -0
  83. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamReadGroupDictionary.cpp.o +0 -0
  84. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamSequence.cpp.o +0 -0
  85. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamSequenceDictionary.cpp.o +0 -0
  86. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/build.make +677 -0
  87. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/cmake_clean.cmake +33 -0
  88. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/depend.internal +295 -0
  89. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/depend.make +295 -0
  90. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/flags.make +8 -0
  91. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamHeader_p.cpp.o +0 -0
  92. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamIndexFactory_p.cpp.o +0 -0
  93. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamMultiReader_p.cpp.o +0 -0
  94. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamRandomAccessController_p.cpp.o +0 -0
  95. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamReader_p.cpp.o +0 -0
  96. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamStandardIndex_p.cpp.o +0 -0
  97. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamToolsIndex_p.cpp.o +0 -0
  98. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamWriter_p.cpp.o +0 -0
  99. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BgzfStream_p.cpp.o +0 -0
  100. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/SamFormatParser_p.cpp.o +0 -0
  101. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/SamFormatPrinter_p.cpp.o +0 -0
  102. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/SamHeaderValidator_p.cpp.o +0 -0
  103. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/link.txt +1 -0
  104. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/progress.make +24 -0
  105. data/ext/bamtools/src/api/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
  106. data/ext/bamtools/src/api/CMakeFiles/progress.marks +1 -0
  107. data/ext/bamtools/src/api/CMakeLists.txt +78 -0
  108. data/ext/bamtools/src/api/Makefile +902 -0
  109. data/ext/bamtools/src/api/SamConstants.h +95 -0
  110. data/ext/bamtools/src/api/SamHeader.cpp +184 -0
  111. data/ext/bamtools/src/api/SamHeader.h +68 -0
  112. data/ext/bamtools/src/api/SamProgram.cpp +139 -0
  113. data/ext/bamtools/src/api/SamProgram.h +61 -0
  114. data/ext/bamtools/src/api/SamProgramChain.cpp +351 -0
  115. data/ext/bamtools/src/api/SamProgramChain.h +85 -0
  116. data/ext/bamtools/src/api/SamReadGroup.cpp +221 -0
  117. data/ext/bamtools/src/api/SamReadGroup.h +68 -0
  118. data/ext/bamtools/src/api/SamReadGroupDictionary.cpp +289 -0
  119. data/ext/bamtools/src/api/SamReadGroupDictionary.h +86 -0
  120. data/ext/bamtools/src/api/SamSequence.cpp +161 -0
  121. data/ext/bamtools/src/api/SamSequence.h +60 -0
  122. data/ext/bamtools/src/api/SamSequenceDictionary.cpp +292 -0
  123. data/ext/bamtools/src/api/SamSequenceDictionary.h +88 -0
  124. data/ext/bamtools/src/api/api_global.h +21 -0
  125. data/ext/bamtools/src/api/cmake_install.cmake +122 -0
  126. data/ext/bamtools/src/api/internal/BamHeader_p.cpp +132 -0
  127. data/ext/bamtools/src/api/internal/BamHeader_p.h +71 -0
  128. data/ext/bamtools/src/api/internal/BamIndexFactory_p.cpp +112 -0
  129. data/ext/bamtools/src/api/internal/BamIndexFactory_p.h +49 -0
  130. data/ext/bamtools/src/api/internal/BamMultiMerger_p.h +297 -0
  131. data/ext/bamtools/src/api/internal/BamMultiReader_p.cpp +805 -0
  132. data/ext/bamtools/src/api/internal/BamMultiReader_p.h +103 -0
  133. data/ext/bamtools/src/api/internal/BamRandomAccessController_p.cpp +272 -0
  134. data/ext/bamtools/src/api/internal/BamRandomAccessController_p.h +93 -0
  135. data/ext/bamtools/src/api/internal/BamReader_p.cpp +380 -0
  136. data/ext/bamtools/src/api/internal/BamReader_p.h +112 -0
  137. data/ext/bamtools/src/api/internal/BamStandardIndex_p.cpp +986 -0
  138. data/ext/bamtools/src/api/internal/BamStandardIndex_p.h +236 -0
  139. data/ext/bamtools/src/api/internal/BamToolsIndex_p.cpp +641 -0
  140. data/ext/bamtools/src/api/internal/BamToolsIndex_p.h +187 -0
  141. data/ext/bamtools/src/api/internal/BamWriter_p.cpp +424 -0
  142. data/ext/bamtools/src/api/internal/BamWriter_p.h +66 -0
  143. data/ext/bamtools/src/api/internal/BgzfStream_p.cpp +438 -0
  144. data/ext/bamtools/src/api/internal/BgzfStream_p.h +108 -0
  145. data/ext/bamtools/src/api/internal/SamFormatParser_p.cpp +230 -0
  146. data/ext/bamtools/src/api/internal/SamFormatParser_p.h +61 -0
  147. data/ext/bamtools/src/api/internal/SamFormatPrinter_p.cpp +210 -0
  148. data/ext/bamtools/src/api/internal/SamFormatPrinter_p.h +60 -0
  149. data/ext/bamtools/src/api/internal/SamHeaderValidator_p.cpp +510 -0
  150. data/ext/bamtools/src/api/internal/SamHeaderValidator_p.h +101 -0
  151. data/ext/bamtools/src/api/internal/SamHeaderVersion_p.h +134 -0
  152. data/ext/bamtools/src/cmake_install.cmake +42 -0
  153. data/ext/bamtools/src/shared/bamtools_global.h +78 -0
  154. data/ext/bamtools/src/third_party/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
  155. data/ext/bamtools/src/third_party/CMakeFiles/progress.marks +1 -0
  156. data/ext/bamtools/src/third_party/CMakeLists.txt +10 -0
  157. data/ext/bamtools/src/third_party/Makefile +167 -0
  158. data/ext/bamtools/src/third_party/cmake_install.cmake +35 -0
  159. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
  160. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/CXX.includecache +144 -0
  161. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/DependInfo.cmake +27 -0
  162. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/build.make +157 -0
  163. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/cmake_clean.cmake +13 -0
  164. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/depend.internal +31 -0
  165. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/depend.make +31 -0
  166. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/flags.make +8 -0
  167. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/json_reader.cpp.o +0 -0
  168. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/json_value.cpp.o +0 -0
  169. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/json_writer.cpp.o +0 -0
  170. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/link.txt +1 -0
  171. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/progress.make +4 -0
  172. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/progress.marks +1 -0
  173. data/ext/bamtools/src/third_party/jsoncpp/CMakeLists.txt +23 -0
  174. data/ext/bamtools/src/third_party/jsoncpp/LICENSE +55 -0
  175. data/ext/bamtools/src/third_party/jsoncpp/Makefile +263 -0
  176. data/ext/bamtools/src/third_party/jsoncpp/cmake_install.cmake +29 -0
  177. data/ext/bamtools/src/third_party/jsoncpp/json.h +15 -0
  178. data/ext/bamtools/src/third_party/jsoncpp/json_batchallocator.h +130 -0
  179. data/ext/bamtools/src/third_party/jsoncpp/json_config.h +42 -0
  180. data/ext/bamtools/src/third_party/jsoncpp/json_features.h +47 -0
  181. data/ext/bamtools/src/third_party/jsoncpp/json_forwards.h +42 -0
  182. data/ext/bamtools/src/third_party/jsoncpp/json_internalarray.inl +453 -0
  183. data/ext/bamtools/src/third_party/jsoncpp/json_internalmap.inl +612 -0
  184. data/ext/bamtools/src/third_party/jsoncpp/json_reader.cpp +870 -0
  185. data/ext/bamtools/src/third_party/jsoncpp/json_reader.h +201 -0
  186. data/ext/bamtools/src/third_party/jsoncpp/json_tool.h +93 -0
  187. data/ext/bamtools/src/third_party/jsoncpp/json_value.cpp +1701 -0
  188. data/ext/bamtools/src/third_party/jsoncpp/json_value.h +1059 -0
  189. data/ext/bamtools/src/third_party/jsoncpp/json_valueiterator.inl +297 -0
  190. data/ext/bamtools/src/third_party/jsoncpp/json_writer.cpp +819 -0
  191. data/ext/bamtools/src/third_party/jsoncpp/json_writer.h +179 -0
  192. data/ext/bamtools/src/toolkit/CMakeFiles/CMakeDirectoryInformation.cmake +25 -0
  193. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/CXX.includecache +698 -0
  194. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/DependInfo.cmake +34 -0
  195. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools.cpp.o +0 -0
  196. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_convert.cpp.o +0 -0
  197. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_count.cpp.o +0 -0
  198. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_coverage.cpp.o +0 -0
  199. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_filter.cpp.o +0 -0
  200. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_header.cpp.o +0 -0
  201. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_index.cpp.o +0 -0
  202. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_merge.cpp.o +0 -0
  203. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_random.cpp.o +0 -0
  204. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_resolve.cpp.o +0 -0
  205. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_revert.cpp.o +0 -0
  206. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_sort.cpp.o +0 -0
  207. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_split.cpp.o +0 -0
  208. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_stats.cpp.o +0 -0
  209. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/build.make +447 -0
  210. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/cmake_clean.cmake +24 -0
  211. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/depend.internal +319 -0
  212. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/depend.make +319 -0
  213. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/flags.make +8 -0
  214. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/link.txt +1 -0
  215. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/progress.make +15 -0
  216. data/ext/bamtools/src/toolkit/CMakeFiles/progress.marks +1 -0
  217. data/ext/bamtools/src/toolkit/CMakeLists.txt +44 -0
  218. data/ext/bamtools/src/toolkit/Makefile +560 -0
  219. data/ext/bamtools/src/toolkit/bamtools.cpp +163 -0
  220. data/ext/bamtools/src/toolkit/bamtools_convert.cpp +888 -0
  221. data/ext/bamtools/src/toolkit/bamtools_convert.h +37 -0
  222. data/ext/bamtools/src/toolkit/bamtools_count.cpp +187 -0
  223. data/ext/bamtools/src/toolkit/bamtools_count.h +37 -0
  224. data/ext/bamtools/src/toolkit/bamtools_coverage.cpp +196 -0
  225. data/ext/bamtools/src/toolkit/bamtools_coverage.h +37 -0
  226. data/ext/bamtools/src/toolkit/bamtools_filter.cpp +911 -0
  227. data/ext/bamtools/src/toolkit/bamtools_filter.h +37 -0
  228. data/ext/bamtools/src/toolkit/bamtools_header.cpp +122 -0
  229. data/ext/bamtools/src/toolkit/bamtools_header.h +38 -0
  230. data/ext/bamtools/src/toolkit/bamtools_index.cpp +126 -0
  231. data/ext/bamtools/src/toolkit/bamtools_index.h +37 -0
  232. data/ext/bamtools/src/toolkit/bamtools_merge.cpp +221 -0
  233. data/ext/bamtools/src/toolkit/bamtools_merge.h +37 -0
  234. data/ext/bamtools/src/toolkit/bamtools_random.cpp +255 -0
  235. data/ext/bamtools/src/toolkit/bamtools_random.h +37 -0
  236. data/ext/bamtools/src/toolkit/bamtools_resolve.cpp +1396 -0
  237. data/ext/bamtools/src/toolkit/bamtools_resolve.h +42 -0
  238. data/ext/bamtools/src/toolkit/bamtools_revert.cpp +194 -0
  239. data/ext/bamtools/src/toolkit/bamtools_revert.h +37 -0
  240. data/ext/bamtools/src/toolkit/bamtools_sort.cpp +410 -0
  241. data/ext/bamtools/src/toolkit/bamtools_sort.h +37 -0
  242. data/ext/bamtools/src/toolkit/bamtools_split.cpp +551 -0
  243. data/ext/bamtools/src/toolkit/bamtools_split.h +38 -0
  244. data/ext/bamtools/src/toolkit/bamtools_stats.cpp +286 -0
  245. data/ext/bamtools/src/toolkit/bamtools_stats.h +37 -0
  246. data/ext/bamtools/src/toolkit/bamtools_tool.h +35 -0
  247. data/ext/bamtools/src/toolkit/bamtools_version.h +20 -0
  248. data/ext/bamtools/src/toolkit/bamtools_version.h.in +20 -0
  249. data/ext/bamtools/src/toolkit/cmake_install.cmake +52 -0
  250. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/CXX.includecache +250 -0
  251. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/DependInfo.cmake +29 -0
  252. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_fasta.cpp.o +0 -0
  253. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_options.cpp.o +0 -0
  254. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_pileup_engine.cpp.o +0 -0
  255. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_utilities.cpp.o +0 -0
  256. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/build.make +184 -0
  257. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/cmake_clean.cmake +14 -0
  258. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/depend.internal +40 -0
  259. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/depend.make +40 -0
  260. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/flags.make +8 -0
  261. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/link.txt +1 -0
  262. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/progress.make +5 -0
  263. data/ext/bamtools/src/utils/CMakeFiles/CMakeDirectoryInformation.cmake +23 -0
  264. data/ext/bamtools/src/utils/CMakeFiles/progress.marks +1 -0
  265. data/ext/bamtools/src/utils/CMakeLists.txt +30 -0
  266. data/ext/bamtools/src/utils/Makefile +290 -0
  267. data/ext/bamtools/src/utils/bamtools_fasta.cpp +632 -0
  268. data/ext/bamtools/src/utils/bamtools_fasta.h +47 -0
  269. data/ext/bamtools/src/utils/bamtools_filter_engine.h +552 -0
  270. data/ext/bamtools/src/utils/bamtools_filter_properties.h +195 -0
  271. data/ext/bamtools/src/utils/bamtools_filter_ruleparser.h +319 -0
  272. data/ext/bamtools/src/utils/bamtools_options.cpp +287 -0
  273. data/ext/bamtools/src/utils/bamtools_options.h +213 -0
  274. data/ext/bamtools/src/utils/bamtools_pileup_engine.cpp +327 -0
  275. data/ext/bamtools/src/utils/bamtools_pileup_engine.h +94 -0
  276. data/ext/bamtools/src/utils/bamtools_utilities.cpp +333 -0
  277. data/ext/bamtools/src/utils/bamtools_utilities.h +67 -0
  278. data/ext/bamtools/src/utils/bamtools_variant.h +128 -0
  279. data/ext/bamtools/src/utils/cmake_install.cmake +29 -0
  280. data/ext/bamtools/src/utils/utils_global.h +21 -0
  281. data/lib/ngs_server/version.rb +3 -0
  282. data/lib/ngs_server.rb +3 -0
  283. data/ngs_server.gemspec +23 -0
  284. metadata +339 -0
@@ -0,0 +1,103 @@
1
+ // ***************************************************************************
2
+ // BamMultiReader_p.h (c) 2010 Derek Barnett
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 9 September 2011 (DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Functionality for simultaneously reading multiple BAM files
8
+ // *************************************************************************
9
+
10
+ #ifndef BAMMULTIREADER_P_H
11
+ #define BAMMULTIREADER_P_H
12
+
13
+ // -------------
14
+ // W A R N I N G
15
+ // -------------
16
+ //
17
+ // This file is not part of the BamTools API. It exists purely as an
18
+ // implementation detail. This header file may change from version to version
19
+ // without notice, or even be removed.
20
+ //
21
+ // We mean it.
22
+
23
+ #include <api/SamHeader.h>
24
+ #include <api/BamMultiReader.h>
25
+ #include <string>
26
+ #include <vector>
27
+
28
+ namespace BamTools {
29
+ namespace Internal {
30
+
31
+ class IBamMultiMerger;
32
+
33
+ class BamMultiReaderPrivate {
34
+
35
+ // typedefs
36
+ public:
37
+ typedef std::pair<BamReader*, BamAlignment*> ReaderAlignment;
38
+
39
+ // constructor / destructor
40
+ public:
41
+ BamMultiReaderPrivate(void);
42
+ ~BamMultiReaderPrivate(void);
43
+
44
+ // public interface
45
+ public:
46
+
47
+ // file operations
48
+ void Close(void);
49
+ void CloseFile(const std::string& filename);
50
+ void CloseFiles(const std::vector<std::string>& filenames);
51
+ const std::vector<std::string> Filenames(void) const;
52
+ bool Jump(int refID, int position = 0);
53
+ bool Open(const std::vector<std::string>& filenames);
54
+ bool OpenFile(const std::string& filename);
55
+ void PrintFilenames(void) const;
56
+ bool Rewind(void);
57
+ bool SetRegion(const BamRegion& region);
58
+
59
+ // access alignment data
60
+ bool GetNextAlignment(BamAlignment& al);
61
+ bool GetNextAlignmentCore(BamAlignment& al);
62
+ bool HasOpenReaders(void);
63
+ void SetSortOrder(const BamMultiReader::SortOrder& order);
64
+
65
+ // access auxiliary data
66
+ SamHeader GetHeader(void) const;
67
+ std::string GetHeaderText(void) const;
68
+ int GetReferenceCount(void) const;
69
+ const BamTools::RefVector GetReferenceData(void) const;
70
+ int GetReferenceID(const std::string& refName) const;
71
+
72
+ // BAM index operations
73
+ bool CreateIndexes(const BamIndex::IndexType& type = BamIndex::STANDARD);
74
+ bool HasIndexes(void) const;
75
+ bool LocateIndexes(const BamIndex::IndexType& preferredType = BamIndex::STANDARD);
76
+ bool OpenIndexes(const std::vector<std::string>& indexFilenames);
77
+ void SetIndexCacheMode(const BamIndex::IndexCacheMode mode);
78
+
79
+ // 'internal' methods
80
+ public:
81
+ IBamMultiMerger* CreateMergerForCurrentSortOrder(void) const;
82
+ const std::string ExtractReadGroup(const std::string& headerLine) const;
83
+ bool HasAlignmentData(void) const;
84
+ bool LoadNextAlignment(BamReader* reader, BamAlignment* alignment);
85
+ ReaderAlignment OpenReader(const std::string& filename, bool* ok);
86
+ bool PopNextCachedAlignment(BamAlignment& al, const bool needCharData);
87
+ bool RewindReaders(void);
88
+ void SaveNextAlignment(BamReader* reader, BamAlignment* alignment);
89
+ const std::vector<std::string> SplitHeaderText(const std::string& headerText) const;
90
+ void UpdateAlignmentCache(void);
91
+ void ValidateReaders(void) const;
92
+
93
+ // data members
94
+ public:
95
+ std::vector<ReaderAlignment> m_readers;
96
+ IBamMultiMerger* m_alignments;
97
+ BamMultiReader::SortOrder m_sortOrder;
98
+ };
99
+
100
+ } // namespace Internal
101
+ } // namespace BamTools
102
+
103
+ #endif // BAMMULTIREADER_P_H
@@ -0,0 +1,272 @@
1
+ // ***************************************************************************
2
+ // BamRandomAccessController_p.cpp (c) 2011 Derek Barnett
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 5 April 2011(DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Manages random access operations in a BAM file
8
+ // **************************************************************************
9
+
10
+ #include <api/BamIndex.h>
11
+ #include <api/internal/BamRandomAccessController_p.h>
12
+ #include <api/internal/BamReader_p.h>
13
+ #include <api/internal/BamIndexFactory_p.h>
14
+ using namespace BamTools;
15
+ using namespace BamTools::Internal;
16
+
17
+ #include <iostream>
18
+ using namespace std;
19
+
20
+ BamRandomAccessController::BamRandomAccessController(void)
21
+ : m_index(0)
22
+ , m_indexCacheMode(BamIndex::LimitedIndexCaching)
23
+ , m_hasAlignmentsInRegion(true)
24
+ { }
25
+
26
+ BamRandomAccessController::~BamRandomAccessController(void) {
27
+ Close();
28
+ }
29
+
30
+ void BamRandomAccessController::AdjustRegion(const int& referenceCount) {
31
+
32
+ // skip if no index available
33
+ if ( m_index == 0 )
34
+ return;
35
+
36
+ // see if any references in region have alignments
37
+ m_hasAlignmentsInRegion = false;
38
+ int currentId = m_region.LeftRefID;
39
+ const int rightBoundRefId = ( m_region.isRightBoundSpecified() ? m_region.RightRefID : referenceCount - 1 );
40
+ while ( currentId <= rightBoundRefId ) {
41
+ m_hasAlignmentsInRegion = m_index->HasAlignments(currentId);
42
+ if ( m_hasAlignmentsInRegion ) break;
43
+ ++currentId;
44
+ }
45
+
46
+ // if no data found on any reference in region
47
+ if ( !m_hasAlignmentsInRegion )
48
+ return;
49
+
50
+ // if left bound of desired region had no data, use first reference that had data
51
+ // otherwise, leave requested region as-is
52
+ if ( currentId != m_region.LeftRefID ) {
53
+ m_region.LeftRefID = currentId;
54
+ m_region.LeftPosition = 0;
55
+ }
56
+ }
57
+
58
+ // returns alignments' "RegionState": { Before|Overlaps|After } current region
59
+ BamRandomAccessController::RegionState
60
+ BamRandomAccessController::AlignmentState(const BamAlignment& alignment) const {
61
+
62
+ // if region has no left bound at all
63
+ if ( !m_region.isLeftBoundSpecified() )
64
+ return OverlapsRegion;
65
+
66
+ // handle unmapped reads - return AFTER region to halt processing
67
+ if ( alignment.RefID == -1 )
68
+ return AfterRegion;
69
+
70
+ // if alignment is on any reference before left bound reference
71
+ if ( alignment.RefID < m_region.LeftRefID )
72
+ return BeforeRegion;
73
+
74
+ // if alignment is on left bound reference
75
+ else if ( alignment.RefID == m_region.LeftRefID ) {
76
+
77
+ // if alignment starts at or after left bound position
78
+ if ( alignment.Position >= m_region.LeftPosition) {
79
+
80
+ if ( m_region.isRightBoundSpecified() && // right bound is specified AND
81
+ m_region.LeftRefID == m_region.RightRefID && // left & right bounds on same reference AND
82
+ alignment.Position > m_region.RightPosition ) // alignment starts after right bound position
83
+ return AfterRegion;
84
+
85
+ // otherwise, alignment overlaps region
86
+ else return OverlapsRegion;
87
+ }
88
+
89
+ // alignment starts before left bound position
90
+ else {
91
+
92
+ // if alignment overlaps left bound position
93
+ if ( alignment.GetEndPosition() >= m_region.LeftPosition )
94
+ return OverlapsRegion;
95
+ else
96
+ return BeforeRegion;
97
+ }
98
+ }
99
+
100
+ // otherwise alignment is on a reference after left bound reference
101
+ else {
102
+
103
+ // if region has a right bound
104
+ if ( m_region.isRightBoundSpecified() ) {
105
+
106
+ // alignment is on any reference between boundaries
107
+ if ( alignment.RefID < m_region.RightRefID )
108
+ return OverlapsRegion;
109
+
110
+ // alignment is on any reference after right boundary
111
+ else if ( alignment.RefID > m_region.RightRefID )
112
+ return AfterRegion;
113
+
114
+ // alignment is on right bound reference
115
+ else {
116
+
117
+ // if alignment starts on or before right bound position
118
+ if ( alignment.Position <= m_region.RightPosition )
119
+ return OverlapsRegion;
120
+ else
121
+ return AfterRegion;
122
+ }
123
+ }
124
+
125
+ // otherwise, alignment starts after left bound and there is no right bound
126
+ else return OverlapsRegion;
127
+ }
128
+ }
129
+
130
+ void BamRandomAccessController::Close(void) {
131
+ ClearIndex();
132
+ ClearRegion();
133
+ }
134
+
135
+ void BamRandomAccessController::ClearIndex(void) {
136
+ delete m_index;
137
+ m_index = 0;
138
+ }
139
+
140
+ void BamRandomAccessController::ClearRegion(void) {
141
+ m_region.clear();
142
+ m_hasAlignmentsInRegion = true;
143
+ }
144
+
145
+ bool BamRandomAccessController::CreateIndex(BamReaderPrivate* reader,
146
+ const BamIndex::IndexType& type) {
147
+
148
+ // skip if reader is invalid
149
+ if ( reader == 0 )
150
+ return false;
151
+
152
+ // create new index of requested type
153
+ BamIndex* newIndex = BamIndexFactory::CreateIndexOfType(type, reader);
154
+ if ( newIndex == 0 ) {
155
+ cerr << "BamRandomAccessController ERROR: could not create index of type " << type << endl;
156
+ return false;
157
+ }
158
+
159
+ // attempt to build index from current BamReader file
160
+ if ( !newIndex->Create() ) {
161
+ cerr << "BamRandomAccessController ERROR: could not create index for BAM file: "
162
+ << reader->Filename() << endl;
163
+ return false;
164
+ }
165
+
166
+ // save new index
167
+ SetIndex(newIndex);
168
+
169
+ // set new index's cache mode & return success
170
+ newIndex->SetCacheMode(m_indexCacheMode);
171
+ return true;
172
+ }
173
+
174
+ bool BamRandomAccessController::HasIndex(void) const {
175
+ return ( m_index != 0 );
176
+ }
177
+
178
+ bool BamRandomAccessController::HasRegion(void) const {
179
+ return ( !m_region.isNull() );
180
+ }
181
+
182
+ bool BamRandomAccessController::IndexHasAlignmentsForReference(const int& refId) {
183
+ return m_index->HasAlignments(refId);
184
+ }
185
+
186
+ bool BamRandomAccessController::LocateIndex(BamReaderPrivate* reader,
187
+ const BamIndex::IndexType& preferredType)
188
+ {
189
+ // look up index filename, deferring to preferredType if possible
190
+ const string& indexFilename = BamIndexFactory::FindIndexFilename(reader->Filename(), preferredType);
191
+
192
+ // if no index file found (of any type)
193
+ if ( indexFilename.empty() ) {
194
+ cerr << "BamRandomAccessController WARNING: "
195
+ << "could not find index file for BAM: "
196
+ << reader->Filename() << endl;
197
+ return false;
198
+ }
199
+
200
+ // otherwise open & use index file that was found
201
+ return OpenIndex(indexFilename, reader);
202
+ }
203
+
204
+ bool BamRandomAccessController::OpenIndex(const string& indexFilename, BamReaderPrivate* reader) {
205
+
206
+ // attempt create new index of type based on filename
207
+ BamIndex* index = BamIndexFactory::CreateIndexFromFilename(indexFilename, reader);
208
+ if ( index == 0 ) {
209
+ cerr << "BamRandomAccessController ERROR: could not create index for file: " << indexFilename << endl;
210
+ return false;
211
+ }
212
+
213
+ // set cache mode
214
+ index->SetCacheMode(m_indexCacheMode);
215
+
216
+ // attempt to load data from index file
217
+ if ( !index->Load(indexFilename) ) {
218
+ cerr << "BamRandomAccessController ERROR: could not load index data from file: " << indexFilename << endl;
219
+ return false;
220
+ }
221
+
222
+ // save new index & return success
223
+ SetIndex(index);
224
+ return true;
225
+ }
226
+
227
+ bool BamRandomAccessController::RegionHasAlignments(void) const {
228
+ return m_hasAlignmentsInRegion;
229
+ }
230
+
231
+ void BamRandomAccessController::SetIndex(BamIndex* index) {
232
+ if ( m_index )
233
+ ClearIndex();
234
+ m_index = index;
235
+ }
236
+
237
+ void BamRandomAccessController::SetIndexCacheMode(const BamIndex::IndexCacheMode& mode) {
238
+ m_indexCacheMode = mode;
239
+ if ( m_index )
240
+ m_index->SetCacheMode(mode);
241
+ }
242
+
243
+ bool BamRandomAccessController::SetRegion(BamReaderPrivate* reader,
244
+ const BamRegion& region,
245
+ const int& referenceCount)
246
+ {
247
+ // store region
248
+ m_region = region;
249
+
250
+ // cannot jump when no index is available
251
+ if ( !HasIndex() )
252
+ return false;
253
+
254
+ // adjust region as necessary to reflect where data actually begins
255
+ AdjustRegion(referenceCount);
256
+
257
+ // if no data present, return true
258
+ // * Not an error, but future attempts to access alignments in this region will not return data
259
+ // Returning true is useful in a BamMultiReader setting where some BAM files may
260
+ // lack alignments in regions where other BAMs do have data.
261
+ if ( !m_hasAlignmentsInRegion )
262
+ return true;
263
+
264
+ // return success/failure of jump to specified region,
265
+ //
266
+ // * Index::Jump() is allowed to modify the m_hasAlignmentsInRegion flag
267
+ // This covers 'corner case' where a region is requested that lies beyond the last
268
+ // alignment on a reference. If this occurs, any subsequent calls to GetNextAlignment[Core]
269
+ // will not return data. BamMultiReader will still be able to successfully pull alignments
270
+ // from a region from multiple files even if one or more have no data.
271
+ return m_index->Jump(m_region, &m_hasAlignmentsInRegion);
272
+ }
@@ -0,0 +1,93 @@
1
+ // ***************************************************************************
2
+ // BamRandomAccessController_p.h (c) 2011 Derek Barnett
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 24 February 2011(DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Manages random access operations in a BAM file
8
+ // ***************************************************************************
9
+
10
+ #ifndef BAMRACONTROLLER_P_H
11
+ #define BAMRACONTROLLER_P_H
12
+
13
+ // -------------
14
+ // W A R N I N G
15
+ // -------------
16
+ //
17
+ // This file is not part of the BamTools API. It exists purely as an
18
+ // implementation detail. This header file may change from version to version
19
+ // without notice, or even be removed.
20
+ //
21
+ // We mean it.
22
+
23
+ #include <api/BamAux.h>
24
+ #include <api/BamIndex.h>
25
+
26
+ namespace BamTools {
27
+
28
+ class BamAlignment;
29
+
30
+ namespace Internal {
31
+
32
+ class BamReaderPrivate;
33
+
34
+ class BamRandomAccessController {
35
+
36
+ // enums
37
+ public: enum RegionState { BeforeRegion = 0
38
+ , OverlapsRegion
39
+ , AfterRegion
40
+ };
41
+
42
+ // ctor & dtor
43
+ public:
44
+ BamRandomAccessController(void);
45
+ ~BamRandomAccessController(void);
46
+
47
+ // general interface
48
+ public:
49
+ void Close(void);
50
+
51
+ // index operations
52
+ public:
53
+ //
54
+ void ClearIndex(void);
55
+ bool CreateIndex(BamReaderPrivate* reader, const BamIndex::IndexType& type);
56
+ bool HasIndex(void) const;
57
+ bool IndexHasAlignmentsForReference(const int& refId);
58
+ bool LocateIndex(BamReaderPrivate* reader, const BamIndex::IndexType& preferredType);
59
+ bool OpenIndex(const std::string& indexFilename, BamReaderPrivate* reader);
60
+ void SetIndex(BamIndex* index);
61
+ void SetIndexCacheMode(const BamIndex::IndexCacheMode& mode);
62
+
63
+ // region operations
64
+ public:
65
+ void ClearRegion(void);
66
+ bool HasRegion(void) const;
67
+ RegionState AlignmentState(const BamAlignment& alignment) const;
68
+ bool RegionHasAlignments(void) const;
69
+ bool SetRegion(BamReaderPrivate* reader,
70
+ const BamRegion& region,
71
+ const int& referenceCount);
72
+
73
+ // 'internal' methods
74
+ public:
75
+ // adjusts requested region if necessary (depending on where data actually begins)
76
+ void AdjustRegion(const int& referenceCount);
77
+
78
+ // data members
79
+ private:
80
+
81
+ // index data
82
+ BamIndex* m_index; // owns index, not a copy - responsible for deleting
83
+ BamIndex::IndexCacheMode m_indexCacheMode;
84
+
85
+ // region data
86
+ BamRegion m_region;
87
+ bool m_hasAlignmentsInRegion;
88
+ };
89
+
90
+ } // namespace Internal
91
+ } // namespace BamTools
92
+
93
+ #endif // BAMRACONTROLLER_P_H