当前位置: 首页>>代码示例>>Golang>>正文


Golang util.FlagParse函数代码示例

本文整理汇总了Golang中github.com/TuftsBCB/tools/util.FlagParse函数的典型用法代码示例。如果您正苦于以下问题:Golang FlagParse函数的具体用法?Golang FlagParse怎么用?Golang FlagParse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FlagParse函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: init

func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	util.FlagUse("cpu")
	util.FlagParse("database-path frag-lib-dir query-pdb-file "+
		"[query-pdb-file ...]", "")
	util.AssertLeastNArg(2)
}
开发者ID:TuftsBCB,项目名称:experiments,代码行数:7,代码来源:main.go

示例2: init

func init() {
	flag.StringVar(&flagChain, "chain", flagChain,
		"When set, only this chain will be tested for a correspondence. "+
			"Otherwise, all chains will be tested.")

	util.FlagParse("pdb-file", "")
	util.AssertNArg(1)
}
开发者ID:TuftsBCB,项目名称:tools,代码行数:8,代码来源:main.go

示例3: main

func main() {
	flag.BoolVar(&flagAllFragments, "all-fragments", flagAllFragments,
		"When set, all fragments will be shown, even if the best fragment\n"+
			"of each residue set is the same.")
	util.FlagParse(
		"fraglib align.{fasta,ali,a2m,a3m} out-csv",
		"Writes a CSV file to out-csv containing the best matching fragment\n"+
			"for each pairwise contiguous set of residues between the\n"+
			"first two proteins in the alignment.")
	util.AssertNArg(3)
	flib := util.SequenceLibrary(util.Arg(0))
	aligned := util.MSA(util.Arg(1))
	outcsv := util.CreateFile(util.Arg(2))

	csvWriter := csv.NewWriter(outcsv)
	csvWriter.Comma = '\t'
	defer csvWriter.Flush()

	pf := func(record ...string) {
		util.Assert(csvWriter.Write(record), "Problem writing to '%s'", outcsv)
	}
	pf("start1", "end1", "start2", "end2", "frag1", "frag2", "rat1", "rat2")
	iter := newContiguous(
		flib.FragmentSize(), aligned.GetFasta(0), aligned.GetFasta(1))
	for iter.next() {
		best1 := flib.BestSequenceFragment(iter.res1)
		best2 := flib.BestSequenceFragment(iter.res2)
		if !flagAllFragments && best1 == best2 {
			continue
		}
		if best1 == -1 || best2 == -1 {
			continue
		}
		p1 := flib.AlignmentProb(best1, iter.res1)
		p2 := flib.AlignmentProb(best2, iter.res2)
		if p1.Distance(p2) > 0.14 {
			continue
		}
		pf(
			fmt.Sprintf("%d", iter.s1()),
			fmt.Sprintf("%d", iter.e1()),
			fmt.Sprintf("%d", iter.s2()),
			fmt.Sprintf("%d", iter.e2()),
			fmt.Sprintf("%d", best1),
			fmt.Sprintf("%d", best2),
			fmt.Sprintf("%f", p1),
			fmt.Sprintf("%f", p2),
		)
	}
}
开发者ID:TuftsBCB,项目名称:experiments,代码行数:50,代码来源:main.go


注:本文中的github.com/TuftsBCB/tools/util.FlagParse函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。