Beispiel #1
0
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)
}
Beispiel #2
0
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)
}
Beispiel #3
0
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)
}
Beispiel #4
0
func init() {
	util.FlagParse(
		"out-file matrix-file [ matrix-file ... ]",
		"Combines the input matrices into a 'best-of-all' matrix by\n"+
			"using the best (lowest) SAS score for each pair. All given\n"+
			"matrices must be exactly the same size.")
	util.AssertLeastNArg(2)
}
Beispiel #5
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)
}
Beispiel #6
0
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)
}
Beispiel #7
0
func init() {
	flag.IntVar(&flagRandoms, "n", flagRandoms,
		"The number of random permutations to use.")
	util.FlagUse("cpu", "cpuprof")
	util.FlagParse(
		"out-file vectors-csv 'comma-sep-cath-domains' ...",
		"Computes the probability that each cluster of cath domains is\n"+
			"significantly different with respect to their Fragbag vectors.")
	util.AssertLeastNArg(3)
}
Beispiel #8
0
func init() {
	flag.IntVar(&flagNum, "n", flagNum, "The number of PDB entries to echo.")
	flag.BoolVar(&flagPaths, "paths", flagPaths,
		"When set, full file paths will be echoed instead of PDB ids.")

	util.FlagUse("pdb-dir")
	util.FlagParse("", "")

	rand.Seed(time.Now().UnixNano())
}
Beispiel #9
0
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)
}
Beispiel #10
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),
		)
	}
}
Beispiel #11
0
func init() {
	flag.StringVar(&flagFragbag, "fragbag", "fragbag",
		"The old fragbag executable.")
	flag.BoolVar(&flagOldStyle, "oldstyle", false,
		"When true, PDB chains will be concatenated together as if they were "+
			"one chain to compute a BOW vector.")

	util.FlagParse(
		"library-file brk-file pdb-file [pdb-file ...]",
		"Note that if the old library and the new library don't have the\n"+
			"same number of fragments and the same fragment size, bad things\n"+
			"will happen.\n")
	util.AssertLeastNArg(3)
}
Beispiel #12
0
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)
}
Beispiel #13
0
func init() {
	flag.StringVar(&flagChain, "chain", flagChain,
		"This may be set to one or more chain identifiers. Only amino acids "+
			"belonging to a chain specified will be included.")
	flag.StringVar(&flagSplit, "split", flagSplit,
		"When set, each FASTA entry produced will be written to a file in the "+
			"specified directory with the PDB id code and chain identifier as "+
			"the name.")

	util.FlagParse("in-pdb-file [out-fasta-file]", "")

	if util.NArg() != 1 && util.NArg() != 2 {
		util.Usage()
	}
}
Beispiel #14
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),
		)
	}
}
Beispiel #15
0
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)
	}
}
Beispiel #16
0
func init() {
	flag.Float64Var(&flagThreshold, "threshold", flagThreshold,
		"Set the distance threshold to use when computing AUC.")
	util.FlagUse("cpu", "cpuprof")
	util.FlagParse(
		"cath-domain-labels best-of-all-matrix"+
			"(bowdb | matrix-file) out-file "+
			"[ (bowdb | matrix-file) out-file ... ]",
		"Computes the AUC of each aligner matrix (or BOW database) given\n"+
			"with respect to the 'best-of-all' matrix given. Each AUC is\n"+
			"written to a separate out-file. The sizes of all matrices must\n"+
			"be exactly equivalent.\n"+
			"Files are interpreted as BOW databases if they have a '.bowdb'\n"+
			"file extension.")
	util.AssertLeastNArg(4)
	if util.NArg()%2 != 0 {
		util.Fatalf("There must be an out file for each matrix or bowdb file.")
	}
}
Beispiel #17
0
func init() {
	u := "pdb-file chain-id start stop pdb-file chain-id start stop"
	util.FlagParse(u, "")
	util.AssertNArg(8)
}
Beispiel #18
0
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)
}
Beispiel #19
0
func init() {
	util.FlagParse("fasta-file",
		"Quickly count the number of sequences in a fasta file.")
	util.AssertNArg(1)
}
Beispiel #20
0
func init() {
	util.FlagParse("fmap-file", "")
	util.AssertNArg(1)
}
Beispiel #21
0
func init() {
	u := "fraglib pdb-file [ chain-id [ start stop ] ]"
	util.FlagParse(u, "")
	util.AssertLeastNArg(2)
}
Beispiel #22
0
func init() {
	util.FlagParse("bow1 bow2", "")
	util.AssertNArg(2)
}
Beispiel #23
0
func init() {
	util.FlagParse("fasta-file out-dir",
		"Split a single FASTA file into a set of files for each sequence.")
	util.AssertNArg(2)
}
Beispiel #24
0
func init() {
	util.FlagParse("frag-lib-path output-file", "")
	util.AssertNArg(2)
}
Beispiel #25
0
func init() {
	util.FlagUse("cpu", "seq-db", "pdb-hhm-db", "blits", "verbose",
		"hhfrag-min", "hhfrag-max", "hhfrag-inc")
	util.FlagParse("out-dir target-fasta", "")
	util.AssertLeastNArg(2)
}
Beispiel #26
0
func init() {
	util.FlagUse("cpu")
	util.FlagParse("frag-lib-dir fmap-file out-bow", "")
	util.AssertNArg(3)
}