| 1 | #define _SECURE_SCL 0 |
| 2 | #define _SCL_SECURE_NO_WARNINGS |
| 3 | #include <iostream> |
| 4 | #include <fstream> |
| 5 | |
| 6 | #define BOOST_DISABLE_ASSERTS |
| 7 | #define BOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX |
| 8 | |
| 9 | #ifdef PROFILE |
| 10 | #include "gperftools/profiler.h" |
| 11 | #endif |
| 12 | |
| 13 | #include "version.h" |
| 14 | #include "delly.h" |
| 15 | #include "filter.h" |
| 16 | #include "classify.h" |
| 17 | #include "merge.h" |
| 18 | #include "tegua.h" |
| 19 | #include "coral.h" |
| 20 | #include "asmode.h" |
| 21 | |
| 22 | using namespace torali; |
| 23 | |
| 24 | |
| 25 | inline void |
| 26 | displayUsage() { |
| 27 | std::cerr << "Usage: delly <command> <arguments>" << std::endl; |
| 28 | std::cerr << std::endl; |
| 29 | std::cerr << "Short-read SV calling:" << std::endl; |
| 30 | std::cerr << " call discover and genotype structural variants" << std::endl; |
| 31 | std::cerr << " merge merge structural variants across VCF/BCF files and within a single VCF/BCF file" << std::endl; |
| 32 | std::cerr << " filter filter somatic or germline structural variants" << std::endl; |
| 33 | std::cerr << std::endl; |
| 34 | std::cerr << "Long-read SV calling:" << std::endl; |
| 35 | std::cerr << " lr long-read SV discovery" << std::endl; |
| 36 | std::cerr << std::endl; |
| 37 | //std::cerr << "Assembly-based SV calling (work-in-progress):" << std::endl; |
| 38 | //std::cerr << " asm assembly SV site discovery" << std::endl; |
| 39 | //std::cerr << std::endl; |
| 40 | std::cerr << "Copy-number variant calling:" << std::endl; |
| 41 | std::cerr << " cnv discover and genotype copy-number variants" << std::endl; |
| 42 | std::cerr << " classify classify somatic or germline copy-number variants" << std::endl; |
| 43 | std::cerr << std::endl; |
| 44 | } |
| 45 | |
| 46 | int main(int argc, char **argv) { |
| 47 | if (argc < 2) { |
| 48 | printTitle("Delly"); |
| 49 | displayUsage(); |
| 50 | return 0; |
| 51 | } |
| 52 | |
| 53 | if ((std::string(argv[1]) == "version") || (std::string(argv[1]) == "--version") || (std::string(argv[1]) == "--version-only") || (std::string(argv[1]) == "-v")) { |
| 54 | std::cerr << "Delly version: v" << dellyVersionNumber << std::endl; |
| 55 | std::cerr << " using Boost: v" << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << std::endl; |
| 56 | std::cerr << " using HTSlib: v" << hts_version() << std::endl; |
| 57 | return 0; |
| 58 | } |
| 59 | else if ((std::string(argv[1]) == "help") || (std::string(argv[1]) == "--help") || (std::string(argv[1]) == "-h") || (std::string(argv[1]) == "-?")) { |
| 60 | printTitle("Delly"); |
| 61 | displayUsage(); |
| 62 | return 0; |
| 63 | } |
| 64 | else if ((std::string(argv[1]) == "warranty") || (std::string(argv[1]) == "--warranty") || (std::string(argv[1]) == "-w")) { |
| 65 | displayWarranty(); |
| 66 | return 0; |
| 67 | } |
| 68 | else if ((std::string(argv[1]) == "license") || (std::string(argv[1]) == "--license") || (std::string(argv[1]) == "-l")) { |
| 69 | bsd(); |
| 70 | return 0; |
| 71 | } |
| 72 | else if ((std::string(argv[1]) == "call")) { |
| 73 | return delly(argc-1,argv+1); |
| 74 | } |
| 75 | else if ((std::string(argv[1]) == "lr")) { |
| 76 | return tegua(argc-1,argv+1); |
| 77 | } |
| 78 | else if ((std::string(argv[1]) == "asm")) { |
| 79 | return asmode(argc-1,argv+1); |
| 80 | } |
| 81 | else if ((std::string(argv[1]) == "cnv")) { |
| 82 | return coral(argc-1,argv+1); |
| 83 | } |
| 84 | else if ((std::string(argv[1]) == "classify")) { |
| 85 | return classify(argc-1,argv+1); |
| 86 | } |
| 87 | else if ((std::string(argv[1]) == "filter")) { |
| 88 | return filter(argc-1,argv+1); |
| 89 | } |
| 90 | else if ((std::string(argv[1]) == "merge")) { |
| 91 | return merge(argc-1,argv+1); |
| 92 | } |
| 93 | std::cerr << "Unrecognized command " << std::string(argv[1]) << std::endl; |
| 94 | return 1; |
| 95 | } |
| 96 |