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,126 @@
1
+ // ***************************************************************************
2
+ // BamMultiReader.h (c) 2010 Erik Garrison, Derek Barnett
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 15 March 2011 (DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Convenience class for reading multiple BAM files.
8
+ // ***************************************************************************
9
+
10
+ #ifndef BAMMULTIREADER_H
11
+ #define BAMMULTIREADER_H
12
+
13
+ #include <api/api_global.h>
14
+ #include <api/BamReader.h>
15
+ #include <map>
16
+ #include <sstream>
17
+ #include <string>
18
+ #include <utility>
19
+
20
+ namespace BamTools {
21
+
22
+ namespace Internal {
23
+ class BamMultiReaderPrivate;
24
+ } // namespace Internal
25
+
26
+ class API_EXPORT BamMultiReader {
27
+
28
+ public:
29
+ enum SortOrder { SortedByPosition = 0
30
+ , SortedByReadName
31
+ , Unsorted
32
+ };
33
+
34
+ // constructor / destructor
35
+ public:
36
+ BamMultiReader(void);
37
+ ~BamMultiReader(void);
38
+
39
+ // public interface
40
+ public:
41
+
42
+ // ----------------------
43
+ // BAM file operations
44
+ // ----------------------
45
+
46
+ // closes all open BAM files
47
+ void Close(void);
48
+ // close only the requested BAM file
49
+ void CloseFile(const std::string& filename);
50
+ // returns list of filenames for all open BAM files
51
+ const std::vector<std::string> Filenames(void) const;
52
+ // returns true if multireader has any open BAM files
53
+ bool HasOpenReaders(void) const;
54
+ // performs random-access jump within current BAM files
55
+ bool Jump(int refID, int position = 0);
56
+ // opens BAM files
57
+ bool Open(const std::vector<std::string>& filenames);
58
+ // opens a single BAM file, adding to any other current BAM files
59
+ bool OpenFile(const std::string& filename);
60
+ // returns file pointers to beginning of alignments
61
+ bool Rewind(void);
62
+ // sets the target region of interest
63
+ bool SetRegion(const BamRegion& region);
64
+ // sets the target region of interest
65
+ bool SetRegion(const int& leftRefID,
66
+ const int& leftPosition,
67
+ const int& rightRefID,
68
+ const int& rightPosition);
69
+
70
+ // ----------------------
71
+ // access alignment data
72
+ // ----------------------
73
+
74
+ // retrieves next available alignment
75
+ bool GetNextAlignment(BamAlignment& alignment);
76
+ // retrieves next available alignmnet (without populating the alignment's string data fields)
77
+ bool GetNextAlignmentCore(BamAlignment& alignment);
78
+
79
+ // sets the expected sorting order for reading across multiple BAM files
80
+ void SetSortOrder(const SortOrder& order);
81
+
82
+ // ----------------------
83
+ // access auxiliary data
84
+ // ----------------------
85
+
86
+ // returns unified SAM header for all files
87
+ SamHeader GetHeader(void) const;
88
+ // returns unified SAM header text for all files
89
+ std::string GetHeaderText(void) const;
90
+ // returns number of reference sequences
91
+ int GetReferenceCount(void) const;
92
+ // returns all reference sequence entries.
93
+ const BamTools::RefVector GetReferenceData(void) const;
94
+ // returns the ID of the reference with this name.
95
+ int GetReferenceID(const std::string& refName) const;
96
+
97
+ // ----------------------
98
+ // BAM index operations
99
+ // ----------------------
100
+
101
+ // creates index files for current BAM files
102
+ bool CreateIndexes(const BamIndex::IndexType& type = BamIndex::STANDARD);
103
+ // returns true if all BAM files have index data available
104
+ bool HasIndexes(void) const;
105
+ // looks for index files that match current BAM files
106
+ bool LocateIndexes(const BamIndex::IndexType& preferredType = BamIndex::STANDARD);
107
+ // opens index files for current BAM files.
108
+ bool OpenIndexes(const std::vector<std::string>& indexFilenames);
109
+ // changes the caching behavior of the index data
110
+ void SetIndexCacheMode(const BamIndex::IndexCacheMode& mode);
111
+
112
+ // deprecated methods
113
+ public:
114
+ // returns \c true if all BAM files have index data available.
115
+ bool IsIndexLoaded(void) const;
116
+ // convenience method for printing filenames to stdout
117
+ void PrintFilenames(void) const;
118
+
119
+ // private implementation
120
+ private:
121
+ Internal::BamMultiReaderPrivate* d;
122
+ };
123
+
124
+ } // namespace BamTools
125
+
126
+ #endif // BAMMULTIREADER_H
@@ -0,0 +1,369 @@
1
+ // ***************************************************************************
2
+ // BamReader.cpp (c) 2009 Derek Barnett, Michael Str�mberg
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 4 March 2011 (DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Provides read access to BAM files.
8
+ // ***************************************************************************
9
+
10
+ #include <api/BamReader.h>
11
+ #include <api/internal/BamReader_p.h>
12
+ using namespace BamTools;
13
+ using namespace BamTools::Internal;
14
+
15
+ #include <algorithm>
16
+ #include <iostream>
17
+ #include <iterator>
18
+ #include <string>
19
+ #include <vector>
20
+ using namespace std;
21
+
22
+ /*! \class BamTools::BamReader
23
+ \brief Provides read access to BAM files.
24
+ */
25
+
26
+ /*! \fn BamReader::BamReader(void)
27
+ \brief constructor
28
+ */
29
+ BamReader::BamReader(void)
30
+ : d(new BamReaderPrivate(this))
31
+ { }
32
+
33
+ /*! \fn BamReader::~BamReader(void)
34
+ \brief destructor
35
+ */
36
+ BamReader::~BamReader(void) {
37
+ delete d;
38
+ d = 0;
39
+ }
40
+
41
+ /*! \fn void BamReader::Close(void)
42
+ \brief Closes the current BAM file.
43
+
44
+ Also clears out all header and reference data.
45
+
46
+ \sa IsOpen(), Open()
47
+ */
48
+ void BamReader::Close(void) {
49
+ d->Close();
50
+ }
51
+
52
+ /*! \fn bool BamReader::CreateIndex(const BamIndex::IndexType& type)
53
+ \brief Creates an index file for current BAM file.
54
+
55
+ \param type file format to create, see BamIndex::IndexType for available formats
56
+ \return \c true if index created OK
57
+ \sa LocateIndex(), OpenIndex()
58
+ */
59
+ bool BamReader::CreateIndex(const BamIndex::IndexType& type) {
60
+ return d->CreateIndex(type);
61
+ }
62
+
63
+ /*! \fn const std::string BamReader::GetFilename(void) const
64
+ \brief Returns name of current BAM file.
65
+
66
+ Retrieved filename will contain whatever was passed via Open().
67
+ If you need full directory paths here, be sure to include them
68
+ when you open the BAM file.
69
+
70
+ \returns name of open BAM file. If no file is open, returns an empty string.
71
+ \sa IsOpen()
72
+ */
73
+ const std::string BamReader::GetFilename(void) const {
74
+ return d->Filename();
75
+ }
76
+
77
+ /*! \fn SamHeader BamReader::GetHeader(void) const
78
+ \brief Returns SAM header data.
79
+
80
+ Header data is wrapped in a SamHeader object that can be conveniently queried & modified.
81
+
82
+ N.B. - Modifying the retrieved SamHeader object does NOT affect the
83
+ current BAM file. This file has been opened in a read-only mode.
84
+ However, your modified SamHeader object can be used in conjunction with
85
+ BamWriter to generate a new BAM file with the appropriate header information.
86
+
87
+ \returns header data object
88
+ \sa GetHeaderText()
89
+ */
90
+ SamHeader BamReader::GetHeader(void) const {
91
+ return d->GetSamHeader();
92
+ }
93
+
94
+ /*! \fn std::string BamReader::GetHeaderText(void) const
95
+ \brief Returns SAM header data, as SAM-formatted text.
96
+
97
+ N.B. - Modifying the retrieved text does NOT affect the current
98
+ BAM file. This file has been opened in a read-only mode. However,
99
+ your modified header text can be used in conjunction with BamWriter
100
+ to generate a new BAM file with the appropriate header information.
101
+
102
+ \returns SAM-formatted header text
103
+ \sa GetHeader()
104
+ */
105
+ std::string BamReader::GetHeaderText(void) const {
106
+ return d->GetHeaderText();
107
+ }
108
+
109
+ /*! \fn bool BamReader::GetNextAlignment(BamAlignment& alignment)
110
+ \brief Retrieves next available alignment.
111
+
112
+ Attempts to read the next alignment record from BAM file, and checks to see
113
+ if it overlaps the current region. If no region is currently set, then the
114
+ next alignment available is always considered valid.
115
+
116
+ If a region has been set, via Jump() or SetRegion(), an alignment is only
117
+ considered valid if it overlaps the region. If the actual 'next' alignment record
118
+ in the BAM file does not overlap this region, then this function will read sequentially
119
+ through the file until the next alignment that overlaps this region is found.
120
+ Once the region has been exhausted (i.e. the next alignment loaded is beyond the region),
121
+ the function aborts and returns \c false. In this case, there is no point to continue
122
+ reading, assuming properly sorted alignments.
123
+
124
+ This function fully populates all of the alignment's available data fields,
125
+ including the string data fields (read name, bases, qualities, tags, filename).
126
+ If only positional data (refID, position, CIGAR ops, alignment flags, etc.)
127
+ are required, consider using GetNextAlignmentCore() for a significant
128
+ performance boost.
129
+
130
+ \param alignment destination for alignment record data
131
+ \returns \c true if a valid alignment was found
132
+ */
133
+ bool BamReader::GetNextAlignment(BamAlignment& alignment) {
134
+ return d->GetNextAlignment(alignment);
135
+ }
136
+
137
+ /*! \fn bool BamReader::GetNextAlignmentCore(BamAlignment& alignment)
138
+ \brief Retrieves next available alignment, without populating the alignment's string data fields.
139
+
140
+ Equivalent to GetNextAlignment() with respect to what is a valid overlapping alignment.
141
+
142
+ However, this method does NOT populate the alignment's string data fields
143
+ (read name, bases, qualities, tags, filename). This provides a boost in speed
144
+ when these fields are not required for every alignment. These fields can be
145
+ populated 'lazily' (as needed) by calling BamAlignment::BuildCharData() later.
146
+
147
+ \param alignment destination for alignment record data
148
+ \returns \c true if a valid alignment was found
149
+ \sa SetRegion()
150
+ */
151
+ bool BamReader::GetNextAlignmentCore(BamAlignment& alignment) {
152
+ return d->GetNextAlignmentCore(alignment);
153
+ }
154
+
155
+ /*! \fn int BamReader::GetReferenceCount(void) const
156
+ \brief Returns number of reference sequences.
157
+ */
158
+ int BamReader::GetReferenceCount(void) const {
159
+ return d->GetReferenceCount();
160
+ }
161
+
162
+ /*! \fn const RefVector& BamReader::GetReferenceData(void) const
163
+ \brief Returns all reference sequence entries.
164
+ \sa RefData
165
+ */
166
+ const RefVector& BamReader::GetReferenceData(void) const {
167
+ return d->GetReferenceData();
168
+ }
169
+
170
+ /*! \fn int BamReader::GetReferenceID(const std::string& refName) const
171
+ \brief Returns the ID of the reference with this name.
172
+
173
+ If \a refName is not found, returns -1.
174
+ */
175
+ int BamReader::GetReferenceID(const std::string& refName) const {
176
+ return d->GetReferenceID(refName);
177
+ }
178
+
179
+ /*! \fn bool BamReader::HasIndex(void) const
180
+ \brief Returns \c true if index data is available.
181
+ */
182
+ bool BamReader::HasIndex(void) const {
183
+ return d->HasIndex();
184
+ }
185
+
186
+ /*! \fn bool BamReader::IsIndexLoaded(void) const
187
+ \brief Returns \c true if index data is available.
188
+
189
+ \deprecated Instead use HasIndex()
190
+ \cond
191
+ Deprecated purely for API semantic clarity - HasIndex() should be clearer
192
+ than IsIndexLoaded() in light of the new caching modes that may clear the
193
+ index data from memory, but leave the index file open for later random access
194
+ seeks.
195
+
196
+ For example, what would (IsIndexLoaded() == true) mean when cacheMode has been
197
+ explicitly set to NoIndexCaching? This is confusing at best, misleading about
198
+ current memory behavior at worst.
199
+ \endcond
200
+ */
201
+ bool BamReader::IsIndexLoaded(void) const {
202
+ return d->HasIndex();
203
+ }
204
+
205
+ /*! \fn bool BamReader::IsOpen(void) const
206
+ \brief Returns \c true if a BAM file is open for reading.
207
+ */
208
+ bool BamReader::IsOpen(void) const {
209
+ return d->IsOpen();
210
+ }
211
+
212
+ /*! \fn bool BamReader::Jump(int refID, int position)
213
+ \brief Performs a random-access jump within BAM file.
214
+
215
+ This is a convenience method, equivalent to calling SetRegion()
216
+ with only a left boundary specified.
217
+
218
+ \returns \c true if jump was successful
219
+ \sa HasIndex()
220
+ */
221
+ bool BamReader::Jump(int refID, int position) {
222
+ return d->SetRegion( BamRegion(refID, position) );
223
+ }
224
+
225
+ /*! \fn bool BamReader::LocateIndex(const BamIndex::IndexType& preferredType)
226
+ \brief Looks in BAM file's directory for a matching index file.
227
+
228
+ Use this function when you need an index file, and perhaps have a
229
+ preferred index format, but do not depend heavily on which format
230
+ actually gets loaded at runtime.
231
+
232
+ This function will defer to your \a preferredType whenever possible.
233
+ However, if an index file of \a preferredType can not be found, then
234
+ it will look for any other index file that corresponds to this BAM file.
235
+
236
+ If you want precise control over which index file is loaded, use OpenIndex()
237
+ with the desired index filename. If that function returns false, you can use
238
+ CreateIndex() to then build an index of the exact requested format.
239
+
240
+ \param preferredType desired index file format, see BamIndex::IndexType for available formats
241
+ \returns \c true if (any) index file could be found
242
+ */
243
+ bool BamReader::LocateIndex(const BamIndex::IndexType& preferredType) {
244
+ return d->LocateIndex(preferredType);
245
+ }
246
+
247
+ /*! \fn bool BamReader::Open(const std::string& filename)
248
+ \brief Opens a BAM file.
249
+
250
+ If BamReader is already opened on another file, this function closes
251
+ that file, then attempts to open requested \a filename.
252
+
253
+ \param filename name of BAM file to open
254
+ \returns \c true if BAM file was opened successfully
255
+ \sa Close(), IsOpen(), OpenIndex()
256
+ */
257
+ bool BamReader::Open(const std::string& filename) {
258
+ return d->Open(filename);
259
+ }
260
+
261
+ /*! \fn bool BamReader::OpenIndex(const std::string& indexFilename)
262
+ \brief Opens a BAM index file.
263
+
264
+ \param indexFilename name of BAM index file
265
+
266
+ \returns \c true if BAM index file was opened & data loaded successfully
267
+ \sa LocateIndex(), Open(), SetIndex()
268
+ */
269
+ bool BamReader::OpenIndex(const std::string& indexFilename) {
270
+ return d->OpenIndex(indexFilename);
271
+ }
272
+
273
+ /*! \fn bool BamReader::Rewind(void)
274
+ \brief Returns the internal file pointer to the first alignment record.
275
+
276
+ Useful for performing multiple sequential passes through a BAM file.
277
+ Calling this function clears any prior region that may have been set.
278
+
279
+ N.B. - Note that this function sets the file pointer to first alignment record
280
+ in the BAM file, NOT the beginning of the file.
281
+
282
+ \returns \c true if rewind operation was successful
283
+ \sa Jump(), SetRegion()
284
+ */
285
+ bool BamReader::Rewind(void) {
286
+ return d->Rewind();
287
+ }
288
+
289
+ /*! \fn void BamReader::SetIndex(BamIndex* index)
290
+ \brief Sets a custom BamIndex on this reader.
291
+
292
+ Only necessary for custom BamIndex subclasses. Most clients should
293
+ never have to use this function.
294
+
295
+ Example:
296
+ \code
297
+ BamReader reader;
298
+ reader.SetIndex(new MyCustomBamIndex);
299
+ \endcode
300
+
301
+ N.B. - BamReader takes ownership of \a index - i.e. BamReader will
302
+ take care of deleting the pointer when the reader is destructed,
303
+ when the current BAM file is closed, or when a new index is requested.
304
+
305
+ \param index custom BamIndex subclass created by client
306
+ \sa CreateIndex(), LocateIndex(), OpenIndex()
307
+ */
308
+ void BamReader::SetIndex(BamIndex* index) {
309
+ d->SetIndex(index);
310
+ }
311
+
312
+ /*! \fn void BamReader::SetIndexCacheMode(const BamIndex::IndexCacheMode& mode)
313
+ \brief Changes the caching behavior of the index data.
314
+
315
+ Default mode is BamIndex::LimitedIndexCaching.
316
+
317
+ \param mode desired cache mode for index, see BamIndex::IndexCacheMode for
318
+ description of the available cache modes
319
+ \sa HasIndex()
320
+ */
321
+ void BamReader::SetIndexCacheMode(const BamIndex::IndexCacheMode& mode) {
322
+ d->SetIndexCacheMode(mode);
323
+ }
324
+
325
+ /*! \fn bool BamReader::SetRegion(const BamRegion& region)
326
+ \brief Sets a target region of interest
327
+
328
+ Requires that index data be available. Attempts a random-access
329
+ jump in the BAM file, near \a region left boundary position.
330
+
331
+ Subsequent calls to GetNextAlignment() or GetNextAlignmentCore()
332
+ will only return \c true when alignments can be found that overlap
333
+ this \a region.
334
+
335
+ A \a region with no right boundary is considered open-ended, meaning
336
+ that all alignments that lie downstream of the left boundary are
337
+ considered valid, continuing to the end of the BAM file.
338
+
339
+ \param region desired region-of-interest to activate
340
+ \returns \c true if reader was able to jump successfully to the region's left boundary
341
+ \sa HasIndex(), Jump()
342
+ */
343
+ bool BamReader::SetRegion(const BamRegion& region) {
344
+ return d->SetRegion(region);
345
+ }
346
+
347
+ /*! \fn bool BamReader::SetRegion(const int& leftRefID,
348
+ const int& leftPosition,
349
+ const int& rightRefID,
350
+ const int& rightPosition)
351
+ \brief Sets a target region of interest.
352
+
353
+ This is an overloaded function.
354
+
355
+ \param leftRefID referenceID of region's left boundary
356
+ \param leftPosition position of region's left boundary
357
+ \param rightRefID reference ID of region's right boundary
358
+ \param rightPosition position of region's right boundary
359
+
360
+ \returns \c true if reader was able to jump successfully to the region's left boundary
361
+ \sa HasIndex(), Jump()
362
+ */
363
+ bool BamReader::SetRegion(const int& leftRefID,
364
+ const int& leftBound,
365
+ const int& rightRefID,
366
+ const int& rightBound)
367
+ {
368
+ return d->SetRegion( BamRegion(leftRefID, leftBound, rightRefID, rightBound) );
369
+ }
@@ -0,0 +1,117 @@
1
+ // ***************************************************************************
2
+ // BamReader.h (c) 2009 Derek Barnett, Michael Str�mberg
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 4 March 2011 (DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Provides read access to BAM files.
8
+ // ***************************************************************************
9
+
10
+ #ifndef BAMREADER_H
11
+ #define BAMREADER_H
12
+
13
+ #include <api/api_global.h>
14
+ #include <api/BamAlignment.h>
15
+ #include <api/BamIndex.h>
16
+ #include <api/SamHeader.h>
17
+ #include <string>
18
+
19
+ namespace BamTools {
20
+
21
+ namespace Internal {
22
+ class BamReaderPrivate;
23
+ } // namespace Internal
24
+
25
+ class API_EXPORT BamReader {
26
+
27
+ // constructor / destructor
28
+ public:
29
+ BamReader(void);
30
+ ~BamReader(void);
31
+
32
+ // public interface
33
+ public:
34
+
35
+ // ----------------------
36
+ // BAM file operations
37
+ // ----------------------
38
+
39
+ // closes the current BAM file
40
+ void Close(void);
41
+ // returns filename of current BAM file
42
+ const std::string GetFilename(void) const;
43
+ // returns true if a BAM file is open for reading
44
+ bool IsOpen(void) const;
45
+ // performs random-access jump within BAM file
46
+ bool Jump(int refID, int position = 0);
47
+ // opens a BAM file
48
+ bool Open(const std::string& filename);
49
+ // returns internal file pointer to beginning of alignment data
50
+ bool Rewind(void);
51
+ // sets the target region of interest
52
+ bool SetRegion(const BamRegion& region);
53
+ // sets the target region of interest
54
+ bool SetRegion(const int& leftRefID,
55
+ const int& leftPosition,
56
+ const int& rightRefID,
57
+ const int& rightPosition);
58
+
59
+ // ----------------------
60
+ // access alignment data
61
+ // ----------------------
62
+
63
+ // retrieves next available alignment
64
+ bool GetNextAlignment(BamAlignment& alignment);
65
+ // retrieves next available alignmnet (without populating the alignment's string data fields)
66
+ bool GetNextAlignmentCore(BamAlignment& alignment);
67
+
68
+ // ----------------------
69
+ // access header data
70
+ // ----------------------
71
+
72
+ // returns SAM header data
73
+ SamHeader GetHeader(void) const;
74
+ // returns SAM header data, as SAM-formatted text
75
+ std::string GetHeaderText(void) const;
76
+
77
+ // ----------------------
78
+ // access reference data
79
+ // ----------------------
80
+
81
+ // returns the number of reference sequences
82
+ int GetReferenceCount(void) const;
83
+ // returns all reference sequence entries
84
+ const RefVector& GetReferenceData(void) const;
85
+ // returns the ID of the reference with this name
86
+ int GetReferenceID(const std::string& refName) const;
87
+
88
+ // ----------------------
89
+ // BAM index operations
90
+ // ----------------------
91
+
92
+ // creates an index file for current BAM file, using the requested index type
93
+ bool CreateIndex(const BamIndex::IndexType& type = BamIndex::STANDARD);
94
+ // returns true if index data is available
95
+ bool HasIndex(void) const;
96
+ // looks in BAM file's directory for a matching index file
97
+ bool LocateIndex(const BamIndex::IndexType& preferredType = BamIndex::STANDARD);
98
+ // opens a BAM index file
99
+ bool OpenIndex(const std::string& indexFilename);
100
+ // sets a custom BamIndex on this reader
101
+ void SetIndex(BamIndex* index);
102
+ // changes the caching behavior of the index data
103
+ void SetIndexCacheMode(const BamIndex::IndexCacheMode& mode);
104
+
105
+ // deprecated methods
106
+ public:
107
+ // returns true if index data is available
108
+ bool IsIndexLoaded(void) const;
109
+
110
+ // private implementation
111
+ private:
112
+ Internal::BamReaderPrivate* d;
113
+ };
114
+
115
+ } // namespace BamTools
116
+
117
+ #endif // BAMREADER_H