Documentation ¶
Index ¶
- func ElementOverlapProbabilities(elements1 []Lift, elements2 []Lift, noGapRegions []Lift) []float64
- func EnrichmentPValueApproximation(elementOverlapProbs []float64, overlapCount int) []float64
- func EnrichmentPValueExact(elementOverlapProbs []float64, overlapCount int) []float64
- func EnrichmentPValueLowerBound(elements1 []Lift, elements2 []Lift, noGapRegions []Lift, overlapCount int, ...) []float64
- func EnrichmentPValueUpperBound(elements1 []Lift, elements2 []Lift, noGapRegions []Lift, overlapCount int, ...) []float64
- func GoReadToChan(inputFile string) <-chan Lift
- func IsSelfOverlapping(b []Lift, verbose int) bool
- func LiftCoordinatesWithChain(c chain.Chain, i Lift) (string, int, int)
- func MatchOverlapLen(start1 int, end1 int, start2 int, end2 int) int
- func MatchProportion(c chain.Chain, i interval.Interval) (float64, float64)
- func OverlapCount(a []Lift, b []Lift) int
- func ReadToChan(inputFile string, send chan<- Lift)
- func SortByCoord(b []Lift)
- func StrictBorderCheck(c chain.Chain, i interval.Interval) bool
- type Lift
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ElementOverlapProbabilities ¶
ElementOverlapProbabilities returns a slice of float64 representing the probabilities that an element in elements2 overlaps an element in elements1.
func EnrichmentPValueApproximation ¶
EnrichmentPValueApproximation performs a calculation of enrichment based on a set of overlap probabilities and the observed overlap count. Uses a normal approximation of the resulting binomial distribution. Very fast and should converge on the correct answer. This is the preferred method. Returns a slice of four values. The first represents a debug check (hardcoded to one), the second is the expected number of overlaps, and the third and fourth represent the pValues for enrichment and depletion, respectively.
func EnrichmentPValueExact ¶
EnrichmentPValueExact performs an exact calculation fo enrichment bgaased on a set of overlap probabilities and the observed overlap count. The exact method is non-polynomial, and is thus not recommended for large datasets. Returns a slice of four values. The first is the debug check, the second is the expected number of overlaps, and the third and fourth represent the pValues for enrichment and depletion, respectively.
func EnrichmentPValueLowerBound ¶
func EnrichmentPValueLowerBound(elements1 []Lift, elements2 []Lift, noGapRegions []Lift, overlapCount int, verbose int) []float64
EnrichmentPValueLowerBound together with EnrichmentPValueUpperBound provide a range of possible values for the pValue of overlap. Returns a slice of four values. The first is the debug check, the second is the expected number of overlaps, and the third and fourth represent the pValues for enrichment and depletion, respectively.
func EnrichmentPValueUpperBound ¶
func EnrichmentPValueUpperBound(elements1 []Lift, elements2 []Lift, noGapRegions []Lift, overlapCount int, verbose int) []float64
EnrichmentPValueUpperBound, together with EnrichmentPValueLowerBound, provide a range of possible values for the pValue of overlap. Returns a slice of four values. The first is the debug check, the second is the expected number of overlaps, and the third and fourth represent the pValues for enrichment and depletion, respectively.
func GoReadToChan ¶
GoReadToChan reads Lift interfaces to a channel from an input file.
func IsSelfOverlapping ¶
IsSelfOverlapping returns true if any elements in a Lift slice overlap another element in the same slice. False otherwise. b must be presorted with SortByCoord. Verbose > 0 reveals debug prints.
func LiftCoordinatesWithChain ¶
LiftCoordinatesWithChain returns the update coordinates for an input Lift interface based on an input chain.
func MatchOverlapLen ¶
MatchOverlapLen returns the number of bases shared between two start and end points. Used in MatchProportion.
func MatchProportion ¶
MatchProportion returns the proportion of bases in the target and query that can be lifted for a particular interval as a pair of floats (propT, propQ).
func OverlapCount ¶
OverlapCount returns the number of elements from list one that have any overlap with list two. Answers range from 0 to len(a). Input Lift slices must be presorted with SortByCoord.
func ReadToChan ¶
ReadToChan reads from a file to send Lift interfaces to a chan<- Lift.
func SortByCoord ¶
func SortByCoord(b []Lift)
SortByCoord sorts a slice of Lift interfaces by their coordinates.
Types ¶
type Lift ¶
type Lift interface { GetChrom() string GetChromStart() int GetChromEnd() int WriteToFileHandle(io.Writer) UpdateCoord(string, int, int) interface{} }
Lift is an interface for genomic regions. Unlike interval, Lifts can be edited in place.
func GoRead ¶
GoRead reads Lift interfaces from an input file to a slice. Uses Chans under the hood.
func IntervalSliceToLift ¶
IntervalSliceToLift casts a slice of intervals to a slice of Lift interfaces.