本文整理匯總了Golang中github.com/abeconnelly/simplestream.SimpleStream.Init方法的典型用法代碼示例。如果您正苦於以下問題:Golang SimpleStream.Init方法的具體用法?Golang SimpleStream.Init怎麽用?Golang SimpleStream.Init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/abeconnelly/simplestream.SimpleStream
的用法示例。
在下文中一共展示了SimpleStream.Init方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: _main
func _main(c *cli.Context) {
if c.String("input") == "" {
fmt.Fprintf(os.Stderr, "Input required, exiting\n")
cli.ShowAppHelp(c)
os.Exit(1)
}
gff_ain, err := autoio.OpenReadScannerSimple(c.String("input"))
_ = gff_ain
if err != nil {
fmt.Fprintf(os.Stderr, "%v", err)
os.Exit(1)
}
defer gff_ain.Close()
ref_ain := simplestream.SimpleStream{}
ref_fp := os.Stdin
if c.String("ref-input") != "-" {
var e error
ref_fp, e = os.Open(c.String("ref-input"))
if e != nil {
fmt.Fprintf(os.Stderr, "%v", err)
os.Exit(1)
}
defer ref_fp.Close()
}
ref_ain.Init(ref_fp)
var ref_start int64
ref_start = 0
ss := c.Int("ref-start")
if ss > 0 {
ref_start = int64(ss)
}
var seq_start int64
seq_start = 0
_ = seq_start
ss = c.Int("seq-start")
if ss > 0 {
seq_start = int64(ss)
}
aout := os.Stdout
if c.String("output") != "-" {
aout, err = os.Open(c.String("output"))
if err != nil {
fmt.Fprintf(os.Stderr, "%v", err)
os.Exit(1)
}
defer aout.Close()
}
if c.Bool("pprof") {
gProfileFlag = true
gProfileFile = c.String("pprof-file")
}
if c.Bool("mprof") {
gMemProfileFlag = true
gMemProfileFile = c.String("mprof-file")
}
gVerboseFlag = c.Bool("Verbose")
if c.Int("max-procs") > 0 {
runtime.GOMAXPROCS(c.Int("max-procs"))
}
allele := c.Int("allele")
if gProfileFlag {
prof_f, err := os.Create(gProfileFile)
if err != nil {
fmt.Fprintf(os.Stderr, "Could not open profile file %s: %v\n", gProfileFile, err)
os.Exit(2)
}
pprof.StartCPUProfile(prof_f)
defer pprof.StopCPUProfile()
}
e := convert(&gff_ain, &ref_ain, aout, ref_start, allele)
if e != nil && e != io.EOF {
panic(e)
}
aout.Sync()
}
示例2: _main
func _main(c *cli.Context) {
var err error
if c.String("input") == "" {
fmt.Fprintf(os.Stderr, "Input required, exiting\n")
cli.ShowAppHelp(c)
os.Exit(1)
}
pasta_ain := simplestream.SimpleStream{}
pasta_fp := os.Stdin
if len(c.String("input")) > 0 && c.String("input") != "-" {
var e error
pasta_fp, e = os.Open(c.String("input"))
if e != nil {
fmt.Fprintf(os.Stderr, "%v", e)
os.Exit(1)
}
defer pasta_fp.Close()
}
pasta_ain.Init(pasta_fp)
aout := os.Stdout
if c.String("output") != "-" {
aout, err = os.Open(c.String("output"))
if err != nil {
fmt.Fprintf(os.Stderr, "%v", err)
os.Exit(1)
}
defer aout.Close()
}
/*
aout := os.Stdout
if err!=nil {
fmt.Fprintf(os.Stderr, "%v", err)
os.Exit(1)
}
*/
if c.Bool("pprof") {
gProfileFlag = true
gProfileFile = c.String("pprof-file")
}
if c.Bool("mprof") {
gMemProfileFlag = true
gMemProfileFile = c.String("mprof-file")
}
gVerboseFlag = c.Bool("Verbose")
if c.Int("max-procs") > 0 {
runtime.GOMAXPROCS(c.Int("max-procs"))
}
if gProfileFlag {
prof_f, err := os.Create(gProfileFile)
if err != nil {
fmt.Fprintf(os.Stderr, "Could not open profile file %s: %v\n", gProfileFile, err)
os.Exit(2)
}
pprof.StartCPUProfile(prof_f)
defer pprof.StopCPUProfile()
}
convert(&pasta_ain, aout)
}