-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
90 lines (80 loc) · 1.86 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
package main
import (
"log"
"open-anno/cmd"
"open-anno/cmd/anno"
"open-anno/cmd/pre"
"open-anno/cmd/pre/clinvar"
"open-anno/cmd/tools"
"github.com/spf13/cobra"
)
var RootCmd *cobra.Command
func NewRootCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "OpenAnno",
Short: "A Genome Annotate Tool",
}
return cmd
}
func NewPreCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "pre",
Short: "Prepare database",
}
cmd.AddCommand(pre.NewGeneCmd())
cmd.AddCommand(pre.NewPreGnomadCmd())
cmd.AddCommand(pre.NewPreDbnsfpCmd())
cmd.AddCommand(pre.NewSplitVCFCmd())
cln := &cobra.Command{
Use: "clinvar",
Short: "Prepare ClinVar Database",
}
cln.AddCommand(clinvar.NewPreClinvarCmd())
cln.AddCommand(clinvar.NewPrePathogenicCmd())
cln.AddCommand(clinvar.NewPrePathogenicMTCmd())
cln.AddCommand(clinvar.NewPreClinvarGeneCmd())
cmd.AddCommand(cln)
return cmd
}
func NewAnnoCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "anno",
Short: "Annotate variants",
}
cmd.AddCommand(anno.NewAnnoSnvCmd())
cmd.AddCommand(anno.NewAnnoCnvCmd())
return cmd
}
func NewToolsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "tools",
Short: "Tools",
}
cmd.AddCommand(tools.NewRepTransCmd())
cmd.AddCommand(tools.NewExonBedCmd())
return cmd
}
func init() {
RootCmd = NewRootCmd()
RootCmd.AddCommand(NewPreCmd())
RootCmd.AddCommand(NewAnnoCmd())
RootCmd.AddCommand(NewToolsCmd())
RootCmd.AddCommand(cmd.NewTestCmd())
// var rlim syscall.Rlimit
// err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlim)
// if err != nil {
// log.Fatalln("get rlimit error: " + err.Error())
// }
// rlim.Cur = 1000 * 1000
// rlim.Max = 1000 * 1000
// err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
// if err != nil {
// log.Fatalln("set rlimit error: " + err.Error())
// }
}
func main() {
err := RootCmd.Execute()
if err != nil {
log.Panic(err)
}
}