Documentation
¶
Index ¶
- Variables
- func AllFilesFromArgs(fileArgs []string) []string
- func Arg(i int) string
- func Args() []string
- func Assert(err error, v ...interface{})
- func AssertIsDir(path string)
- func AssertLeastNArg(n int)
- func AssertNArg(n int)
- func AssertOverwritable(path string, overwritable bool)
- func BowRead(path string) bow.Bowed
- func BowWrite(w io.Writer, b bow.Bowed)
- func BowerOpen(fpath string, lib fragbag.Library, models bool) <-chan BowerErr
- func CathPath(pid string) string
- func CopyFile(src, dest string)
- func CreateFile(path string) *os.File
- func Exists(path string) bool
- func Fatalf(format string, v ...interface{})
- func FlagParse(positional string, desc string)
- func FlagUse(names ...string)
- func FmapRead(path string) *hhfrag.FragmentMap
- func FmapWrite(w io.Writer, fmap *hhfrag.FragmentMap)
- func GetFmap(fpath string) *hhfrag.FragmentMap
- func IsChainID(s string) bool
- func IsDir(path string) bool
- func IsFasta(fpath string) bool
- func IsFmap(fpath string) bool
- func IsPDB(fpath string) bool
- func IsPDBID(s string) bool
- func Library(fpath string) fragbag.Library
- func MSA(path string) seq.MSA
- func NArg() int
- func OpenBowDB(path string) *bowdb.DB
- func OpenFasta(fpath string) io.Reader
- func OpenFile(path string) *os.File
- func PDBOpen(fpath string) (*pdb.Entry, []*pdb.Chain, error)
- func PDBOpenMust(fpath string) (*pdb.Entry, []*pdb.Chain)
- func PDBPath(pid string) string
- func PDBRead(path string) *pdb.Entry
- func PDBReadId(pid string) (*pdb.Entry, *pdb.Chain)
- func ParseInt(str string) int
- func ProcessBowers(fpaths []string, lib fragbag.Library, models bool, n int, hideProgress bool) <-chan bow.Bowed
- func ReadLines(r io.Reader) []string
- func RecursiveFiles(dir string) []string
- func ScopPath(pid string) string
- func SequenceLibrary(path string) fragbag.SequenceLibrary
- func StructureLibrary(path string) fragbag.StructureLibrary
- func Usage()
- func Verbosef(format string, v ...interface{})
- func Warnf(format string, v ...interface{})
- func Warning(err error, v ...interface{}) bool
- type BowerErr
- type Progress
Constants ¶
This section is empty.
Variables ¶
var ( FlagCpu = runtime.NumCPU() FlagCpuProf = "" FlagPdbDir = path.Join("/", "data", "bio", "pdb") FlagSeqDB hhsuite.Database FlagPdbHhmDB hhfrag.PDBDatabase HHfragConf = hhfrag.DefaultConfig FlagQuiet = false )
Functions ¶
func AllFilesFromArgs ¶
func Arg ¶
Arg just calls `flag.Arg`. It's included here to avoid an extra import to `flag` just to call Arg.
func AssertIsDir ¶
func AssertIsDir(path string)
func AssertLeastNArg ¶
func AssertLeastNArg(n int)
func AssertNArg ¶
func AssertNArg(n int)
func AssertOverwritable ¶
func BowerOpen ¶
BowerOpen reads the contents of `fpath` and attempts to interpret it as a value (or values) that implement the `bow.Bower` interface. The list of `bow.Bower` values returned is guaranteed to be homogenous: they will either be all `bow.SequenceBower` values or `bow.StructureBower` values.
The actual return value of the function is a receive-only channel of BowerErr values. Each BowerErr value either has the `Bower` member set or has the `err` field set to an error that prevented the file from being opened. Errors in this case are reserved for files that appear to be capable of producing a BOW, but were unable to be read.
If the fpath given cannot be detected as a bower file, then a closed empty channel will be returned. A warning is also emitted to stderr.
`lib` is a fragment library that is used to help interpret what kind of value must be in `r`. For example, if `lib` is a sequence fragment library, then `BowerOpen` is guaranteed to return a `Bower` value that implements the `bow.SequenceBower` interface.
As of now, `BowerOpen` can read these types of files:
File extension Format Interpretation *.{ent.gz,pdb,ent} PDB whatever `lib` is *.{fasta,fas,fasta.gz,fas.gz} FASTA sequence everything else error invalid
Note that special syntax for PDB file names is supported. Namely, chain identifiers can be appended to the end of the file name, and only that chain will be included in the `bow.Bower` value. Otherwise, all chains in the PDB entry will be returned as individual `bow.Bower` values.
The format is simple and easily demonstrated by examples:
1ctf.end.gz Chains A and B 1ctf.ent.gz:A Only chain A 1ctf.ent.gz:B Only chain B 1ctf.ent.gz:A,B Chains A and B
A secondary format is also accepted. The following are equivalent to their corresponding examples above:
1ctf 1ctfA 1ctfB 1ctf:A,B
Finally, `fpath` may be the name of a PDB identifier and its file path will be inferred from the value of the `PDB_PATH` environment variable. Alternatively, `fpath` may be the name of a SCOP domain, and its corresponding PDB file will be inferred from the value of the `SCOP_PDB_PATH` environment variable.
func CathPath ¶
CathPath takes a CATH identifier (e.g., "2h5xB03") and returns the full path to the PDB file on the file system.
The CATH_PDB_PATH environment variable must be set.
func CreateFile ¶
func FmapRead ¶
func FmapRead(path string) *hhfrag.FragmentMap
func GetFmap ¶
func GetFmap(fpath string) *hhfrag.FragmentMap
func NArg ¶
func NArg() int
NArg just calls `flag.NArg`. It's included here to avoid an extra import to `flag` just to call NArg.
func PDBPath ¶
PDBPath takes a PDB identifier (e.g., "1ctf" or "1ctfA") and returns the full path to the PDB file on the file system.
The PDB_PATH environment variable must be set.
func ProcessBowers ¶
func ProcessBowers( fpaths []string, lib fragbag.Library, models bool, n int, hideProgress bool, ) <-chan bow.Bowed
ProcessBowers is a convenient wrapper around BowerOpen that processes each bower value in parallel and sends the resulting BOW value on the channel returned. The number of goroutines spawned is equivalent to N.
It is appropriate for fpaths to be the arguments given to be command line arguments. Each directory is recursively expanded to its files, and special syntax is parsed as well.
If `hideProgress` is true, then a progress bar will not be emitted to stderr.
If `models` is true, then every model in a PDB bower file will have its BOW computed. Otherwise, the first model from each chain will be used.
func RecursiveFiles ¶
func ScopPath ¶
ScopPath takes a SCOP identifier (e.g., "d3ciua1" or "d1g09c_") and returns the full path to the PDB file on the file system.
The SCOP_PDB_PATH environment variable must be set.
func SequenceLibrary ¶
func SequenceLibrary(path string) fragbag.SequenceLibrary
func StructureLibrary ¶
func StructureLibrary(path string) fragbag.StructureLibrary