ngs_server 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/bin/ngs_server +58 -0
- data/data/holder.txt +0 -0
- data/ext/bamtools/CMakeLists.txt +49 -0
- data/ext/bamtools/LICENSE +22 -0
- data/ext/bamtools/README +60 -0
- data/ext/bamtools/Tutorial_Toolkit_BamTools-1.0.pdf +0 -0
- data/ext/bamtools/docs/Doxyfile +1601 -0
- data/ext/bamtools/extconf.rb +9 -0
- data/ext/bamtools/src/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
- data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/DependInfo.cmake +13 -0
- data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/build.make +65 -0
- data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/cmake_clean.cmake +8 -0
- data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/depend.internal +3 -0
- data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/depend.make +3 -0
- data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/progress.make +2 -0
- data/ext/bamtools/src/CMakeFiles/progress.marks +1 -0
- data/ext/bamtools/src/CMakeLists.txt +18 -0
- data/ext/bamtools/src/ExportHeader.cmake +31 -0
- data/ext/bamtools/src/Makefile +182 -0
- data/ext/bamtools/src/api/BamAlignment.cpp +2432 -0
- data/ext/bamtools/src/api/BamAlignment.h +206 -0
- data/ext/bamtools/src/api/BamAux.h +456 -0
- data/ext/bamtools/src/api/BamConstants.h +127 -0
- data/ext/bamtools/src/api/BamIndex.h +79 -0
- data/ext/bamtools/src/api/BamMultiReader.cpp +395 -0
- data/ext/bamtools/src/api/BamMultiReader.h +126 -0
- data/ext/bamtools/src/api/BamReader.cpp +369 -0
- data/ext/bamtools/src/api/BamReader.h +117 -0
- data/ext/bamtools/src/api/BamWriter.cpp +142 -0
- data/ext/bamtools/src/api/BamWriter.h +63 -0
- data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/DependInfo.cmake +14 -0
- data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/build.make +80 -0
- data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/cmake_clean.cmake +8 -0
- data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/depend.internal +3 -0
- data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/depend.make +3 -0
- data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/progress.make +2 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamAlignment.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamMultiReader.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamReader.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamWriter.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/CXX.includecache +596 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/DependInfo.cmake +41 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamHeader.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamProgram.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamProgramChain.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamReadGroup.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamReadGroupDictionary.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamSequence.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamSequenceDictionary.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/build.make +675 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/cmake_clean.cmake +32 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/cmake_clean_target.cmake +3 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/depend.internal +295 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/depend.make +295 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/flags.make +8 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamHeader_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamIndexFactory_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamMultiReader_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamRandomAccessController_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamReader_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamStandardIndex_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamToolsIndex_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamWriter_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BgzfStream_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/SamFormatParser_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/SamFormatPrinter_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/SamHeaderValidator_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/link.txt +2 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/progress.make +24 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamAlignment.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamMultiReader.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamReader.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamWriter.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/CXX.includecache +596 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/DependInfo.cmake +47 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamHeader.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamProgram.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamProgramChain.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamReadGroup.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamReadGroupDictionary.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamSequence.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamSequenceDictionary.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/build.make +677 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/cmake_clean.cmake +33 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/depend.internal +295 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/depend.make +295 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/flags.make +8 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamHeader_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamIndexFactory_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamMultiReader_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamRandomAccessController_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamReader_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamStandardIndex_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamToolsIndex_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamWriter_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BgzfStream_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/SamFormatParser_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/SamFormatPrinter_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/SamHeaderValidator_p.cpp.o +0 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/link.txt +1 -0
- data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/progress.make +24 -0
- data/ext/bamtools/src/api/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
- data/ext/bamtools/src/api/CMakeFiles/progress.marks +1 -0
- data/ext/bamtools/src/api/CMakeLists.txt +78 -0
- data/ext/bamtools/src/api/Makefile +902 -0
- data/ext/bamtools/src/api/SamConstants.h +95 -0
- data/ext/bamtools/src/api/SamHeader.cpp +184 -0
- data/ext/bamtools/src/api/SamHeader.h +68 -0
- data/ext/bamtools/src/api/SamProgram.cpp +139 -0
- data/ext/bamtools/src/api/SamProgram.h +61 -0
- data/ext/bamtools/src/api/SamProgramChain.cpp +351 -0
- data/ext/bamtools/src/api/SamProgramChain.h +85 -0
- data/ext/bamtools/src/api/SamReadGroup.cpp +221 -0
- data/ext/bamtools/src/api/SamReadGroup.h +68 -0
- data/ext/bamtools/src/api/SamReadGroupDictionary.cpp +289 -0
- data/ext/bamtools/src/api/SamReadGroupDictionary.h +86 -0
- data/ext/bamtools/src/api/SamSequence.cpp +161 -0
- data/ext/bamtools/src/api/SamSequence.h +60 -0
- data/ext/bamtools/src/api/SamSequenceDictionary.cpp +292 -0
- data/ext/bamtools/src/api/SamSequenceDictionary.h +88 -0
- data/ext/bamtools/src/api/api_global.h +21 -0
- data/ext/bamtools/src/api/cmake_install.cmake +122 -0
- data/ext/bamtools/src/api/internal/BamHeader_p.cpp +132 -0
- data/ext/bamtools/src/api/internal/BamHeader_p.h +71 -0
- data/ext/bamtools/src/api/internal/BamIndexFactory_p.cpp +112 -0
- data/ext/bamtools/src/api/internal/BamIndexFactory_p.h +49 -0
- data/ext/bamtools/src/api/internal/BamMultiMerger_p.h +297 -0
- data/ext/bamtools/src/api/internal/BamMultiReader_p.cpp +805 -0
- data/ext/bamtools/src/api/internal/BamMultiReader_p.h +103 -0
- data/ext/bamtools/src/api/internal/BamRandomAccessController_p.cpp +272 -0
- data/ext/bamtools/src/api/internal/BamRandomAccessController_p.h +93 -0
- data/ext/bamtools/src/api/internal/BamReader_p.cpp +380 -0
- data/ext/bamtools/src/api/internal/BamReader_p.h +112 -0
- data/ext/bamtools/src/api/internal/BamStandardIndex_p.cpp +986 -0
- data/ext/bamtools/src/api/internal/BamStandardIndex_p.h +236 -0
- data/ext/bamtools/src/api/internal/BamToolsIndex_p.cpp +641 -0
- data/ext/bamtools/src/api/internal/BamToolsIndex_p.h +187 -0
- data/ext/bamtools/src/api/internal/BamWriter_p.cpp +424 -0
- data/ext/bamtools/src/api/internal/BamWriter_p.h +66 -0
- data/ext/bamtools/src/api/internal/BgzfStream_p.cpp +438 -0
- data/ext/bamtools/src/api/internal/BgzfStream_p.h +108 -0
- data/ext/bamtools/src/api/internal/SamFormatParser_p.cpp +230 -0
- data/ext/bamtools/src/api/internal/SamFormatParser_p.h +61 -0
- data/ext/bamtools/src/api/internal/SamFormatPrinter_p.cpp +210 -0
- data/ext/bamtools/src/api/internal/SamFormatPrinter_p.h +60 -0
- data/ext/bamtools/src/api/internal/SamHeaderValidator_p.cpp +510 -0
- data/ext/bamtools/src/api/internal/SamHeaderValidator_p.h +101 -0
- data/ext/bamtools/src/api/internal/SamHeaderVersion_p.h +134 -0
- data/ext/bamtools/src/cmake_install.cmake +42 -0
- data/ext/bamtools/src/shared/bamtools_global.h +78 -0
- data/ext/bamtools/src/third_party/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
- data/ext/bamtools/src/third_party/CMakeFiles/progress.marks +1 -0
- data/ext/bamtools/src/third_party/CMakeLists.txt +10 -0
- data/ext/bamtools/src/third_party/Makefile +167 -0
- data/ext/bamtools/src/third_party/cmake_install.cmake +35 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/CXX.includecache +144 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/DependInfo.cmake +27 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/build.make +157 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/cmake_clean.cmake +13 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/depend.internal +31 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/depend.make +31 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/flags.make +8 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/json_reader.cpp.o +0 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/json_value.cpp.o +0 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/json_writer.cpp.o +0 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/link.txt +1 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/progress.make +4 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/progress.marks +1 -0
- data/ext/bamtools/src/third_party/jsoncpp/CMakeLists.txt +23 -0
- data/ext/bamtools/src/third_party/jsoncpp/LICENSE +55 -0
- data/ext/bamtools/src/third_party/jsoncpp/Makefile +263 -0
- data/ext/bamtools/src/third_party/jsoncpp/cmake_install.cmake +29 -0
- data/ext/bamtools/src/third_party/jsoncpp/json.h +15 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_batchallocator.h +130 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_config.h +42 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_features.h +47 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_forwards.h +42 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_internalarray.inl +453 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_internalmap.inl +612 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_reader.cpp +870 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_reader.h +201 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_tool.h +93 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_value.cpp +1701 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_value.h +1059 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_valueiterator.inl +297 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_writer.cpp +819 -0
- data/ext/bamtools/src/third_party/jsoncpp/json_writer.h +179 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/CMakeDirectoryInformation.cmake +25 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/CXX.includecache +698 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/DependInfo.cmake +34 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_convert.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_count.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_coverage.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_filter.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_header.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_index.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_merge.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_random.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_resolve.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_revert.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_sort.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_split.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_stats.cpp.o +0 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/build.make +447 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/cmake_clean.cmake +24 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/depend.internal +319 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/depend.make +319 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/flags.make +8 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/link.txt +1 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/progress.make +15 -0
- data/ext/bamtools/src/toolkit/CMakeFiles/progress.marks +1 -0
- data/ext/bamtools/src/toolkit/CMakeLists.txt +44 -0
- data/ext/bamtools/src/toolkit/Makefile +560 -0
- data/ext/bamtools/src/toolkit/bamtools.cpp +163 -0
- data/ext/bamtools/src/toolkit/bamtools_convert.cpp +888 -0
- data/ext/bamtools/src/toolkit/bamtools_convert.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_count.cpp +187 -0
- data/ext/bamtools/src/toolkit/bamtools_count.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_coverage.cpp +196 -0
- data/ext/bamtools/src/toolkit/bamtools_coverage.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_filter.cpp +911 -0
- data/ext/bamtools/src/toolkit/bamtools_filter.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_header.cpp +122 -0
- data/ext/bamtools/src/toolkit/bamtools_header.h +38 -0
- data/ext/bamtools/src/toolkit/bamtools_index.cpp +126 -0
- data/ext/bamtools/src/toolkit/bamtools_index.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_merge.cpp +221 -0
- data/ext/bamtools/src/toolkit/bamtools_merge.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_random.cpp +255 -0
- data/ext/bamtools/src/toolkit/bamtools_random.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_resolve.cpp +1396 -0
- data/ext/bamtools/src/toolkit/bamtools_resolve.h +42 -0
- data/ext/bamtools/src/toolkit/bamtools_revert.cpp +194 -0
- data/ext/bamtools/src/toolkit/bamtools_revert.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_sort.cpp +410 -0
- data/ext/bamtools/src/toolkit/bamtools_sort.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_split.cpp +551 -0
- data/ext/bamtools/src/toolkit/bamtools_split.h +38 -0
- data/ext/bamtools/src/toolkit/bamtools_stats.cpp +286 -0
- data/ext/bamtools/src/toolkit/bamtools_stats.h +37 -0
- data/ext/bamtools/src/toolkit/bamtools_tool.h +35 -0
- data/ext/bamtools/src/toolkit/bamtools_version.h +20 -0
- data/ext/bamtools/src/toolkit/bamtools_version.h.in +20 -0
- data/ext/bamtools/src/toolkit/cmake_install.cmake +52 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/CXX.includecache +250 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/DependInfo.cmake +29 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_fasta.cpp.o +0 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_options.cpp.o +0 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_pileup_engine.cpp.o +0 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_utilities.cpp.o +0 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/build.make +184 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/cmake_clean.cmake +14 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/depend.internal +40 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/depend.make +40 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/flags.make +8 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/link.txt +1 -0
- data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/progress.make +5 -0
- data/ext/bamtools/src/utils/CMakeFiles/CMakeDirectoryInformation.cmake +23 -0
- data/ext/bamtools/src/utils/CMakeFiles/progress.marks +1 -0
- data/ext/bamtools/src/utils/CMakeLists.txt +30 -0
- data/ext/bamtools/src/utils/Makefile +290 -0
- data/ext/bamtools/src/utils/bamtools_fasta.cpp +632 -0
- data/ext/bamtools/src/utils/bamtools_fasta.h +47 -0
- data/ext/bamtools/src/utils/bamtools_filter_engine.h +552 -0
- data/ext/bamtools/src/utils/bamtools_filter_properties.h +195 -0
- data/ext/bamtools/src/utils/bamtools_filter_ruleparser.h +319 -0
- data/ext/bamtools/src/utils/bamtools_options.cpp +287 -0
- data/ext/bamtools/src/utils/bamtools_options.h +213 -0
- data/ext/bamtools/src/utils/bamtools_pileup_engine.cpp +327 -0
- data/ext/bamtools/src/utils/bamtools_pileup_engine.h +94 -0
- data/ext/bamtools/src/utils/bamtools_utilities.cpp +333 -0
- data/ext/bamtools/src/utils/bamtools_utilities.h +67 -0
- data/ext/bamtools/src/utils/bamtools_variant.h +128 -0
- data/ext/bamtools/src/utils/cmake_install.cmake +29 -0
- data/ext/bamtools/src/utils/utils_global.h +21 -0
- data/lib/ngs_server/version.rb +3 -0
- data/lib/ngs_server.rb +3 -0
- data/ngs_server.gemspec +23 -0
- metadata +339 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
// ***************************************************************************
|
2
|
+
// bamtools_filter.h (c) 2010 Derek Barnett, Erik Garrison
|
3
|
+
// Marth Lab, Department of Biology, Boston College
|
4
|
+
// ---------------------------------------------------------------------------
|
5
|
+
// Last modified: 28 August 2010
|
6
|
+
// ---------------------------------------------------------------------------
|
7
|
+
// Filters BAM file(s) according to some user-specified criteria
|
8
|
+
// ***************************************************************************
|
9
|
+
|
10
|
+
#ifndef BAMTOOLS_FILTER_H
|
11
|
+
#define BAMTOOLS_FILTER_H
|
12
|
+
|
13
|
+
#include "bamtools_tool.h"
|
14
|
+
|
15
|
+
namespace BamTools {
|
16
|
+
|
17
|
+
class FilterTool : public AbstractTool {
|
18
|
+
|
19
|
+
public:
|
20
|
+
FilterTool(void);
|
21
|
+
~FilterTool(void);
|
22
|
+
|
23
|
+
public:
|
24
|
+
int Help(void);
|
25
|
+
int Run(int argc, char* argv[]);
|
26
|
+
|
27
|
+
private:
|
28
|
+
struct FilterSettings;
|
29
|
+
FilterSettings* m_settings;
|
30
|
+
|
31
|
+
struct FilterToolPrivate;
|
32
|
+
FilterToolPrivate* m_impl;
|
33
|
+
};
|
34
|
+
|
35
|
+
} // namespace BamTools
|
36
|
+
|
37
|
+
#endif // BAMTOOLS_FILTER_H
|
@@ -0,0 +1,122 @@
|
|
1
|
+
// ***************************************************************************
|
2
|
+
// bamtools_header.cpp (c) 2010 Derek Barnett, Erik Garrison
|
3
|
+
// Marth Lab, Department of Biology, Boston College
|
4
|
+
// ---------------------------------------------------------------------------
|
5
|
+
// Last modified: 7 April 2011
|
6
|
+
// ---------------------------------------------------------------------------
|
7
|
+
// Prints the SAM-style header from a single BAM file ( or merged header from
|
8
|
+
// multiple BAM files) to stdout
|
9
|
+
// ***************************************************************************
|
10
|
+
|
11
|
+
#include "bamtools_header.h"
|
12
|
+
|
13
|
+
#include <api/BamMultiReader.h>
|
14
|
+
#include <utils/bamtools_options.h>
|
15
|
+
using namespace BamTools;
|
16
|
+
|
17
|
+
#include <iostream>
|
18
|
+
#include <string>
|
19
|
+
#include <vector>
|
20
|
+
using namespace std;
|
21
|
+
|
22
|
+
// ---------------------------------------------
|
23
|
+
// HeaderSettings implementation
|
24
|
+
|
25
|
+
struct HeaderTool::HeaderSettings {
|
26
|
+
|
27
|
+
// flags
|
28
|
+
bool HasInputBamFilename;
|
29
|
+
|
30
|
+
// filenames
|
31
|
+
vector<string> InputFiles;
|
32
|
+
|
33
|
+
// constructor
|
34
|
+
HeaderSettings(void)
|
35
|
+
: HasInputBamFilename(false)
|
36
|
+
{ }
|
37
|
+
};
|
38
|
+
|
39
|
+
struct HeaderTool::HeaderToolPrivate {
|
40
|
+
|
41
|
+
// ctor & dtor
|
42
|
+
public:
|
43
|
+
HeaderToolPrivate(HeaderTool::HeaderSettings* settings)
|
44
|
+
: m_settings(settings)
|
45
|
+
{ }
|
46
|
+
|
47
|
+
~HeaderToolPrivate(void) { }
|
48
|
+
|
49
|
+
// interface
|
50
|
+
public:
|
51
|
+
bool Run(void);
|
52
|
+
|
53
|
+
// data members
|
54
|
+
private:
|
55
|
+
HeaderTool::HeaderSettings* m_settings;
|
56
|
+
};
|
57
|
+
|
58
|
+
bool HeaderTool::HeaderToolPrivate::Run(void) {
|
59
|
+
|
60
|
+
// set to default input if none provided
|
61
|
+
if ( !m_settings->HasInputBamFilename )
|
62
|
+
m_settings->InputFiles.push_back(Options::StandardIn());
|
63
|
+
|
64
|
+
// attemp to open BAM files
|
65
|
+
BamMultiReader reader;
|
66
|
+
if ( !reader.Open(m_settings->InputFiles) ) {
|
67
|
+
cerr << "bamtools header ERROR: could not open BAM file(s) for reading... Aborting." << endl;
|
68
|
+
return false;
|
69
|
+
}
|
70
|
+
|
71
|
+
// dump (merged) header contents to stdout
|
72
|
+
cout << reader.GetHeaderText() << endl;
|
73
|
+
|
74
|
+
// clean up & exit
|
75
|
+
reader.Close();
|
76
|
+
return true;
|
77
|
+
}
|
78
|
+
|
79
|
+
// ---------------------------------------------
|
80
|
+
// HeaderTool implementation
|
81
|
+
|
82
|
+
HeaderTool::HeaderTool(void)
|
83
|
+
: AbstractTool()
|
84
|
+
, m_settings(new HeaderSettings)
|
85
|
+
, m_impl(0)
|
86
|
+
{
|
87
|
+
// set program details
|
88
|
+
Options::SetProgramInfo("bamtools header", "prints header from BAM file(s)", "[-in <filename> -in <filename> ...] ");
|
89
|
+
|
90
|
+
// set up options
|
91
|
+
OptionGroup* IO_Opts = Options::CreateOptionGroup("Input & Output");
|
92
|
+
Options::AddValueOption("-in", "BAM filename", "the input BAM file(s)", "", m_settings->HasInputBamFilename, m_settings->InputFiles, IO_Opts, Options::StandardIn());
|
93
|
+
}
|
94
|
+
|
95
|
+
HeaderTool::~HeaderTool(void) {
|
96
|
+
|
97
|
+
delete m_settings;
|
98
|
+
m_settings = 0;
|
99
|
+
|
100
|
+
delete m_impl;
|
101
|
+
m_impl = 0;
|
102
|
+
}
|
103
|
+
|
104
|
+
int HeaderTool::Help(void) {
|
105
|
+
Options::DisplayHelp();
|
106
|
+
return 0;
|
107
|
+
}
|
108
|
+
|
109
|
+
int HeaderTool::Run(int argc, char* argv[]) {
|
110
|
+
|
111
|
+
// parse command line arguments
|
112
|
+
Options::Parse(argc, argv, 1);
|
113
|
+
|
114
|
+
// initialize HeaderTool with settings
|
115
|
+
m_impl = new HeaderToolPrivate(m_settings);
|
116
|
+
|
117
|
+
// run HeaderTool, return success/fail
|
118
|
+
if ( m_impl->Run() )
|
119
|
+
return 0;
|
120
|
+
else
|
121
|
+
return 1;
|
122
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
// ***************************************************************************
|
2
|
+
// bamtools_header.h (c) 2010 Derek Barnett, Erik Garrison
|
3
|
+
// Marth Lab, Department of Biology, Boston College
|
4
|
+
// ---------------------------------------------------------------------------
|
5
|
+
// Last modified: 7 April 2011
|
6
|
+
// ---------------------------------------------------------------------------
|
7
|
+
// Prints the SAM-style header from a single BAM file ( or merged header from
|
8
|
+
// multiple BAM files) to stdout
|
9
|
+
// ***************************************************************************
|
10
|
+
|
11
|
+
#ifndef BAMTOOLS_HEADER_H
|
12
|
+
#define BAMTOOLS_HEADER_H
|
13
|
+
|
14
|
+
#include "bamtools_tool.h"
|
15
|
+
|
16
|
+
namespace BamTools {
|
17
|
+
|
18
|
+
class HeaderTool : public AbstractTool {
|
19
|
+
|
20
|
+
public:
|
21
|
+
HeaderTool(void);
|
22
|
+
~HeaderTool(void);
|
23
|
+
|
24
|
+
public:
|
25
|
+
int Help(void);
|
26
|
+
int Run(int argc, char* argv[]);
|
27
|
+
|
28
|
+
private:
|
29
|
+
struct HeaderSettings;
|
30
|
+
HeaderSettings* m_settings;
|
31
|
+
|
32
|
+
struct HeaderToolPrivate;
|
33
|
+
HeaderToolPrivate* m_impl;
|
34
|
+
};
|
35
|
+
|
36
|
+
} // namespace BamTools
|
37
|
+
|
38
|
+
#endif // BAMTOOLS_HEADER_H
|
@@ -0,0 +1,126 @@
|
|
1
|
+
// ***************************************************************************
|
2
|
+
// bamtools_index.cpp (c) 2010 Derek Barnett, Erik Garrison
|
3
|
+
// Marth Lab, Department of Biology, Boston College
|
4
|
+
// ---------------------------------------------------------------------------
|
5
|
+
// Last modified: 7 April 2011
|
6
|
+
// ---------------------------------------------------------------------------
|
7
|
+
// Creates a BAM index file
|
8
|
+
// ***************************************************************************
|
9
|
+
|
10
|
+
#include "bamtools_index.h"
|
11
|
+
|
12
|
+
#include <api/BamReader.h>
|
13
|
+
#include <utils/bamtools_options.h>
|
14
|
+
using namespace BamTools;
|
15
|
+
|
16
|
+
#include <iostream>
|
17
|
+
#include <string>
|
18
|
+
using namespace std;
|
19
|
+
|
20
|
+
// ---------------------------------------------
|
21
|
+
// IndexSettings implementation
|
22
|
+
|
23
|
+
struct IndexTool::IndexSettings {
|
24
|
+
|
25
|
+
// flags
|
26
|
+
bool HasInputBamFilename;
|
27
|
+
bool IsUsingBamtoolsIndex;
|
28
|
+
|
29
|
+
// filenames
|
30
|
+
string InputBamFilename;
|
31
|
+
|
32
|
+
// constructor
|
33
|
+
IndexSettings(void)
|
34
|
+
: HasInputBamFilename(false)
|
35
|
+
, IsUsingBamtoolsIndex(false)
|
36
|
+
, InputBamFilename(Options::StandardIn())
|
37
|
+
{ }
|
38
|
+
};
|
39
|
+
|
40
|
+
// ---------------------------------------------
|
41
|
+
// IndexToolPrivate implementation
|
42
|
+
|
43
|
+
struct IndexTool::IndexToolPrivate {
|
44
|
+
|
45
|
+
// ctor & dtor
|
46
|
+
public:
|
47
|
+
IndexToolPrivate(IndexTool::IndexSettings* settings)
|
48
|
+
: m_settings(settings)
|
49
|
+
{ }
|
50
|
+
|
51
|
+
~IndexToolPrivate(void) { }
|
52
|
+
|
53
|
+
// interface
|
54
|
+
public:
|
55
|
+
bool Run(void);
|
56
|
+
|
57
|
+
// data members
|
58
|
+
private:
|
59
|
+
IndexTool::IndexSettings* m_settings;
|
60
|
+
};
|
61
|
+
|
62
|
+
bool IndexTool::IndexToolPrivate::Run(void) {
|
63
|
+
|
64
|
+
// open our BAM reader
|
65
|
+
BamReader reader;
|
66
|
+
if ( !reader.Open(m_settings->InputBamFilename) ) {
|
67
|
+
cerr << "bamtools index ERROR: could not open BAM file: "
|
68
|
+
<< m_settings->InputBamFilename << endl;
|
69
|
+
return false;
|
70
|
+
}
|
71
|
+
|
72
|
+
// create index for BAM file
|
73
|
+
const BamIndex::IndexType type = ( m_settings->IsUsingBamtoolsIndex ? BamIndex::BAMTOOLS
|
74
|
+
: BamIndex::STANDARD );
|
75
|
+
reader.CreateIndex(type);
|
76
|
+
|
77
|
+
// clean & exit
|
78
|
+
reader.Close();
|
79
|
+
return true;
|
80
|
+
}
|
81
|
+
|
82
|
+
// ---------------------------------------------
|
83
|
+
// IndexTool implementation
|
84
|
+
|
85
|
+
IndexTool::IndexTool(void)
|
86
|
+
: AbstractTool()
|
87
|
+
, m_settings(new IndexSettings)
|
88
|
+
, m_impl(0)
|
89
|
+
{
|
90
|
+
// set program details
|
91
|
+
Options::SetProgramInfo("bamtools index", "creates index for BAM file", "[-in <filename>] [-bti]");
|
92
|
+
|
93
|
+
// set up options
|
94
|
+
OptionGroup* IO_Opts = Options::CreateOptionGroup("Input & Output");
|
95
|
+
Options::AddValueOption("-in", "BAM filename", "the input BAM file", "", m_settings->HasInputBamFilename, m_settings->InputBamFilename, IO_Opts, Options::StandardIn());
|
96
|
+
Options::AddOption("-bti", "create (non-standard) BamTools index file (*.bti). Default behavior is to create standard BAM index (*.bai)", m_settings->IsUsingBamtoolsIndex, IO_Opts);
|
97
|
+
}
|
98
|
+
|
99
|
+
IndexTool::~IndexTool(void) {
|
100
|
+
|
101
|
+
delete m_settings;
|
102
|
+
m_settings = 0;
|
103
|
+
|
104
|
+
delete m_impl;
|
105
|
+
m_impl = 0;
|
106
|
+
}
|
107
|
+
|
108
|
+
int IndexTool::Help(void) {
|
109
|
+
Options::DisplayHelp();
|
110
|
+
return 0;
|
111
|
+
}
|
112
|
+
|
113
|
+
int IndexTool::Run(int argc, char* argv[]) {
|
114
|
+
|
115
|
+
// parse command line arguments
|
116
|
+
Options::Parse(argc, argv, 1);
|
117
|
+
|
118
|
+
// initialize IndexTool with settings
|
119
|
+
m_impl = new IndexToolPrivate(m_settings);
|
120
|
+
|
121
|
+
// run IndexTool, return success/fail
|
122
|
+
if ( m_impl->Run() )
|
123
|
+
return 0;
|
124
|
+
else
|
125
|
+
return 1;
|
126
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// ***************************************************************************
|
2
|
+
// bamtools_index.h (c) 2010 Derek Barnett, Erik Garrison
|
3
|
+
// Marth Lab, Department of Biology, Boston College
|
4
|
+
// ---------------------------------------------------------------------------
|
5
|
+
// Last modified: 7 April 2011
|
6
|
+
// ---------------------------------------------------------------------------
|
7
|
+
// Creates a BAM index file
|
8
|
+
// ***************************************************************************
|
9
|
+
|
10
|
+
#ifndef BAMTOOLS_INDEX_H
|
11
|
+
#define BAMTOOLS_INDEX_H
|
12
|
+
|
13
|
+
#include "bamtools_tool.h"
|
14
|
+
|
15
|
+
namespace BamTools {
|
16
|
+
|
17
|
+
class IndexTool : public AbstractTool {
|
18
|
+
|
19
|
+
public:
|
20
|
+
IndexTool(void);
|
21
|
+
~IndexTool(void);
|
22
|
+
|
23
|
+
public:
|
24
|
+
int Help(void);
|
25
|
+
int Run(int argc, char* argv[]);
|
26
|
+
|
27
|
+
private:
|
28
|
+
struct IndexSettings;
|
29
|
+
IndexSettings* m_settings;
|
30
|
+
|
31
|
+
struct IndexToolPrivate;
|
32
|
+
IndexToolPrivate* m_impl;
|
33
|
+
};
|
34
|
+
|
35
|
+
} // namespace BamTools
|
36
|
+
|
37
|
+
#endif // BAMTOOLS_INDEX_H
|
@@ -0,0 +1,221 @@
|
|
1
|
+
// ***************************************************************************
|
2
|
+
// bamtools_merge.cpp (c) 2010 Derek Barnett, Erik Garrison
|
3
|
+
// Marth Lab, Department of Biology, Boston College
|
4
|
+
// ---------------------------------------------------------------------------
|
5
|
+
// Last modified: 7 April 2011
|
6
|
+
// ---------------------------------------------------------------------------
|
7
|
+
// Merges multiple BAM files into one
|
8
|
+
// ***************************************************************************
|
9
|
+
|
10
|
+
#include "bamtools_merge.h"
|
11
|
+
|
12
|
+
#include <api/BamMultiReader.h>
|
13
|
+
#include <api/BamWriter.h>
|
14
|
+
#include <utils/bamtools_options.h>
|
15
|
+
#include <utils/bamtools_utilities.h>
|
16
|
+
using namespace BamTools;
|
17
|
+
|
18
|
+
#include <iostream>
|
19
|
+
#include <string>
|
20
|
+
#include <vector>
|
21
|
+
using namespace std;
|
22
|
+
|
23
|
+
// ---------------------------------------------
|
24
|
+
// MergeSettings implementation
|
25
|
+
|
26
|
+
struct MergeTool::MergeSettings {
|
27
|
+
|
28
|
+
// flags
|
29
|
+
bool HasInputBamFilename;
|
30
|
+
bool HasOutputBamFilename;
|
31
|
+
bool IsForceCompression;
|
32
|
+
bool HasRegion;
|
33
|
+
|
34
|
+
// filenames
|
35
|
+
vector<string> InputFiles;
|
36
|
+
|
37
|
+
// other parameters
|
38
|
+
string OutputFilename;
|
39
|
+
string Region;
|
40
|
+
|
41
|
+
// constructor
|
42
|
+
MergeSettings(void)
|
43
|
+
: HasInputBamFilename(false)
|
44
|
+
, HasOutputBamFilename(false)
|
45
|
+
, IsForceCompression(false)
|
46
|
+
, HasRegion(false)
|
47
|
+
, OutputFilename(Options::StandardOut())
|
48
|
+
{ }
|
49
|
+
};
|
50
|
+
|
51
|
+
// ---------------------------------------------
|
52
|
+
// MergeToolPrivate implementation
|
53
|
+
|
54
|
+
struct MergeTool::MergeToolPrivate {
|
55
|
+
|
56
|
+
// ctor & dtor
|
57
|
+
public:
|
58
|
+
MergeToolPrivate(MergeTool::MergeSettings* settings)
|
59
|
+
: m_settings(settings)
|
60
|
+
{ }
|
61
|
+
|
62
|
+
~MergeToolPrivate(void) { }
|
63
|
+
|
64
|
+
// interface
|
65
|
+
public:
|
66
|
+
bool Run(void);
|
67
|
+
|
68
|
+
// data members
|
69
|
+
private:
|
70
|
+
MergeTool::MergeSettings* m_settings;
|
71
|
+
};
|
72
|
+
|
73
|
+
bool MergeTool::MergeToolPrivate::Run(void) {
|
74
|
+
|
75
|
+
// set to default input if none provided
|
76
|
+
if ( !m_settings->HasInputBamFilename )
|
77
|
+
m_settings->InputFiles.push_back(Options::StandardIn());
|
78
|
+
|
79
|
+
// opens the BAM files (by default without checking for indexes)
|
80
|
+
BamMultiReader reader;
|
81
|
+
if ( !reader.Open(m_settings->InputFiles) ) {
|
82
|
+
cerr << "bamtools merge ERROR: could not open input BAM file(s)... Aborting." << endl;
|
83
|
+
return false;
|
84
|
+
}
|
85
|
+
|
86
|
+
// retrieve header & reference dictionary info
|
87
|
+
std::string mergedHeader = reader.GetHeaderText();
|
88
|
+
RefVector references = reader.GetReferenceData();
|
89
|
+
|
90
|
+
// determine compression mode for BamWriter
|
91
|
+
bool writeUncompressed = ( m_settings->OutputFilename == Options::StandardOut() &&
|
92
|
+
!m_settings->IsForceCompression );
|
93
|
+
BamWriter::CompressionMode compressionMode = BamWriter::Compressed;
|
94
|
+
if ( writeUncompressed ) compressionMode = BamWriter::Uncompressed;
|
95
|
+
|
96
|
+
// open BamWriter
|
97
|
+
BamWriter writer;
|
98
|
+
writer.SetCompressionMode(compressionMode);
|
99
|
+
if ( !writer.Open(m_settings->OutputFilename, mergedHeader, references) ) {
|
100
|
+
cerr << "bamtools merge ERROR: could not open "
|
101
|
+
<< m_settings->OutputFilename << " for writing." << endl;
|
102
|
+
reader.Close();
|
103
|
+
return false;
|
104
|
+
}
|
105
|
+
|
106
|
+
// if no region specified, store entire contents of file(s)
|
107
|
+
if ( !m_settings->HasRegion ) {
|
108
|
+
BamAlignment al;
|
109
|
+
while ( reader.GetNextAlignmentCore(al) )
|
110
|
+
writer.SaveAlignment(al);
|
111
|
+
}
|
112
|
+
|
113
|
+
// otherwise attempt to use region as constraint
|
114
|
+
else {
|
115
|
+
|
116
|
+
// if region string parses OK
|
117
|
+
BamRegion region;
|
118
|
+
if ( Utilities::ParseRegionString(m_settings->Region, reader, region) ) {
|
119
|
+
|
120
|
+
// attempt to find index files
|
121
|
+
reader.LocateIndexes();
|
122
|
+
|
123
|
+
// if index data available for all BAM files, we can use SetRegion
|
124
|
+
if ( reader.HasIndexes() ) {
|
125
|
+
|
126
|
+
// attempt to use SetRegion(), if failed report error
|
127
|
+
if ( !reader.SetRegion(region.LeftRefID,
|
128
|
+
region.LeftPosition,
|
129
|
+
region.RightRefID,
|
130
|
+
region.RightPosition) )
|
131
|
+
{
|
132
|
+
cerr << "bamtools merge ERROR: set region failed. Check that REGION describes a valid range"
|
133
|
+
<< endl;
|
134
|
+
reader.Close();
|
135
|
+
return false;
|
136
|
+
}
|
137
|
+
|
138
|
+
// everything checks out, just iterate through specified region, storing alignments
|
139
|
+
BamAlignment al;
|
140
|
+
while ( reader.GetNextAlignmentCore(al) )
|
141
|
+
writer.SaveAlignment(al);
|
142
|
+
}
|
143
|
+
|
144
|
+
// no index data available, we have to iterate through until we
|
145
|
+
// find overlapping alignments
|
146
|
+
else {
|
147
|
+
BamAlignment al;
|
148
|
+
while ( reader.GetNextAlignmentCore(al) ) {
|
149
|
+
if ( (al.RefID >= region.LeftRefID) && ( (al.Position + al.Length) >= region.LeftPosition ) &&
|
150
|
+
(al.RefID <= region.RightRefID) && ( al.Position <= region.RightPosition) )
|
151
|
+
{
|
152
|
+
writer.SaveAlignment(al);
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
// error parsing REGION string
|
159
|
+
else {
|
160
|
+
cerr << "bamtools merge ERROR: could not parse REGION - " << m_settings->Region << endl;
|
161
|
+
cerr << "Check that REGION is in valid format (see documentation) and that the coordinates are valid"
|
162
|
+
<< endl;
|
163
|
+
reader.Close();
|
164
|
+
writer.Close();
|
165
|
+
return false;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
169
|
+
// clean & exit
|
170
|
+
reader.Close();
|
171
|
+
writer.Close();
|
172
|
+
return true;
|
173
|
+
}
|
174
|
+
|
175
|
+
// ---------------------------------------------
|
176
|
+
// MergeTool implementation
|
177
|
+
|
178
|
+
MergeTool::MergeTool(void)
|
179
|
+
: AbstractTool()
|
180
|
+
, m_settings(new MergeSettings)
|
181
|
+
, m_impl(0)
|
182
|
+
{
|
183
|
+
// set program details
|
184
|
+
Options::SetProgramInfo("bamtools merge", "merges multiple BAM files into one", "[-in <filename> -in <filename> ...] [-out <filename> | [-forceCompression]] [-region <REGION>]");
|
185
|
+
|
186
|
+
// set up options
|
187
|
+
OptionGroup* IO_Opts = Options::CreateOptionGroup("Input & Output");
|
188
|
+
Options::AddValueOption("-in", "BAM filename", "the input BAM file(s)", "", m_settings->HasInputBamFilename, m_settings->InputFiles, IO_Opts);
|
189
|
+
Options::AddValueOption("-out", "BAM filename", "the output BAM file", "", m_settings->HasOutputBamFilename, m_settings->OutputFilename, IO_Opts);
|
190
|
+
Options::AddOption("-forceCompression", "if results are sent to stdout (like when piping to another tool), default behavior is to leave output uncompressed. Use this flag to override and force compression", m_settings->IsForceCompression, IO_Opts);
|
191
|
+
Options::AddValueOption("-region", "REGION", "genomic region. See README for more details", "", m_settings->HasRegion, m_settings->Region, IO_Opts);
|
192
|
+
}
|
193
|
+
|
194
|
+
MergeTool::~MergeTool(void) {
|
195
|
+
|
196
|
+
delete m_settings;
|
197
|
+
m_settings = 0;
|
198
|
+
|
199
|
+
delete m_impl;
|
200
|
+
m_impl = 0;
|
201
|
+
}
|
202
|
+
|
203
|
+
int MergeTool::Help(void) {
|
204
|
+
Options::DisplayHelp();
|
205
|
+
return 0;
|
206
|
+
}
|
207
|
+
|
208
|
+
int MergeTool::Run(int argc, char* argv[]) {
|
209
|
+
|
210
|
+
// parse command line arguments
|
211
|
+
Options::Parse(argc, argv, 1);
|
212
|
+
|
213
|
+
// initialize MergeTool with settings
|
214
|
+
m_impl = new MergeToolPrivate(m_settings);
|
215
|
+
|
216
|
+
// run MergeTool, return success/fail
|
217
|
+
if ( m_impl->Run() )
|
218
|
+
return 0;
|
219
|
+
else
|
220
|
+
return 1;
|
221
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// ***************************************************************************
|
2
|
+
// bamtools_merge.h (c) 2010 Derek Barnett, Erik Garrison
|
3
|
+
// Marth Lab, Department of Biology, Boston College
|
4
|
+
// ---------------------------------------------------------------------------
|
5
|
+
// Last modified: 7 April 2011
|
6
|
+
// ---------------------------------------------------------------------------
|
7
|
+
// Merges multiple BAM files into one
|
8
|
+
// ***************************************************************************
|
9
|
+
|
10
|
+
#ifndef BAMTOOLS_MERGE_H
|
11
|
+
#define BAMTOOLS_MERGE_H
|
12
|
+
|
13
|
+
#include "bamtools_tool.h"
|
14
|
+
|
15
|
+
namespace BamTools {
|
16
|
+
|
17
|
+
class MergeTool : public AbstractTool {
|
18
|
+
|
19
|
+
public:
|
20
|
+
MergeTool(void);
|
21
|
+
~MergeTool(void);
|
22
|
+
|
23
|
+
public:
|
24
|
+
int Help(void);
|
25
|
+
int Run(int argc, char* argv[]);
|
26
|
+
|
27
|
+
private:
|
28
|
+
struct MergeSettings;
|
29
|
+
MergeSettings* m_settings;
|
30
|
+
|
31
|
+
struct MergeToolPrivate;
|
32
|
+
MergeToolPrivate* m_impl;
|
33
|
+
};
|
34
|
+
|
35
|
+
} // namespace BamTools
|
36
|
+
|
37
|
+
#endif // BAMTOOLS_MERGE_H
|