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,327 @@
1
+ // ***************************************************************************
2
+ // bamtools_pileup_engine.cpp (c) 2010 Derek Barnett, Erik Garrison
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 19 November 2010
6
+ // ---------------------------------------------------------------------------
7
+ // Provides pileup at position functionality for various tools.
8
+ // ***************************************************************************
9
+
10
+ #include <utils/bamtools_pileup_engine.h>
11
+ using namespace BamTools;
12
+
13
+ #include <iostream>
14
+ using namespace std;
15
+
16
+ // ---------------------------------------------
17
+ // PileupEnginePrivate implementation
18
+
19
+ struct PileupEngine::PileupEnginePrivate {
20
+
21
+ // data members
22
+ int CurrentId;
23
+ int CurrentPosition;
24
+ vector<BamAlignment> CurrentAlignments;
25
+ PileupPosition CurrentPileupData;
26
+
27
+ bool IsFirstAlignment;
28
+ vector<PileupVisitor*> Visitors;
29
+
30
+ // ctor & dtor
31
+ PileupEnginePrivate(void)
32
+ : CurrentId(-1)
33
+ , CurrentPosition(-1)
34
+ , IsFirstAlignment(true)
35
+ { }
36
+ ~PileupEnginePrivate(void) { }
37
+
38
+ // 'public' methods
39
+ bool AddAlignment(const BamAlignment& al);
40
+ void Flush(void);
41
+
42
+ // internal methods
43
+ private:
44
+ void ApplyVisitors(void);
45
+ void ClearOldData(void);
46
+ void CreatePileupData(void);
47
+ void ParseAlignmentCigar(const BamAlignment& al);
48
+ };
49
+
50
+ bool PileupEngine::PileupEnginePrivate::AddAlignment(const BamAlignment& al) {
51
+
52
+ // if first time
53
+ if ( IsFirstAlignment ) {
54
+
55
+ // set initial markers
56
+ CurrentId = al.RefID;
57
+ CurrentPosition = al.Position;
58
+
59
+ // store first entry
60
+ CurrentAlignments.clear();
61
+ CurrentAlignments.push_back(al);
62
+
63
+ // set flag & return
64
+ IsFirstAlignment = false;
65
+ return true;
66
+ }
67
+
68
+ // if same reference
69
+ if ( al.RefID == CurrentId ) {
70
+
71
+ // if same position, store and move on
72
+ if ( al.Position == CurrentPosition )
73
+ CurrentAlignments.push_back(al);
74
+
75
+ // if less than CurrentPosition - sorting error => ABORT
76
+ else if ( al.Position < CurrentPosition ) {
77
+ cerr << "Pileup::Run() : Data not sorted correctly!" << endl;
78
+ return false;
79
+ }
80
+
81
+ // else print pileup data until 'catching up' to CurrentPosition
82
+ else {
83
+ while ( al.Position > CurrentPosition ) {
84
+ ApplyVisitors();
85
+ ++CurrentPosition;
86
+ }
87
+ CurrentAlignments.push_back(al);
88
+ }
89
+ }
90
+
91
+ // if reference ID less than CurrentId - sorting error => ABORT
92
+ else if ( al.RefID < CurrentId ) {
93
+ cerr << "Pileup::Run() : Data not sorted correctly!" << endl;
94
+ return false;
95
+ }
96
+
97
+ // else moved forward onto next reference
98
+ else {
99
+
100
+ // print any remaining pileup data from previous reference
101
+ while ( !CurrentAlignments.empty() ) {
102
+ ApplyVisitors();
103
+ ++CurrentPosition;
104
+ }
105
+
106
+ // store first entry on this new reference, update markers
107
+ CurrentAlignments.clear();
108
+ CurrentAlignments.push_back(al);
109
+ CurrentId = al.RefID;
110
+ CurrentPosition = al.Position;
111
+ }
112
+
113
+ return true;
114
+ }
115
+
116
+ void PileupEngine::PileupEnginePrivate::ApplyVisitors(void) {
117
+
118
+ // parse CIGAR data in BamAlignments to build up current pileup data
119
+ CreatePileupData();
120
+
121
+ // apply all visitors to current alignment set
122
+ vector<PileupVisitor*>::const_iterator visitorIter = Visitors.begin();
123
+ vector<PileupVisitor*>::const_iterator visitorEnd = Visitors.end();
124
+ for ( ; visitorIter != visitorEnd; ++visitorIter )
125
+ (*visitorIter)->Visit(CurrentPileupData);
126
+ }
127
+
128
+ void PileupEngine::PileupEnginePrivate::ClearOldData(void) {
129
+
130
+ // remove any data that ends before CurrentPosition
131
+ size_t i = 0;
132
+ while ( i < CurrentAlignments.size() ) {
133
+
134
+ // remove alignment if it ends before CurrentPosition
135
+ const int endPosition = CurrentAlignments[i].GetEndPosition();
136
+ if ( endPosition < CurrentPosition )
137
+ CurrentAlignments.erase(CurrentAlignments.begin() + i);
138
+ else
139
+ ++i;
140
+ }
141
+ }
142
+
143
+ void PileupEngine::PileupEnginePrivate::CreatePileupData(void) {
144
+
145
+ // remove any non-overlapping alignments
146
+ ClearOldData();
147
+
148
+ // set pileup refId, position to current markers
149
+ CurrentPileupData.RefId = CurrentId;
150
+ CurrentPileupData.Position = CurrentPosition;
151
+ CurrentPileupData.PileupAlignments.clear();
152
+
153
+ // parse CIGAR data in remaining alignments
154
+ vector<BamAlignment>::const_iterator alIter = CurrentAlignments.begin();
155
+ vector<BamAlignment>::const_iterator alEnd = CurrentAlignments.end();
156
+ for ( ; alIter != alEnd; ++alIter )
157
+ ParseAlignmentCigar( (*alIter) );
158
+ }
159
+
160
+ void PileupEngine::PileupEnginePrivate::Flush(void) {
161
+ while ( !CurrentAlignments.empty() ) {
162
+ ApplyVisitors();
163
+ ++CurrentPosition;
164
+ }
165
+ }
166
+
167
+ void PileupEngine::PileupEnginePrivate::ParseAlignmentCigar(const BamAlignment& al) {
168
+
169
+ // skip if unmapped
170
+ if ( !al.IsMapped() ) return;
171
+
172
+ // intialize local variables
173
+ int genomePosition = al.Position;
174
+ int positionInAlignment = 0;
175
+ bool isNewReadSegment = true;
176
+ bool saveAlignment = true;
177
+ PileupAlignment pileupAlignment(al);
178
+
179
+ // iterate over CIGAR operations
180
+ const int numCigarOps = (const int)al.CigarData.size();
181
+ for (int i = 0; i < numCigarOps; ++i ) {
182
+ const CigarOp& op = al.CigarData.at(i);
183
+
184
+ // if op is MATCH
185
+ if ( op.Type == 'M' ) {
186
+
187
+ // if match op overlaps current position
188
+ if ( genomePosition + (int)op.Length > CurrentPosition ) {
189
+
190
+ // set pileup data
191
+ pileupAlignment.IsCurrentDeletion = false;
192
+ pileupAlignment.IsNextDeletion = false;
193
+ pileupAlignment.IsNextInsertion = false;
194
+ pileupAlignment.PositionInAlignment = positionInAlignment + (CurrentPosition - genomePosition);
195
+
196
+ // check for beginning of read segment
197
+ if ( genomePosition == CurrentPosition && isNewReadSegment )
198
+ pileupAlignment.IsSegmentBegin = true;
199
+
200
+ // if we're at the end of a match operation
201
+ if ( genomePosition + (int)op.Length - 1 == CurrentPosition ) {
202
+
203
+ // if not last operation
204
+ if ( i < numCigarOps - 1 ) {
205
+
206
+ // check next CIGAR op
207
+ const CigarOp& nextOp = al.CigarData.at(i+1);
208
+
209
+ // if next CIGAR op is DELETION
210
+ if ( nextOp.Type == 'D') {
211
+ pileupAlignment.IsNextDeletion = true;
212
+ pileupAlignment.DeletionLength = nextOp.Length;
213
+ }
214
+
215
+ // if next CIGAR op is INSERTION
216
+ else if ( nextOp.Type == 'I' ) {
217
+ pileupAlignment.IsNextInsertion = true;
218
+ pileupAlignment.InsertionLength = nextOp.Length;
219
+ }
220
+
221
+ // if next CIGAR op is either DELETION or INSERTION
222
+ if ( nextOp.Type == 'D' || nextOp.Type == 'I' ) {
223
+
224
+ // if there is a CIGAR op after the DEL/INS
225
+ if ( i < numCigarOps - 2 ) {
226
+ const CigarOp& nextNextOp = al.CigarData.at(i+2);
227
+
228
+ // if next CIGAR op is clipping or ref_skip
229
+ if ( nextNextOp.Type == 'S' ||
230
+ nextNextOp.Type == 'N' ||
231
+ nextNextOp.Type == 'H' )
232
+ pileupAlignment.IsSegmentEnd = true;
233
+ }
234
+ else {
235
+ pileupAlignment.IsSegmentEnd = true;
236
+
237
+ // if next CIGAR op is clipping or ref_skip
238
+ if ( nextOp.Type == 'S' ||
239
+ nextOp.Type == 'N' ||
240
+ nextOp.Type == 'H' )
241
+ pileupAlignment.IsSegmentEnd = true;
242
+ }
243
+ }
244
+
245
+ // otherwise
246
+ else {
247
+
248
+ // if next CIGAR op is clipping or ref_skip
249
+ if ( nextOp.Type == 'S' ||
250
+ nextOp.Type == 'N' ||
251
+ nextOp.Type == 'H' )
252
+ pileupAlignment.IsSegmentEnd = true;
253
+ }
254
+ }
255
+
256
+ // else this is last operation
257
+ else pileupAlignment.IsSegmentEnd = true;
258
+ }
259
+ }
260
+
261
+ // increment markers
262
+ genomePosition += op.Length;
263
+ positionInAlignment += op.Length;
264
+ }
265
+
266
+ // if op is DELETION
267
+ else if ( op.Type == 'D' ) {
268
+
269
+ // if deletion op overlaps current position
270
+ if ( genomePosition + (int)op.Length > CurrentPosition ) {
271
+
272
+ // set pileup data
273
+ pileupAlignment.IsCurrentDeletion = true;
274
+ pileupAlignment.IsNextDeletion = false;
275
+ pileupAlignment.IsNextInsertion = true;
276
+ pileupAlignment.PositionInAlignment = positionInAlignment + (CurrentPosition - genomePosition);
277
+ }
278
+
279
+ // increment marker
280
+ genomePosition += op.Length;
281
+ }
282
+
283
+ // if op is REF_SKIP
284
+ else if ( op.Type == 'N' ) {
285
+ genomePosition += op.Length;
286
+ }
287
+
288
+ // if op is INSERTION or SOFT_CLIP
289
+ else if ( op.Type == 'I' || op.Type == 'S' ) {
290
+ positionInAlignment += op.Length;
291
+ }
292
+
293
+ // checl for beginning of new read segment
294
+ if ( op.Type == 'N' ||
295
+ op.Type == 'S' ||
296
+ op.Type == 'H' )
297
+ isNewReadSegment = true;
298
+ else
299
+ isNewReadSegment = false;
300
+
301
+ // if we've moved beyond current position
302
+ if ( genomePosition > CurrentPosition ) {
303
+ if ( op.Type == 'N' ) saveAlignment = false; // ignore alignment if REF_SKIP
304
+ break;
305
+ }
306
+ }
307
+
308
+ // save pileup position if flag is true
309
+ if ( saveAlignment )
310
+ CurrentPileupData.PileupAlignments.push_back( pileupAlignment );
311
+ }
312
+
313
+ // ---------------------------------------------
314
+ // PileupEngine implementation
315
+
316
+ PileupEngine::PileupEngine(void)
317
+ : d( new PileupEnginePrivate )
318
+ { }
319
+
320
+ PileupEngine::~PileupEngine(void) {
321
+ delete d;
322
+ d = 0;
323
+ }
324
+
325
+ bool PileupEngine::AddAlignment(const BamAlignment& al) { return d->AddAlignment(al); }
326
+ void PileupEngine::AddVisitor(PileupVisitor* visitor) { d->Visitors.push_back(visitor); }
327
+ void PileupEngine::Flush(void) { d->Flush(); }
@@ -0,0 +1,94 @@
1
+ // ***************************************************************************
2
+ // bamtools_pileup_engine.h (c) 2010 Derek Barnett, Erik Garrison
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 18 September 2010
6
+ // ---------------------------------------------------------------------------
7
+ // Provides pileup at position functionality for various tools.
8
+ // ***************************************************************************
9
+
10
+ #ifndef BAMTOOLS_PILEUP_ENGINE_H
11
+ #define BAMTOOLS_PILEUP_ENGINE_H
12
+
13
+ #include <api/BamAlignment.h>
14
+ #include <utils/utils_global.h>
15
+ #include <vector>
16
+
17
+ namespace BamTools {
18
+
19
+ // contains auxiliary data about a single BamAlignment
20
+ // at current position considered
21
+ struct UTILS_EXPORT PileupAlignment {
22
+
23
+ // data members
24
+ BamAlignment Alignment;
25
+ int32_t PositionInAlignment;
26
+ bool IsCurrentDeletion;
27
+ bool IsNextDeletion;
28
+ bool IsNextInsertion;
29
+ int DeletionLength;
30
+ int InsertionLength;
31
+ bool IsSegmentBegin;
32
+ bool IsSegmentEnd;
33
+
34
+ // ctor
35
+ PileupAlignment(const BamAlignment& al)
36
+ : Alignment(al)
37
+ , PositionInAlignment(-1)
38
+ , IsCurrentDeletion(false)
39
+ , IsNextDeletion(false)
40
+ , IsNextInsertion(false)
41
+ , DeletionLength(0)
42
+ , InsertionLength(0)
43
+ , IsSegmentBegin(false)
44
+ , IsSegmentEnd(false)
45
+ { }
46
+ };
47
+
48
+ // contains all data at a position
49
+ struct UTILS_EXPORT PileupPosition {
50
+
51
+ // data members
52
+ int RefId;
53
+ int Position;
54
+ std::vector<PileupAlignment> PileupAlignments;
55
+
56
+ // ctor
57
+ PileupPosition(const int& refId = 0,
58
+ const int& position = 0,
59
+ const std::vector<PileupAlignment>& alignments = std::vector<PileupAlignment>())
60
+ : RefId(refId)
61
+ , Position(position)
62
+ , PileupAlignments(alignments)
63
+ { }
64
+ };
65
+
66
+ class UTILS_EXPORT PileupVisitor {
67
+
68
+ public:
69
+ PileupVisitor(void) { }
70
+ virtual ~PileupVisitor(void) { }
71
+
72
+ public:
73
+ virtual void Visit(const PileupPosition& pileupData) =0;
74
+ };
75
+
76
+ class UTILS_EXPORT PileupEngine {
77
+
78
+ public:
79
+ PileupEngine(void);
80
+ ~PileupEngine(void);
81
+
82
+ public:
83
+ bool AddAlignment(const BamAlignment& al);
84
+ void AddVisitor(PileupVisitor* visitor);
85
+ void Flush(void);
86
+
87
+ private:
88
+ struct PileupEnginePrivate;
89
+ PileupEnginePrivate* d;
90
+ };
91
+
92
+ } // namespace BamTools
93
+
94
+ #endif // BAMTOOLS_PILEUP_ENGINE_H