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,195 @@
|
|
1
|
+
// ***************************************************************************
|
2
|
+
// bamtools_filter_properties.h (c) 2010 Derek Barnett, Erik Garrison
|
3
|
+
// Marth Lab, Department of Biology, Boston College
|
4
|
+
// ---------------------------------------------------------------------------
|
5
|
+
// Last modified: 19 November 2010
|
6
|
+
// ---------------------------------------------------------------------------
|
7
|
+
// Provides support data structures & methods for FilterEngine
|
8
|
+
//
|
9
|
+
// The FilterEngine consists, most importantly, of :
|
10
|
+
//
|
11
|
+
// a list of possible properties (each tagged whether it has been 'enabled' as a filter)
|
12
|
+
// a map of filterName => propertySet
|
13
|
+
// queue for compound rule expression (i.e. "(filter1 AND filter2) OR !filter3" )
|
14
|
+
//
|
15
|
+
// Each propertySet is a list of properties enabled for this particular filter object
|
16
|
+
//
|
17
|
+
// Implemented as a map of propertyNames to propertyFilterValue
|
18
|
+
// ( "property1" => pfv1
|
19
|
+
// "property2" => pfv2
|
20
|
+
// "property4" => pfv4
|
21
|
+
// etc. )
|
22
|
+
//
|
23
|
+
// Any properties that are 'possible', via FilterEngine::addProperty(), but not enabled
|
24
|
+
// via FilterEngine::setProperty() (in our example, say "property3"), evaluate to true
|
25
|
+
// for any query. Meaning that if a property is not set on this filter, we don't care
|
26
|
+
// about it here, so it passes though OK.
|
27
|
+
//
|
28
|
+
// A propertyFilterValue contains a value and comparison type
|
29
|
+
//
|
30
|
+
// ( pfv1: Value = 50, Type = GREATER_THAN_EQUAL
|
31
|
+
// pfv2: Value = "foo", Type = STARTS_WITH
|
32
|
+
// pfv4: Value = "bar", Type = CONTAINS
|
33
|
+
// etc. )
|
34
|
+
//
|
35
|
+
// This allows for more complex queries (than simple isEqual?) against a variety of data types.
|
36
|
+
//
|
37
|
+
// ***************************************************************************
|
38
|
+
|
39
|
+
#ifndef BAMTOOLS_FILTER_PROPERTIES_H
|
40
|
+
#define BAMTOOLS_FILTER_PROPERTIES_H
|
41
|
+
|
42
|
+
#include <utils/bamtools_utilities.h>
|
43
|
+
#include <utils/bamtools_variant.h>
|
44
|
+
#include <utils/utils_global.h>
|
45
|
+
#include <iostream>
|
46
|
+
#include <map>
|
47
|
+
#include <string>
|
48
|
+
|
49
|
+
namespace BamTools {
|
50
|
+
|
51
|
+
// ----------------------------------------------------------
|
52
|
+
// PropertyFilterValue
|
53
|
+
|
54
|
+
struct UTILS_EXPORT PropertyFilterValue {
|
55
|
+
|
56
|
+
// define valid ValueCompareTypes
|
57
|
+
enum ValueCompareType { CONTAINS = 0
|
58
|
+
, ENDS_WITH
|
59
|
+
, EXACT
|
60
|
+
, GREATER_THAN
|
61
|
+
, GREATER_THAN_EQUAL
|
62
|
+
, LESS_THAN
|
63
|
+
, LESS_THAN_EQUAL
|
64
|
+
, NOT
|
65
|
+
, STARTS_WITH
|
66
|
+
};
|
67
|
+
|
68
|
+
// ctor
|
69
|
+
PropertyFilterValue(const Variant& value = Variant(),
|
70
|
+
const ValueCompareType& type = PropertyFilterValue::EXACT)
|
71
|
+
: Value(value)
|
72
|
+
, Type(type)
|
73
|
+
{ }
|
74
|
+
|
75
|
+
// filter check methods
|
76
|
+
template<typename T>
|
77
|
+
bool check(const T& query) const;
|
78
|
+
bool check(const std::string& query) const;
|
79
|
+
|
80
|
+
// data members
|
81
|
+
Variant Value;
|
82
|
+
ValueCompareType Type;
|
83
|
+
};
|
84
|
+
|
85
|
+
// checks a query against a filter (value, compare type)
|
86
|
+
template<typename T>
|
87
|
+
bool PropertyFilterValue::check(const T& query) const {
|
88
|
+
|
89
|
+
// ensure filter value & query are same type
|
90
|
+
if ( !Value.is_type<T>() ) {
|
91
|
+
std::cerr << "Cannot compare different types!" << std::endl;
|
92
|
+
return false;
|
93
|
+
}
|
94
|
+
|
95
|
+
// string matching
|
96
|
+
if ( Value.is_type<std::string>() ) {
|
97
|
+
std::cerr << "Cannot compare different types - query is a string!" << std::endl;
|
98
|
+
return false;
|
99
|
+
}
|
100
|
+
|
101
|
+
// numeric matching based on our filter type
|
102
|
+
switch ( Type ) {
|
103
|
+
case ( PropertyFilterValue::EXACT) : return ( query == Value.get<T>() );
|
104
|
+
case ( PropertyFilterValue::GREATER_THAN) : return ( query > Value.get<T>() );
|
105
|
+
case ( PropertyFilterValue::GREATER_THAN_EQUAL) : return ( query >= Value.get<T>() );
|
106
|
+
case ( PropertyFilterValue::LESS_THAN) : return ( query < Value.get<T>() );
|
107
|
+
case ( PropertyFilterValue::LESS_THAN_EQUAL) : return ( query <= Value.get<T>() );
|
108
|
+
case ( PropertyFilterValue::NOT) : return ( query != Value.get<T>() );
|
109
|
+
default : BAMTOOLS_ASSERT_UNREACHABLE;
|
110
|
+
}
|
111
|
+
return false;
|
112
|
+
}
|
113
|
+
|
114
|
+
// checks a string query against filter (value, compare type)
|
115
|
+
inline
|
116
|
+
bool PropertyFilterValue::check(const std::string& query) const {
|
117
|
+
|
118
|
+
// ensure filter value & query are same type
|
119
|
+
if ( !Value.is_type<std::string>() ) {
|
120
|
+
std::cerr << "Cannot compare different types!" << std::endl;
|
121
|
+
return false;
|
122
|
+
}
|
123
|
+
|
124
|
+
// localize string version of our filter value
|
125
|
+
const std::string& valueString = Value.get<std::string>();
|
126
|
+
|
127
|
+
// string matching based on our filter type
|
128
|
+
switch ( Type ) {
|
129
|
+
case ( PropertyFilterValue::CONTAINS) : return ( query.find(valueString) != std::string::npos );
|
130
|
+
case ( PropertyFilterValue::ENDS_WITH) : return ( query.find(valueString) == (query.length() - valueString.length()) );
|
131
|
+
case ( PropertyFilterValue::EXACT) : return ( query == valueString );
|
132
|
+
case ( PropertyFilterValue::GREATER_THAN) : return ( query > valueString );
|
133
|
+
case ( PropertyFilterValue::GREATER_THAN_EQUAL) : return ( query >= valueString );
|
134
|
+
case ( PropertyFilterValue::LESS_THAN) : return ( query < valueString );
|
135
|
+
case ( PropertyFilterValue::LESS_THAN_EQUAL) : return ( query <= valueString );
|
136
|
+
case ( PropertyFilterValue::NOT) : return ( query != valueString );
|
137
|
+
case ( PropertyFilterValue::STARTS_WITH) : return ( query.find(valueString) == 0 );
|
138
|
+
default : BAMTOOLS_ASSERT_UNREACHABLE;
|
139
|
+
}
|
140
|
+
return false;
|
141
|
+
}
|
142
|
+
|
143
|
+
inline
|
144
|
+
const std::string toString(const PropertyFilterValue::ValueCompareType& type) {
|
145
|
+
|
146
|
+
switch ( type ) {
|
147
|
+
case ( PropertyFilterValue::CONTAINS ) : return std::string( "CONTAINS");
|
148
|
+
case ( PropertyFilterValue::ENDS_WITH ) : return std::string( "ENDS_WITH");
|
149
|
+
case ( PropertyFilterValue::EXACT ) : return std::string( "EXACT");
|
150
|
+
case ( PropertyFilterValue::GREATER_THAN ) : return std::string( "GREATER_THAN");
|
151
|
+
case ( PropertyFilterValue::GREATER_THAN_EQUAL ) : return std::string( "GREATER_THAN_EQUAL");
|
152
|
+
case ( PropertyFilterValue::LESS_THAN ) : return std::string( "LESS_THAN");
|
153
|
+
case ( PropertyFilterValue::LESS_THAN_EQUAL ) : return std::string( "LESS_THAN_EQUAL");
|
154
|
+
case ( PropertyFilterValue::NOT ) : return std::string( "NOT");
|
155
|
+
case ( PropertyFilterValue::STARTS_WITH ) : return std::string( "STARTS_WITH");
|
156
|
+
default : BAMTOOLS_ASSERT_UNREACHABLE;
|
157
|
+
}
|
158
|
+
return std::string();
|
159
|
+
}
|
160
|
+
|
161
|
+
// property name => property filter value
|
162
|
+
// ('name' => ('SSR', STARTS_WITH), 'mapQuality' => (50, GREATER_THAN_EQUAL), etc...)
|
163
|
+
typedef std::map<std::string, PropertyFilterValue> PropertyMap;
|
164
|
+
|
165
|
+
// ----------------------------------------------------------
|
166
|
+
// PropertyFilter
|
167
|
+
|
168
|
+
struct UTILS_EXPORT PropertyFilter {
|
169
|
+
// data members
|
170
|
+
PropertyMap Properties;
|
171
|
+
};
|
172
|
+
|
173
|
+
// filter name => properties
|
174
|
+
// ('filter1' => properties1, 'filter2' => properties2, etc...)
|
175
|
+
typedef std::map<std::string, PropertyFilter> FilterMap;
|
176
|
+
|
177
|
+
// ----------------------------------------------------------
|
178
|
+
// Property
|
179
|
+
|
180
|
+
// used to store properties known to engine & keep track of enabled state
|
181
|
+
struct UTILS_EXPORT Property {
|
182
|
+
std::string Name;
|
183
|
+
bool IsEnabled;
|
184
|
+
Property(const std::string& name, bool isEnabled = false)
|
185
|
+
: Name(name)
|
186
|
+
, IsEnabled(isEnabled)
|
187
|
+
{ }
|
188
|
+
};
|
189
|
+
|
190
|
+
inline bool operator< (const Property& lhs, const Property& rhs) { return lhs.Name < rhs.Name; }
|
191
|
+
inline bool operator== (const Property& lhs, const Property& rhs) { return lhs.Name == rhs.Name; }
|
192
|
+
|
193
|
+
} // namespace BamTools
|
194
|
+
|
195
|
+
#endif // BAMTOOLS_FILTER_PROPERTIES_H
|
@@ -0,0 +1,319 @@
|
|
1
|
+
// ***************************************************************************
|
2
|
+
// bamtools_filter_ruleparser.h (c) 2010 Derek Barnett, Erik Garrison
|
3
|
+
// Marth Lab, Department of Biology, Boston College
|
4
|
+
// ---------------------------------------------------------------------------
|
5
|
+
// Last modified: 19 November 2010
|
6
|
+
// ---------------------------------------------------------------------------
|
7
|
+
// Provides a compound rule parser for FilterEngine.
|
8
|
+
// ***************************************************************************
|
9
|
+
|
10
|
+
#ifndef BAMTOOLS_FILTER_RULEPARSER_H
|
11
|
+
#define BAMTOOLS_FILTER_RULEPARSER_H
|
12
|
+
|
13
|
+
#include <utils/bamtools_utilities.h>
|
14
|
+
#include <queue>
|
15
|
+
#include <stack>
|
16
|
+
#include <string>
|
17
|
+
|
18
|
+
namespace BamTools {
|
19
|
+
|
20
|
+
// -------------------------------------------
|
21
|
+
// char constants
|
22
|
+
|
23
|
+
const char LEFT_PARENTHESIS_CHAR = '(';
|
24
|
+
const char RIGHT_PARENTHESIS_CHAR = ')';
|
25
|
+
const char AND_OPERATOR_CHAR = '&';
|
26
|
+
const char OR_OPERATOR_CHAR = '|';
|
27
|
+
const char NOT_OPERATOR_CHAR = '!';
|
28
|
+
const char SPACE_CHAR = ' ';
|
29
|
+
|
30
|
+
// -------------------------------------------
|
31
|
+
// RuleToken implementation
|
32
|
+
|
33
|
+
struct RuleToken {
|
34
|
+
|
35
|
+
// enums
|
36
|
+
enum RuleTokenType { OPERAND = 0
|
37
|
+
, AND_OPERATOR
|
38
|
+
, OR_OPERATOR
|
39
|
+
, NOT_OPERATOR
|
40
|
+
, LEFT_PARENTHESIS
|
41
|
+
, RIGHT_PARENTHESIS
|
42
|
+
};
|
43
|
+
|
44
|
+
// data members
|
45
|
+
RuleTokenType Type;
|
46
|
+
std::string Value;
|
47
|
+
};
|
48
|
+
|
49
|
+
inline int priority(const RuleToken& token) {
|
50
|
+
switch ( token.Type ) {
|
51
|
+
case ( RuleToken::NOT_OPERATOR ) : return 3;
|
52
|
+
case ( RuleToken::AND_OPERATOR ) : return 2;
|
53
|
+
case ( RuleToken::OR_OPERATOR ) : return 1;
|
54
|
+
case ( RuleToken::LEFT_PARENTHESIS ) : return 0;
|
55
|
+
case ( RuleToken::RIGHT_PARENTHESIS ) : return 0;
|
56
|
+
default:
|
57
|
+
BAMTOOLS_ASSERT_UNREACHABLE;
|
58
|
+
return -1;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
inline bool isRightAssociative(const RuleToken& token) {
|
63
|
+
return (token.Type == RuleToken::NOT_OPERATOR ||
|
64
|
+
token.Type == RuleToken::LEFT_PARENTHESIS);
|
65
|
+
}
|
66
|
+
|
67
|
+
inline bool isLeftAssociative(const RuleToken& token) {
|
68
|
+
return !isRightAssociative(token);
|
69
|
+
}
|
70
|
+
|
71
|
+
inline bool isLeftParenthesis(const RuleToken& token) {
|
72
|
+
return ( token.Type == RuleToken::LEFT_PARENTHESIS );
|
73
|
+
}
|
74
|
+
|
75
|
+
inline bool isRightParenthesis(const RuleToken& token) {
|
76
|
+
return ( token.Type == RuleToken::RIGHT_PARENTHESIS );
|
77
|
+
}
|
78
|
+
|
79
|
+
inline bool isOperand(const RuleToken& token) {
|
80
|
+
return ( token.Type == RuleToken::OPERAND );
|
81
|
+
}
|
82
|
+
|
83
|
+
inline bool isOperator(const RuleToken& token) {
|
84
|
+
return ( token.Type == RuleToken::AND_OPERATOR ||
|
85
|
+
token.Type == RuleToken::OR_OPERATOR ||
|
86
|
+
token.Type == RuleToken::NOT_OPERATOR);
|
87
|
+
}
|
88
|
+
|
89
|
+
// -------------------------------------------
|
90
|
+
// RuleParser implementation
|
91
|
+
|
92
|
+
class RuleParser {
|
93
|
+
|
94
|
+
// ctor & dtor
|
95
|
+
public:
|
96
|
+
RuleParser(const std::string& ruleString)
|
97
|
+
: m_ruleString(ruleString)
|
98
|
+
{
|
99
|
+
// initialize char markers
|
100
|
+
m_begin = (char*)m_ruleString.c_str();
|
101
|
+
m_end = m_begin + m_ruleString.length();
|
102
|
+
ignoreQuotes();
|
103
|
+
}
|
104
|
+
|
105
|
+
~RuleParser(void) { }
|
106
|
+
|
107
|
+
// public interface
|
108
|
+
public:
|
109
|
+
void parse(void);
|
110
|
+
std::queue<std::string> results(void) const { return m_ruleQueue; }
|
111
|
+
|
112
|
+
// internal methods
|
113
|
+
private:
|
114
|
+
char getNextChar(void);
|
115
|
+
void ignoreQuotes(void);
|
116
|
+
bool readToken(RuleToken& token);
|
117
|
+
void skipSpaces(void);
|
118
|
+
|
119
|
+
// data members
|
120
|
+
private:
|
121
|
+
std::string m_ruleString;
|
122
|
+
char* m_begin;
|
123
|
+
char* m_current;
|
124
|
+
char* m_end;
|
125
|
+
|
126
|
+
std::queue<std::string> m_ruleQueue;
|
127
|
+
std::stack<RuleToken> m_operatorStack;
|
128
|
+
};
|
129
|
+
|
130
|
+
inline
|
131
|
+
char RuleParser::getNextChar(void) {
|
132
|
+
if ( m_current == m_end ) return 0;
|
133
|
+
return *m_current++;
|
134
|
+
}
|
135
|
+
|
136
|
+
inline
|
137
|
+
void RuleParser::ignoreQuotes(void) {
|
138
|
+
if ( *m_begin == '\"' ) ++m_begin;
|
139
|
+
if ( *m_end == '\"' ) --m_end;
|
140
|
+
}
|
141
|
+
|
142
|
+
inline
|
143
|
+
void RuleParser::parse(void) {
|
144
|
+
|
145
|
+
// clear out any prior data
|
146
|
+
while ( !m_ruleQueue.empty() )
|
147
|
+
m_ruleQueue.pop();
|
148
|
+
|
149
|
+
// skip if no rule to parse
|
150
|
+
if ( m_ruleString.empty() ) return;
|
151
|
+
|
152
|
+
// start at beginning of ruleString
|
153
|
+
m_current = m_begin;
|
154
|
+
|
155
|
+
// iterate through tokens in rule string
|
156
|
+
RuleToken token;
|
157
|
+
while ( readToken(token) ) {
|
158
|
+
|
159
|
+
if ( token.Value.empty() ) break;
|
160
|
+
|
161
|
+
// if token is an operand
|
162
|
+
if ( isOperand(token) )
|
163
|
+
m_ruleQueue.push(token.Value);
|
164
|
+
|
165
|
+
// if token is an operator
|
166
|
+
else if ( isOperator(token) ) {
|
167
|
+
|
168
|
+
// pop any operators at top of stack with higher priority
|
169
|
+
while ( !m_operatorStack.empty() ) {
|
170
|
+
const RuleToken& opToken = m_operatorStack.top();
|
171
|
+
if ( (isLeftAssociative(token) && (priority(token) <= priority(opToken))) ||
|
172
|
+
(isRightAssociative(token) && (priority(token) < priority(opToken)))
|
173
|
+
)
|
174
|
+
{
|
175
|
+
m_ruleQueue.push(opToken.Value);
|
176
|
+
m_operatorStack.pop();
|
177
|
+
}
|
178
|
+
else break;
|
179
|
+
}
|
180
|
+
|
181
|
+
// push current operator token onto stack
|
182
|
+
m_operatorStack.push(token);
|
183
|
+
}
|
184
|
+
|
185
|
+
// if token is left parenthesis
|
186
|
+
else if ( isLeftParenthesis(token) )
|
187
|
+
m_operatorStack.push(token);
|
188
|
+
|
189
|
+
// if token is right parenthesis
|
190
|
+
else if ( isRightParenthesis(token) ) {
|
191
|
+
|
192
|
+
bool foundLeftParenthesis = false;
|
193
|
+
|
194
|
+
// push operators into rule queue until left parenthesis found
|
195
|
+
while ( !m_operatorStack.empty() && !foundLeftParenthesis ) {
|
196
|
+
const RuleToken& opToken = m_operatorStack.top();
|
197
|
+
if ( !isLeftParenthesis(opToken) )
|
198
|
+
m_ruleQueue.push(opToken.Value);
|
199
|
+
else
|
200
|
+
foundLeftParenthesis = true;
|
201
|
+
m_operatorStack.pop();
|
202
|
+
}
|
203
|
+
|
204
|
+
// no left parenthesis found, error
|
205
|
+
BAMTOOLS_ASSERT_MESSAGE( foundLeftParenthesis, "ERROR: Mismatched parenthesis in rule string.1");
|
206
|
+
}
|
207
|
+
|
208
|
+
// error: unknown operand
|
209
|
+
else BAMTOOLS_ASSERT_UNREACHABLE;
|
210
|
+
}
|
211
|
+
|
212
|
+
// while there are still operators on stack
|
213
|
+
while ( !m_operatorStack.empty() ) {
|
214
|
+
const RuleToken& token = m_operatorStack.top();
|
215
|
+
BAMTOOLS_ASSERT_MESSAGE( (!isLeftParenthesis(token) && !isRightParenthesis(token)), "ERROR: Mismatched parenthesis in rule string.2");
|
216
|
+
m_ruleQueue.push(token.Value);
|
217
|
+
m_operatorStack.pop();
|
218
|
+
}
|
219
|
+
}
|
220
|
+
|
221
|
+
inline
|
222
|
+
bool RuleParser::readToken(RuleToken& token) {
|
223
|
+
|
224
|
+
// skip any preceding whitespace
|
225
|
+
skipSpaces();
|
226
|
+
if ( m_current == m_end ) return false;
|
227
|
+
|
228
|
+
// clear out prior token value
|
229
|
+
token.Value.clear();
|
230
|
+
|
231
|
+
// read chars while still in token
|
232
|
+
char c = 1;
|
233
|
+
bool keepReading = true;
|
234
|
+
bool inOperandString = false;
|
235
|
+
while ( keepReading && (c != 0) ) {
|
236
|
+
|
237
|
+
// get next char
|
238
|
+
c = getNextChar();
|
239
|
+
switch (c) {
|
240
|
+
|
241
|
+
// current char is '('
|
242
|
+
case ( LEFT_PARENTHESIS_CHAR ) :
|
243
|
+
token.Type = RuleToken::LEFT_PARENTHESIS;
|
244
|
+
token.Value.append(1, LEFT_PARENTHESIS_CHAR);
|
245
|
+
keepReading = false;
|
246
|
+
break;
|
247
|
+
|
248
|
+
// current char is ')'
|
249
|
+
case ( RIGHT_PARENTHESIS_CHAR ) :
|
250
|
+
if ( inOperandString )
|
251
|
+
--m_current;
|
252
|
+
else {
|
253
|
+
token.Type = RuleToken::RIGHT_PARENTHESIS;
|
254
|
+
token.Value.append(1, RIGHT_PARENTHESIS_CHAR);
|
255
|
+
}
|
256
|
+
keepReading = false;
|
257
|
+
break;
|
258
|
+
|
259
|
+
// current char is '&'
|
260
|
+
case ( AND_OPERATOR_CHAR ) :
|
261
|
+
if ( inOperandString )
|
262
|
+
--m_current;
|
263
|
+
else {
|
264
|
+
token.Type = RuleToken::AND_OPERATOR;
|
265
|
+
token.Value.append(1, AND_OPERATOR_CHAR);
|
266
|
+
}
|
267
|
+
keepReading = false;
|
268
|
+
break;
|
269
|
+
|
270
|
+
// current char is '|'
|
271
|
+
case ( OR_OPERATOR_CHAR ) :
|
272
|
+
if ( inOperandString )
|
273
|
+
--m_current;
|
274
|
+
else {
|
275
|
+
token.Type = RuleToken::OR_OPERATOR;
|
276
|
+
token.Value.append(1, OR_OPERATOR_CHAR);
|
277
|
+
}
|
278
|
+
keepReading = false;
|
279
|
+
break;
|
280
|
+
|
281
|
+
// current char is '!'
|
282
|
+
case ( NOT_OPERATOR_CHAR ) :
|
283
|
+
token.Type = RuleToken::NOT_OPERATOR;
|
284
|
+
token.Value.append(1, NOT_OPERATOR_CHAR);
|
285
|
+
keepReading = false;
|
286
|
+
break;
|
287
|
+
|
288
|
+
// current char is ' '
|
289
|
+
case ( SPACE_CHAR ) :
|
290
|
+
keepReading = false;
|
291
|
+
break;
|
292
|
+
|
293
|
+
// current char is a true value token
|
294
|
+
default:
|
295
|
+
if ( c != 0 ) {
|
296
|
+
token.Type = RuleToken::OPERAND;
|
297
|
+
token.Value.append(1, c);
|
298
|
+
inOperandString = true;
|
299
|
+
keepReading = true;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
}
|
303
|
+
|
304
|
+
return true;
|
305
|
+
}
|
306
|
+
|
307
|
+
inline
|
308
|
+
void RuleParser::skipSpaces(void) {
|
309
|
+
while ( m_current != m_end ) {
|
310
|
+
const char c = *m_current;
|
311
|
+
if ( c == ' ' || c == '\t' || c == '\r' || c == '\n')
|
312
|
+
++m_current;
|
313
|
+
else break;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
} // namespace BamTools
|
318
|
+
|
319
|
+
#endif // BAMTOOLS_FILTER_RULEPARSER_H
|