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,68 @@
1
+ // ***************************************************************************
2
+ // SamReadGroup.h (c) 2010 Derek Barnett
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 18 April 2011 (DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Provides direct read/write access to the SAM read group data fields.
8
+ // ***************************************************************************
9
+
10
+ #ifndef SAM_READGROUP_H
11
+ #define SAM_READGROUP_H
12
+
13
+ #include "api/api_global.h"
14
+ #include <string>
15
+
16
+ namespace BamTools {
17
+
18
+ struct API_EXPORT SamReadGroup {
19
+
20
+ // ctor & dtor
21
+ SamReadGroup(void);
22
+ SamReadGroup(const std::string& id);
23
+ SamReadGroup(const SamReadGroup& other);
24
+ ~SamReadGroup(void);
25
+
26
+ // query/modify entire read group
27
+ void Clear(void); // clears all data fields
28
+
29
+ // convenience query methods
30
+ bool HasDescription(void) const; // returns true if read group has a description
31
+ bool HasFlowOrder(void) const; // returns true if read group has a flow order entry
32
+ bool HasID(void) const; // returns true if read group has a group ID
33
+ bool HasKeySequence(void) const; // returns true if read group has a key sequence
34
+ bool HasLibrary(void) const; // returns true if read group has a library name
35
+ bool HasPlatformUnit(void) const; // returns true if read group has a platform unit ID
36
+ bool HasPredictedInsertSize(void) const; // returns true if read group has a predicted insert size
37
+ bool HasProductionDate(void) const; // returns true if read group has a production date
38
+ bool HasProgram(void) const; // returns true if read group has a program entry
39
+ bool HasSample(void) const; // returns true if read group has a sample name
40
+ bool HasSequencingCenter(void) const; // returns true if read group has a sequencing center ID
41
+ bool HasSequencingTechnology(void) const; // returns true if read group has a sequencing technology ID
42
+
43
+
44
+ // data fields
45
+ std::string Description; // DS:<Description>
46
+ std::string FlowOrder; // FO:<FlowOrder>
47
+ std::string ID; // ID:<ID> *Required for valid SAM header*
48
+ std::string KeySequence; // KS:<KeySequence>
49
+ std::string Library; // LB:<Library>
50
+ std::string PlatformUnit; // PU:<PlatformUnit>
51
+ std::string PredictedInsertSize; // PI:<PredictedInsertSize>
52
+ std::string ProductionDate; // DT:<ProductionDate>
53
+ std::string Program; // PG:<Program>
54
+ std::string Sample; // SM:<Sample>
55
+ std::string SequencingCenter; // CN:<SequencingCenter>
56
+ std::string SequencingTechnology; // PL:<SequencingTechnology>
57
+ };
58
+
59
+ /*! \fn bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs)
60
+ \brief tests equality by comparing read group IDs
61
+ */
62
+ API_EXPORT inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) {
63
+ return lhs.ID == rhs.ID;
64
+ }
65
+
66
+ } // namespace BamTools
67
+
68
+ #endif // SAM_READGROUP_H
@@ -0,0 +1,289 @@
1
+ // ***************************************************************************
2
+ // SamReadGroupDictionary.cpp (c) 2010 Derek Barnett
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 18 April 2011 (DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Provides methods for operating on a collection of SamReadGroup entries.
8
+ // ***************************************************************************
9
+
10
+ #include <api/SamReadGroupDictionary.h>
11
+ using namespace BamTools;
12
+
13
+ #include <algorithm>
14
+ #include <iostream>
15
+ using namespace std;
16
+
17
+ /*! \class BamTools::SamReadGroupDictionary
18
+ \brief Container of SamReadGroup entries.
19
+
20
+ Provides methods for operating on a collection of SamReadGroup entries.
21
+ */
22
+
23
+ /*! \fn SamReadGroupDictionary::SamReadGroupDictionary(void)
24
+ \brief constructor
25
+ */
26
+ SamReadGroupDictionary::SamReadGroupDictionary(void) { }
27
+
28
+ /*! \fn SamReadGroupDictionary::SamReadGroupDictionary(const SamReadGroupDictionary& other)
29
+ \brief copy constructor
30
+ */
31
+ SamReadGroupDictionary::SamReadGroupDictionary(const SamReadGroupDictionary& other)
32
+ : m_data(other.m_data)
33
+ { }
34
+
35
+ /*! \fn SamReadGroupDictionary::~SamReadGroupDictionary(void)
36
+ \brief destructor
37
+ */
38
+ SamReadGroupDictionary::~SamReadGroupDictionary(void) { }
39
+
40
+ /*! \fn void SamReadGroupDictionary::Add(const SamReadGroup& readGroup)
41
+ \brief Adds a read group to the dictionary.
42
+
43
+ Duplicate entries are silently discarded.
44
+
45
+ \param readGroup entry to be added
46
+ */
47
+ void SamReadGroupDictionary::Add(const SamReadGroup& readGroup) {
48
+
49
+ // TODO: report error on attempted duplicate?
50
+
51
+ if ( IsEmpty() || !Contains(readGroup) )
52
+ m_data.push_back(readGroup);
53
+ }
54
+
55
+ /*! \fn void SamReadGroupDictionary::Add(const std::string& readGroupId)
56
+ \brief Adds a read group to the dictionary.
57
+
58
+ This is an overloaded function.
59
+
60
+ \param readGroupId ID of read group to be added
61
+ \sa Add()
62
+ */
63
+ void SamReadGroupDictionary::Add(const std::string& readGroupId) {
64
+ Add( SamReadGroup(readGroupId) );
65
+ }
66
+
67
+ /*! \fn void SamReadGroupDictionary::Add(const std::vector<SamReadGroup>& readGroups)
68
+ \brief Adds multiple read groups to the dictionary.
69
+
70
+ This is an overloaded function.
71
+
72
+ \param readGroups entries to be added
73
+ \sa Add()
74
+ */
75
+ void SamReadGroupDictionary::Add(const std::vector<SamReadGroup>& readGroups) {
76
+ vector<SamReadGroup>::const_iterator rgIter = readGroups.begin();
77
+ vector<SamReadGroup>::const_iterator rgEnd = readGroups.end();
78
+ for ( ; rgIter!= rgEnd; ++rgIter )
79
+ Add(*rgIter);
80
+ }
81
+
82
+ /*! \fn void SamReadGroupDictionary::Add(const std::vector<std::string>& readGroupIds)
83
+ \brief Adds multiple read groups to the dictionary.
84
+
85
+ This is an overloaded function.
86
+
87
+ \param readGroupIds IDs of read groups to be added
88
+ \sa Add()
89
+ */
90
+ void SamReadGroupDictionary::Add(const std::vector<std::string>& readGroupIds) {
91
+ vector<string>::const_iterator rgIter = readGroupIds.begin();
92
+ vector<string>::const_iterator rgEnd = readGroupIds.end();
93
+ for ( ; rgIter!= rgEnd; ++rgIter )
94
+ Add(*rgIter);
95
+ }
96
+
97
+ /*! \fn SamReadGroupIterator SamReadGroupDictionary::Begin(void)
98
+ \return an STL iterator pointing to the first read group
99
+ \sa ConstBegin(), End()
100
+ */
101
+ SamReadGroupIterator SamReadGroupDictionary::Begin(void) {
102
+ return m_data.begin();
103
+ }
104
+
105
+ /*! \fn SamReadGroupConstIterator SamReadGroupDictionary::Begin(void) const
106
+ \return an STL const_iterator pointing to the first read group
107
+
108
+ This is an overloaded function.
109
+
110
+ \sa ConstBegin(), End()
111
+ */
112
+ SamReadGroupConstIterator SamReadGroupDictionary::Begin(void) const {
113
+ return m_data.begin();
114
+ }
115
+
116
+ /*! \fn void SamReadGroupDictionary::Clear(void)
117
+ \brief Clears all read group entries.
118
+ */
119
+ void SamReadGroupDictionary::Clear(void) {
120
+ m_data.clear();
121
+ }
122
+
123
+ /*! \fn SamReadGroupConstIterator SamReadGroupDictionary::ConstBegin(void) const
124
+ \return an STL const_iterator pointing to the first read group
125
+ \sa Begin(), ConstEnd()
126
+ */
127
+ SamReadGroupConstIterator SamReadGroupDictionary::ConstBegin(void) const {
128
+ return m_data.begin();
129
+ }
130
+
131
+ /*! \fn SamReadGroupConstIterator SamReadGroupDictionary::ConstEnd(void) const
132
+ \return an STL const_iterator pointing to the imaginary entry after the last read group
133
+ \sa ConstBegin(), End()
134
+ */
135
+ SamReadGroupConstIterator SamReadGroupDictionary::ConstEnd(void) const {
136
+ return m_data.end();
137
+ }
138
+
139
+ /*! \fn bool SamReadGroupDictionary::Contains(const std::string& readGroupId) const
140
+ \brief Returns true if dictionary contains read group.
141
+ \param readGroupId search for read group matching this ID
142
+ \return \c true if dictionary contains a read group with this ID
143
+ */
144
+ bool SamReadGroupDictionary::Contains(const std::string& readGroupId) const {
145
+ return ( IndexOf(readGroupId) != (int)m_data.size() );
146
+ }
147
+
148
+ /*! \fn bool SamReadGroupDictionary::Contains(const SamReadGroup& readGroup) const
149
+ \brief Returns true if dictionary contains read group (matching on ID).
150
+
151
+ This is an overloaded function.
152
+
153
+ \param readGroup search for this read group
154
+ \return \c true if dictionary contains read group (matching on ID).
155
+ */
156
+ bool SamReadGroupDictionary::Contains(const SamReadGroup& readGroup) const {
157
+ return Contains( readGroup.ID );
158
+ }
159
+
160
+ /*! \fn SamReadGroupIterator SamReadGroupDictionary::End(void)
161
+ \return an STL iterator pointing to the imaginary entry after the last read group
162
+ \sa Begin(), ConstEnd()
163
+ */
164
+ SamReadGroupIterator SamReadGroupDictionary::End(void) {
165
+ return m_data.end();
166
+ }
167
+
168
+ /*! \fn SamReadGroupConstIterator SamReadGroupDictionary::End(void) const
169
+ \return an STL const_iterator pointing to the imaginary entry after the last read group
170
+
171
+ This is an overloaded function.
172
+
173
+ \sa Begin(), ConstEnd()
174
+ */
175
+ SamReadGroupConstIterator SamReadGroupDictionary::End(void) const {
176
+ return m_data.end();
177
+ }
178
+
179
+ /*! \fn int SamReadGroupDictionary::IndexOf(const std::string& readGroupId) const
180
+ \internal
181
+ \return index of read group if found. Otherwise, returns vector::size() (invalid index).
182
+ */
183
+ int SamReadGroupDictionary::IndexOf(const std::string& readGroupId) const {
184
+ SamReadGroupConstIterator begin = ConstBegin();
185
+ SamReadGroupConstIterator iter = begin;
186
+ SamReadGroupConstIterator end = ConstEnd();
187
+ for ( ; iter != end; ++iter ) {
188
+ const SamReadGroup& current = (*iter);
189
+ if ( current.ID == readGroupId )
190
+ break;
191
+ }
192
+ return distance( begin, iter );
193
+ }
194
+
195
+ /*! \fn bool SamReadGroupDictionary::IsEmpty(void) const
196
+ \brief Returns \c true if dictionary contains no read groups
197
+ \sa Size()
198
+ */
199
+ bool SamReadGroupDictionary::IsEmpty(void) const {
200
+ return m_data.empty();
201
+ }
202
+
203
+ /*! \fn void SamReadGroupDictionary::Remove(const SamReadGroup& readGroup)
204
+ \brief Removes read group from dictionary, if found (matching on ID).
205
+
206
+ This is an overloaded function.
207
+
208
+ \param readGroup read group to remove (matches on ID)
209
+ */
210
+ void SamReadGroupDictionary::Remove(const SamReadGroup& readGroup) {
211
+ Remove( readGroup.ID );
212
+ }
213
+
214
+ /*! \fn void SamReadGroupDictionary::Remove(const std::string& readGroupId)
215
+ \brief Removes read group from dictionary, if found.
216
+ \param readGroupId ID of read group to remove
217
+ \sa Remove()
218
+ */
219
+ void SamReadGroupDictionary::Remove(const std::string& readGroupId) {
220
+ if ( Contains(readGroupId) )
221
+ m_data.erase( m_data.begin() + IndexOf(readGroupId) );
222
+ }
223
+
224
+ /*! \fn void SamReadGroupDictionary::Remove(const std::vector<SamReadGroup>& readGroups)
225
+ \brief Removes multiple read groups from dictionary (matching on ID).
226
+
227
+ This is an overloaded function.
228
+
229
+ \param readGroups read groups to remove
230
+ \sa Remove()
231
+ */
232
+ void SamReadGroupDictionary::Remove(const std::vector<SamReadGroup>& readGroups) {
233
+ vector<SamReadGroup>::const_iterator rgIter = readGroups.begin();
234
+ vector<SamReadGroup>::const_iterator rgEnd = readGroups.end();
235
+ for ( ; rgIter!= rgEnd; ++rgIter )
236
+ Remove(*rgIter);
237
+ }
238
+
239
+ /*! \fn void SamReadGroupDictionary::Remove(const std::vector<std::string>& readGroupIds)
240
+ \brief Removes multiple read groups from dictionary.
241
+
242
+ This is an overloaded function.
243
+
244
+ \param readGroupIds IDs of the read groups to remove
245
+ \sa Remove()
246
+ */
247
+ void SamReadGroupDictionary::Remove(const std::vector<std::string>& readGroupIds) {
248
+ vector<string>::const_iterator rgIter = readGroupIds.begin();
249
+ vector<string>::const_iterator rgEnd = readGroupIds.end();
250
+ for ( ; rgIter!= rgEnd; ++rgIter )
251
+ Remove(*rgIter);
252
+ }
253
+
254
+ /*! \fn int SamReadGroupDictionary::Size(void) const
255
+ \brief Returns number of read groups in dictionary.
256
+ \sa IsEmpty()
257
+ */
258
+ int SamReadGroupDictionary::Size(void) const {
259
+ return m_data.size();
260
+ }
261
+
262
+ /*! \fn SamReadGroup& SamReadGroupDictionary::operator[](const std::string& readGroupId)
263
+ \brief Retrieves the modifiable SamReadGroup that matches \a readGroupId.
264
+
265
+ NOTE - If the dictionary contains no read group matching this ID, this function inserts
266
+ a new one with this ID, and returns a reference to it.
267
+
268
+ If you want to avoid this insertion behavior, check the result of Contains() before
269
+ using this operator.
270
+
271
+ \param readGroupId ID of read group to retrieve
272
+ \return a modifiable reference to the SamReadGroup associated with the ID
273
+ */
274
+ SamReadGroup& SamReadGroupDictionary::operator[](const std::string& readGroupId) {
275
+
276
+ // look up read group ID
277
+ int index = IndexOf(readGroupId);
278
+
279
+ // if found, return read group at index
280
+ if ( index != (int)m_data.size() )
281
+ return m_data[index];
282
+
283
+ // otherwise, append new read group and return reference
284
+ else {
285
+ SamReadGroup rg(readGroupId);
286
+ m_data.push_back(rg);
287
+ return m_data.back();
288
+ }
289
+ }
@@ -0,0 +1,86 @@
1
+ // ***************************************************************************
2
+ // SamReadGroupDictionary.h (c) 2010 Derek Barnett
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 18 April 2011 (DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Provides methods for operating on a collection of SamReadGroup entries.
8
+ // ***************************************************************************
9
+
10
+ #ifndef SAM_READGROUP_DICTIONARY_H
11
+ #define SAM_READGROUP_DICTIONARY_H
12
+
13
+ #include <api/api_global.h>
14
+ #include <api/SamReadGroup.h>
15
+ #include <string>
16
+ #include <vector>
17
+
18
+ namespace BamTools {
19
+
20
+ typedef std::vector<SamReadGroup> SamReadGroupContainer;
21
+ typedef SamReadGroupContainer::iterator SamReadGroupIterator;
22
+ typedef SamReadGroupContainer::const_iterator SamReadGroupConstIterator;
23
+
24
+ class API_EXPORT SamReadGroupDictionary {
25
+
26
+ // ctor & dtor
27
+ public:
28
+ SamReadGroupDictionary(void);
29
+ SamReadGroupDictionary(const SamReadGroupDictionary& other);
30
+ ~SamReadGroupDictionary(void);
31
+
32
+ // query/modify read group data
33
+ public:
34
+ // adds a read group
35
+ void Add(const SamReadGroup& readGroup);
36
+ void Add(const std::string& readGroupId);
37
+
38
+ // adds multiple read groups
39
+ void Add(const std::vector<SamReadGroup>& readGroups);
40
+ void Add(const std::vector<std::string>& readGroupIds);
41
+
42
+ // clears all read group entries
43
+ void Clear(void);
44
+
45
+ // returns true if dictionary contains this read group
46
+ bool Contains(const SamReadGroup& readGroup) const;
47
+ bool Contains(const std::string& readGroupId) const;
48
+
49
+ // returns true if dictionary is empty
50
+ bool IsEmpty(void) const;
51
+
52
+ // removes read group, if found
53
+ void Remove(const SamReadGroup& readGroup);
54
+ void Remove(const std::string& readGroupId);
55
+
56
+ // removes multiple read groups
57
+ void Remove(const std::vector<SamReadGroup>& readGroups);
58
+ void Remove(const std::vector<std::string>& readGroupIds);
59
+
60
+ // returns number of read groups in dictionary
61
+ int Size(void) const;
62
+
63
+ // retrieves a modifiable reference to the SamReadGroup object associated with this ID
64
+ SamReadGroup& operator[](const std::string& readGroupId);
65
+
66
+ // retrieve STL-compatible iterators
67
+ public:
68
+ SamReadGroupIterator Begin(void); // returns iterator to begin()
69
+ SamReadGroupConstIterator Begin(void) const; // returns const_iterator to begin()
70
+ SamReadGroupConstIterator ConstBegin(void) const; // returns const_iterator to begin()
71
+ SamReadGroupIterator End(void); // returns iterator to end()
72
+ SamReadGroupConstIterator End(void) const; // returns const_iterator to end()
73
+ SamReadGroupConstIterator ConstEnd(void) const; // returns const_iterator to end()
74
+
75
+ // internal methods
76
+ private:
77
+ int IndexOf(const std::string& readGroupId) const;
78
+
79
+ // data members
80
+ private:
81
+ SamReadGroupContainer m_data;
82
+ };
83
+
84
+ } // namespace BamTools
85
+
86
+ #endif // SAM_READGROUP_DICTIONARY_H
@@ -0,0 +1,161 @@
1
+ // ***************************************************************************
2
+ // SamSequence.cpp (c) 2010 Derek Barnett
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 18 April 2011 (DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Provides direct read/write access to the SAM sequence data fields.
8
+ // ***************************************************************************
9
+
10
+ #include <api/SamSequence.h>
11
+ #include <sstream>
12
+ using namespace BamTools;
13
+ using namespace std;
14
+
15
+ /*! \struct BamTools::SamSequence
16
+ \brief Represents a SAM sequence entry.
17
+
18
+ Provides direct read/write access to the SAM sequence data fields.
19
+
20
+ \sa \samSpecURL
21
+ */
22
+ /*! \var SamSequence::AssemblyID
23
+ \brief corresponds to \@SQ AS:\<AssemblyID\>
24
+ */
25
+ /*! \var SamSequence::Checksum
26
+ \brief corresponds to \@SQ M5:\<Checksum\>
27
+ */
28
+ /*! \var SamSequence::Length
29
+ \brief corresponds to \@SQ LN:\<Length\>
30
+
31
+ Required for valid SAM header.
32
+ */
33
+ /*! \var SamSequence::Name
34
+ \brief corresponds to \@SQ SN:\<Name\>
35
+
36
+ Required for valid SAM header.
37
+ */
38
+ /*! \var SamSequence::Species
39
+ \brief corresponds to \@SQ SP:\<Species\>
40
+ */
41
+ /*! \var SamSequence::URI
42
+ \brief corresponds to \@SQ UR:\<URI\>
43
+ */
44
+
45
+ /*! \fn SamSequence::SamSequence(void)
46
+ \brief default constructor
47
+ */
48
+ SamSequence::SamSequence(void)
49
+ : AssemblyID("")
50
+ , Checksum("")
51
+ , Length("")
52
+ , Name("")
53
+ , Species("")
54
+ , URI("")
55
+ { }
56
+
57
+ /*! \fn SamSequence::SamSequence(const std::string& name, const int& length)
58
+ \brief constructs sequence with \a name and \a length
59
+
60
+ \param name desired sequence name
61
+ \param length desired sequence length (numeric value)
62
+ */
63
+ SamSequence::SamSequence(const std::string& name,
64
+ const int& length)
65
+ : AssemblyID("")
66
+ , Checksum("")
67
+ , Name(name)
68
+ , Species("")
69
+ , URI("")
70
+ {
71
+ stringstream s("");
72
+ s << length;
73
+ Length = s.str();
74
+ }
75
+
76
+ /*! \fn SamSequence::SamSequence(const std::string& name, const std::string& length)
77
+ \brief constructs sequence with \a name and \a length
78
+
79
+ \param name desired sequence name
80
+ \param length desired sequence length (string value)
81
+ */
82
+ SamSequence::SamSequence(const std::string& name,
83
+ const std::string& length)
84
+ : AssemblyID("")
85
+ , Checksum("")
86
+ , Length(length)
87
+ , Name(name)
88
+ , Species("")
89
+ , URI("")
90
+ { }
91
+
92
+ /*! \fn SamSequence::SamSequence(const SamSequence& other)
93
+ \brief copy constructor
94
+ */
95
+ SamSequence::SamSequence(const SamSequence& other)
96
+ : AssemblyID(other.AssemblyID)
97
+ , Checksum(other.Checksum)
98
+ , Length(other.Length)
99
+ , Name(other.Name)
100
+ , Species(other.Species)
101
+ , URI(other.URI)
102
+ { }
103
+
104
+ /*! \fn SamSequence::~SamSequence(void)
105
+ \brief destructor
106
+ */
107
+ SamSequence::~SamSequence(void) { }
108
+
109
+ /*! \fn void SamSequence::Clear(void)
110
+ \brief Clears all data fields.
111
+ */
112
+ void SamSequence::Clear(void) {
113
+ AssemblyID.clear();
114
+ Checksum.clear();
115
+ Length.clear();
116
+ Name.clear();
117
+ Species.clear();
118
+ URI.clear();
119
+ }
120
+
121
+ /*! \fn bool SamSequence::HasAssemblyID(void) const
122
+ \brief Returns \c true if sequence contains \@SQ AS:\<AssemblyID\>
123
+ */
124
+ bool SamSequence::HasAssemblyID(void) const {
125
+ return (!AssemblyID.empty());
126
+ }
127
+
128
+ /*! \fn bool SamSequence::HasChecksum(void) const
129
+ \brief Returns \c true if sequence contains \@SQ M5:\<Checksum\>
130
+ */
131
+ bool SamSequence::HasChecksum(void) const {
132
+ return (!Checksum.empty());
133
+ }
134
+
135
+ /*! \fn bool SamSequence::HasLength(void) const
136
+ \brief Returns \c true if sequence contains \@SQ LN:\<Length\>
137
+ */
138
+ bool SamSequence::HasLength(void) const {
139
+ return (!Length.empty());
140
+ }
141
+
142
+ /*! \fn bool SamSequence::HasName(void) const
143
+ \brief Returns \c true if sequence contains \@SQ SN:\<Name\>
144
+ */
145
+ bool SamSequence::HasName(void) const {
146
+ return (!Name.empty());
147
+ }
148
+
149
+ /*! \fn bool SamSequence::HasSpecies(void) const
150
+ \brief Returns \c true if sequence contains \@SQ SP:\<Species\>
151
+ */
152
+ bool SamSequence::HasSpecies(void) const {
153
+ return (!Species.empty());
154
+ }
155
+
156
+ /*! \fn bool SamSequence::HasURI(void) const
157
+ \brief Returns \c true if sequence contains \@SQ UR:\<URI\>
158
+ */
159
+ bool SamSequence::HasURI(void) const {
160
+ return (!URI.empty());
161
+ }
@@ -0,0 +1,60 @@
1
+ // ***************************************************************************
2
+ // SamSequence.h (c) 2010 Derek Barnett
3
+ // Marth Lab, Department of Biology, Boston College
4
+ // ---------------------------------------------------------------------------
5
+ // Last modified: 18 April 2011 (DB)
6
+ // ---------------------------------------------------------------------------
7
+ // Provides direct read/write access to the SAM sequence data fields.
8
+ // ***************************************************************************
9
+
10
+ #ifndef SAM_SEQUENCE_H
11
+ #define SAM_SEQUENCE_H
12
+
13
+ #include <api/api_global.h>
14
+ #include <string>
15
+
16
+ namespace BamTools {
17
+
18
+ struct API_EXPORT SamSequence {
19
+
20
+ // ctor & dtor
21
+ SamSequence(void);
22
+ SamSequence(const std::string& name, const int& length);
23
+ SamSequence(const std::string& name, const std::string& length);
24
+ SamSequence(const SamSequence& other);
25
+ ~SamSequence(void);
26
+
27
+ // query/modify entire sequence
28
+ void Clear(void); // clears all contents
29
+
30
+ // convenience query methods
31
+ bool HasAssemblyID(void) const; // returns true if sequence has an assembly ID
32
+ bool HasChecksum(void) const; // returns true if sequence has an MD5 checksum
33
+ bool HasLength(void) const; // returns true if sequence has a length
34
+ bool HasName(void) const; // returns true if sequence has a name
35
+ bool HasSpecies(void) const; // returns true if sequence has a species ID
36
+ bool HasURI(void) const; // returns true if sequence has a URI
37
+
38
+ // data members
39
+ std::string AssemblyID; // AS:<AssemblyID>
40
+ std::string Checksum; // M5:<Checksum>
41
+ std::string Length; // LN:<Length> *Required for valid SAM header*
42
+ std::string Name; // SN:<Name> *Required for valid SAM header*
43
+ std::string Species; // SP:<Species>
44
+ std::string URI; // UR:<URI>
45
+ };
46
+
47
+ /*! \fn bool operator==(const SamSequence& lhs, const SamSequence& rhs)
48
+ \brief tests equality by comparing sequence names, lengths, & checksums (if available)
49
+ */
50
+ API_EXPORT inline bool operator==(const SamSequence& lhs, const SamSequence& rhs) {
51
+ if ( lhs.Name != rhs.Name ) return false;
52
+ if ( lhs.Length != rhs.Length ) return false;
53
+ if ( lhs.HasChecksum() && rhs.HasChecksum() )
54
+ return (lhs.Checksum == rhs.Checksum);
55
+ else return true;
56
+ }
57
+
58
+ } // namespace BamTools
59
+
60
+ #endif // SAM_SEQUENCE_H