Documentation ¶
Overview ¶
Package emdepth uses a simplified EM algorithm to assign copy-number given a set of depths. it is based off the implementation in cn.mops. Like cn.mops, it works best with more samples and it assumes that most samples will have copy-number 2. emdepth consists of a single function EMDepth that iteratively assigns depths to copy-numbers, adjusts the center of each copy-number bin. and re-assigns... This package does no normalization and therefore expects incoming data to be normalized.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CNV ¶
type CNV struct { SampleI int Depth []float32 Position []Position Log2FC []float32 CN []int PSize int }
CNV holds the information for a CNV for a single sample.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a way to track depth states.eps As new items are added to the cache, the value from EMD.Same is compared. Each time an EMD is added, a slice of Regions that have ended is returned.
type EMD ¶
type EMD struct { Lambda []float64 Depths []float32 Position Position // contains filtered or unexported fields }
EMD holds the posterior maximum depth for each copy-number
func EMDepth ¶
EMDepth returns a slice of integer copy-numbers (CNs) corresponding to the given normalized depths. It uses a simple EM to assign depths to copy-numbers bins with a preference for CN 2. And to adjust the mean depth of each bin after each iteration. I is a unique identifier for the depths that can be use to assiciate the returned struct with position info.