-
Notifications
You must be signed in to change notification settings - Fork 40
/
main.go
executable file
·92 lines (82 loc) · 2.97 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// elPrep: a high-performance tool for analyzing SAM/BAM files.
// Copyright (c) 2017-2020 imec vzw.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version, and Additional Terms
// (see below).
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Affero General Public License for more details.
// You should have received a copy of the GNU Affero General Public
// License and Additional Terms along with this program. If not, see
// <https://github.com/ExaScience/elprep/blob/master/LICENSE.txt>.
// elPrep is a high-performance tool for analyzing .sam/.bam
// files for variant calling in sequencing pipelines.
//
// Please see https://github.com/exascience/elprep for a documentation
// of the tool, and below (and/or
// https://godoc.org/github.com/ExaScience/elprep) for the API
// documentation.
package main
import (
"fmt"
"log"
"os"
"github.com/exascience/elprep/v5/cmd"
)
func printHelp() {
fmt.Fprintln(os.Stderr, "Available commands: filter, sfm, vcf-to-elsites, bed-to-elsites, fasta-to-elfasta")
fmt.Fprint(os.Stderr, "\n", cmd.CombinedSfmFilterHelp)
fmt.Fprint(os.Stderr, "\n", cmd.VcfToElsitesHelp)
fmt.Fprint(os.Stderr, "\n", cmd.BedToElsitesHelp)
fmt.Fprint(os.Stderr, "\n", cmd.FastaToElfastaHelp)
}
func prinExtendedHelp() {
fmt.Fprintln(os.Stderr, "Available commands: filter, split, merge, merge-optical-duplicates-metrics, sfm, vcf-to-elsites, bed-to-elsites, fasta-to-elfasta")
fmt.Fprint(os.Stderr, "\n", cmd.FilterExtendedHelp)
fmt.Fprint(os.Stderr, "\n", cmd.SplitHelp)
fmt.Fprint(os.Stderr, "\n", cmd.MergeHelp)
fmt.Fprint(os.Stderr, "\n", cmd.SfmHelp)
fmt.Fprint(os.Stderr, "\n", cmd.MergeOpticalDuplicatesMetricsHelp)
fmt.Fprint(os.Stderr, "\n", cmd.VcfToElsitesHelp)
fmt.Fprint(os.Stderr, "\n", cmd.BedToElsitesHelp)
fmt.Fprint(os.Stderr, "\n", cmd.FastaToElfastaHelp)
}
func main() {
fmt.Fprintln(os.Stderr, cmd.ProgramMessage)
if len(os.Args) < 2 {
log.Println("Incorrect number of parameters.")
fmt.Fprintln(os.Stderr, cmd.HelpMessage)
printHelp()
os.Exit(1)
}
switch os.Args[1] {
case "filter":
cmd.Filter()
case "split":
cmd.Split()
case "merge":
cmd.Merge()
case "merge-optical-duplicates-metrics":
cmd.MergeOpticalDuplicatesMetrics()
case "vcf-to-elsites":
cmd.VcfToElsites()
case "bed-to-elsites":
cmd.BedToElsites()
case "fasta-to-elfasta":
cmd.FastaToElfasta()
case "sfm":
cmd.Sfm()
case "help", "-help", "--help", "-h", "--h":
printHelp()
case "help-extended", "-help-extended", "--help-extended", "-he", "--he":
prinExtendedHelp()
default:
log.Println("Error: Calling elPrep without a command.")
fmt.Fprintln(os.Stderr, cmd.HelpMessage)
printHelp()
os.Exit(1)
}
}