Documentation
¶
Index ¶
- Constants
- Variables
- type Annotator
- func (a *Annotator) Annotate(streams ...irelate.RelatableChannel) irelate.RelatableChannel
- func (a *Annotator) AnnotateEnds(r irelate.Relatable, ends string) error
- func (a *Annotator) AnnotateOne(r irelate.Relatable, strict bool, end ...string) error
- func (a *Annotator) SetupStreams(queryFile string) ([]irelate.RelatableChannel, *vcfgo.Reader)
- func (a *Annotator) UpdateHeader(h *vcfgo.Header)
- type Reducer
- type Source
Constants ¶
const BOTH = "both_"
const INTERVAL = ""
const LEFT = "left_"
const RIGHT = "right_"
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Annotator ¶
type Annotator struct {
Sources []*Source
Strict bool // require a variant to have same ref and share at least 1 alt
Ends bool // annotate the ends of the variant in addition to the interval itself.
Less func(a, b irelate.Relatable) bool
}
Annotator holds the information to annotate a file.
func NewAnnotator ¶
NewAnnotator returns an Annotator with the sources, seeded with some javascript. If ends is true, it will annotate the 1 base ends of the interval as well as the interval itself. If strict is true, when overlapping variants, they must share the ref allele and at least 1 alt allele.
func (*Annotator) Annotate ¶
func (a *Annotator) Annotate(streams ...irelate.RelatableChannel) irelate.RelatableChannel
Annotate annotates a file with the sources in the Annotator. It accepts RelatableChannels, and returns a RelatableChannel on which it will send annotated variants.
func (*Annotator) AnnotateEnds ¶
AnnotatedEnds makes a new 1-base interval for the left and one for the right end so that it can use the same machinery to annotate the ends and the entire interval. Output into the info field is prefixed with "left_" or "right_".
func (*Annotator) AnnotateOne ¶
AnnotateOne annotates a relatable with the Sources in an Annotator. In most cases, no need to specify end (it should always be a single arugment indicting LEFT, RIGHT, or INTERVAL, used from AnnotateEnds
func (*Annotator) SetupStreams ¶ added in v0.0.4
SetupStreams takes the query file and sets everything up for annotation. If the input was a vcf, it returns the header with the new annotation fields added.
func (*Annotator) UpdateHeader ¶
UpdateHeader adds to the Infos in the vcf Header so that the annotations will be reported in the header.
type Source ¶
type Source struct {
File string
Op string
Name string
// column number in bed file or ...
Column int
// info name in VCF. (can also be ID).
Field string
// 0-based index of the file order this source is from.
Index int
Js *otto.Script
Vm *otto.Otto
}
Source holds the information for a single annotation to be added to a query. Many sources can come from the same file, but each must have their own Source.
func (*Source) AnnotateOne ¶ added in v0.0.6
func (*Source) IsNumber ¶
IsNumber indicates that we expect the Source to return a number given the op