8. ~ vsa
vsa stands for *Very Simple Annotator*. This package annotates variants in VCF format
Usage:
vsa [command]
Available Commands:
dx Annotate and classify variants given a VCF file
help Help about any command
server Run vsa server at port 9090
train Prepare features for training or standardization
Flags:
-h, --help help for vsa
Use "vsa [command] --help" for more information about a command.
10. Premissas do
VSA-Worker ● Receber os exames que precisamos processar
● Delegar a execução para o nosso binário
● Notificar em caso de erro no processamento
17. Faktory
https://github.com/contribsys/faktory
● Criador do Sidekiq
● Feito em Go
● Clientes em Go e Ruby "oficiais"
● Usa RocksDB para persistência
● Vem com um dashboard built-in
● Retry automático
● Pode agendar execução de um job
29. ~ vsa dx --help
Annotate and classify variants given a VCF file.
Usage:
vsa dx [flags]
Flags:
--assembly string Supported assemblies: GRCh37 or GRCh38.
--vcf string VCF file address.
30. Criando um job
go get -u github.com/contribsys/faktory/client
import (
faktory "github.com/contribsys/faktory/client"
)
func send(){
client, err := faktory.Open()
if err != nil {
// tratamento de erro
}
defer client.Close()
job := faktory.NewJob("dx", "GRCh37", "/path/to/file")
if err := client.Push(job); err != nil {
// tratamento de erro
}
}
33. ~ vsa dx --help
Annotate and classify variants given a VCF file.
Usage:
vsa dx [flags]
Flags:
--assembly string Supported assemblies: GRCh37 or GRCh38.
--vcf string VCF file address.
49. Premissas do
VSA-Worker ● Receber os exames que precisamos processar
● Delegar a execução para o nosso binário
● Notificar em caso de erro no processamento
50. main.go
package main
import (
// ...
)
func main() {
// running workers in background
go func() {
worker.Run()
}()
// configure API handlers
svc := api.New()
http.Handle("/", svc.Handler())
logrus.WithField("port", config.Port).Info("starting server")
if err := http.ListenAndServe(":"+config.Port, nil); err != nil {
logrus.WithError(err).Fatalf("something went wrong")
}
}
51. main.go
package main
import (
// ...
)
func main() {
// running workers in background
go func() {
worker.Run()
}()
// configure API handlers
svc := api.New()
http.Handle("/", svc.Handler())
logrus.WithField("port", config.Port).Info("starting server")
if err := http.ListenAndServe(":"+config.Port, nil); err != nil {
logrus.WithError(err).Fatalf("something went wrong")
}
}
52. main.go
package main
import (
// ...
)
func main() {
// running workers in background
go func() {
worker.Run()
}()
// configure API handlers
svc := api.New()
http.Handle("/", svc.Handler())
logrus.WithField("port", config.Port).Info("starting server")
if err := http.ListenAndServe(":"+config.Port, nil); err != nil {
logrus.WithError(err).Fatalf("something went wrong")
}
}
53. api.go
package main
import (
// ...
)
func (s Service) Handler() *mux.Router {
r := mux.NewRouter()
r.PathPrefix("/api")
r.HandleFunc("/v1/import", s.importHandler).Methods("POST")
return r
}
54. api.go
package main
import (
// ...
)
func (s Service) Handler() *mux.Router {
r := mux.NewRouter()
r.PathPrefix("/api")
r.HandleFunc("/v1/import", s.importHandler).Methods("POST")
return r
}