예제 #1
0
파일: main.go 프로젝트: TuftsBCB/tools
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)
}
예제 #2
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	util.FlagUse("cpu")
	util.FlagParse("frag-lib-dir chain pdb-file out-bow",
		"Computes and outputs a BOW file for the specified chain in the\n"+
			"given PDB file. If 'out-bow' is '--', then a human readable\n"+
			"version of the BOW will be printed to stdout instead.")
	util.AssertNArg(4)
}
예제 #3
0
func init() {
	flag.Float64Var(&flagRmsd, "rmsd", flagRmsd,
		"The RMSD cut-off to use to determine true positives.")

	util.FlagUse("pdb-dir")
	util.FlagParse("fmap-file", "")
	util.AssertNArg(1)
}
예제 #4
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	flag.BoolVar(&flagQuiet, "quiet", flagQuiet,
		"When set, hhblits/hhmake output will be hidden.")

	util.FlagUse("seq-db")
	util.FlagParse("in-fasta-file out-hhm-file", "")
	util.AssertNArg(2)
}
예제 #5
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	flag.Float64Var(&flagThreshold, "threshold", flagThreshold,
		"The threshold at which to cut the tree.")
	flag.StringVar(&flagGobIt, "gobit", flagGobIt,
		"If set, alignment distances will be cached to the file given, "+
			"then mattbench-cluster will quit.")

	util.FlagUse("cpu", "cpuprof", "verbose")
	util.FlagParse(
		"(astral-alignment-dir | alignment-distances-gob) dendrogram-tree "+
			"out-clusters.csv",
		"Where `dendrogram-tree` is a file in Newick tree format.")
	if len(flagGobIt) > 0 {
		util.AssertNArg(1)
	} else {
		util.AssertNArg(3)
	}
}
예제 #6
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	flag.BoolVar(&flagPaths, "paths", flagPaths,
		"When set, the full path of each PDB chain identifier will be\n"+
			"displayed, based on the value of the PDB_PATH environment\n"+
			"variable.")

	util.FlagParse("pdb-select-file",
		"Given a file in the PDB Select format, output a list of PDB chain "+
			"identifiers (one per line).")
	util.AssertNArg(1)
}
예제 #7
0
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),
		)
	}
}
예제 #8
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	flag.StringVar(&flagInFmt, "infmt", flagInFmt,
		"Force the format of the input file. Legal values are fasta, "+
			"stockholm, a2m and a3m.")
	flag.StringVar(&flagOutFmt, "outfmt", flagOutFmt,
		"Force the format of the output file. Legal values are fasta, "+
			"stockholm, a2m and a3m.")

	util.FlagParse("in-msa out-msa",
		"Convert the format of an MSA file from 'in-msa' to 'out-msa'.\n"+
			"The formats are auto detected from the file's extension, but\n"+
			"they may be forced with the 'infmt' and 'outfmt' flags.")
	util.AssertNArg(2)
}
예제 #9
0
func main() {
	flag.BoolVar(&flagAllFragments, "all-fragments", flagAllFragments,
		"When set, all fragments will be shown, even if the best fragment\n"+
			"of each ATOM set is the same.")
	util.FlagParse(
		"fraglib align.{fasta,ali,a2m,a3m} pdb-file out-csv",
		"Writes a CSV file to out-csv containing the best matching fragment\n"+
			"for each pairwise contiguous set of alpha-carbon atoms of the\n"+
			"first two proteins in the alignment and PDB file.")
	util.AssertNArg(4)
	flib := util.StructureLibrary(util.Arg(0))
	aligned := util.MSA(util.Arg(1))
	pentry := util.PDBRead(util.Arg(2))
	outcsv := util.CreateFile(util.Arg(3))

	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", "frag_rmsd")
	iter := newContiguous(
		flib.FragmentSize(),
		aligned.GetFasta(0), aligned.GetFasta(1),
		pentry.Chains[0], pentry.Chains[1])
	for iter.next() {
		best1 := flib.BestStructureFragment(iter.atoms1)
		best2 := flib.BestStructureFragment(iter.atoms2)
		if !flagAllFragments && best1 == best2 {
			continue
		}
		bestRmsd := structure.RMSD(flib.Atoms(best1), flib.Atoms(best2))
		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", bestRmsd),
		)
	}
}
예제 #10
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	util.FlagParse("fasta-file out-dir",
		"Split a single FASTA file into a set of files for each sequence.")
	util.AssertNArg(2)
}
예제 #11
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	u := "pdb-file chain-id start stop pdb-file chain-id start stop"
	util.FlagParse(u, "")
	util.AssertNArg(8)
}
예제 #12
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	util.FlagParse("fasta-file",
		"Quickly count the number of sequences in a fasta file.")
	util.AssertNArg(1)
}
예제 #13
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	util.FlagParse("fmap-file", "")
	util.AssertNArg(1)
}
예제 #14
0
func init() {
	util.FlagParse("frag-lib-path output-file", "")
	util.AssertNArg(2)
}
예제 #15
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	util.FlagUse("cpu", "seq-db", "pdb-hhm-db", "blits",
		"hhfrag-min", "hhfrag-max", "hhfrag-inc")
	util.FlagParse("target-fasta out-fmap", "")
	util.AssertNArg(2)
}
예제 #16
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	util.FlagParse("bow1 bow2", "")
	util.AssertNArg(2)
}
예제 #17
0
파일: main.go 프로젝트: TuftsBCB/tools
func init() {
	util.FlagUse("cpu")
	util.FlagParse("frag-lib-dir fmap-file out-bow", "")
	util.AssertNArg(3)
}