Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SeqColToDense ¶
func SeqColToDense(sc SequenceCollection) *Dense
func TruncatedSVD ¶
func TruncatedSVD(data Matrix, k int) *Dense
Types ¶
type ReducedSequence ¶
type ReducedSequence struct { Header string //contig id from fasta file Hist []float64 // Un-normalized LBP histogram Svd []float64 // SVD reduced dimension vector Kmers string }
func NewReducedSequence ¶
func NewReducedSequence() *ReducedSequence
type Sequence ¶
type Sequence struct { Header string //contig id from fasta file Seq string // contig sequence NRep []float64 // numerical representation of sequence (Integer representation) LbpCodes []float64 // lbp intermediate slice Hist []float64 // Un-normalized LBP histogram Kmers string }
func NewSequence ¶
func NewSequence() *Sequence
Create a new sequence. All slices are instantiated as nil slices and speciesID is default zero.
func ReadFasta ¶
Read in a fasta file saving each sequence and header to a unique Sequence type. Store sequences in a slice https://www.socketloop.com/tutorials/golang-bufio-newreader-readline-to-read-file-line-by-line
func (*Sequence) FindLBP ¶
Threshold using signbit function and sliding window of size wind. Wind should be odd and > 0.
func (*Sequence) IntRep ¶
func (seq *Sequence) IntRep()
Create integer representation for a sequence
func (*Sequence) NewHistogram ¶
Calculate the LBP histogram
type SequenceCollection ¶
type SequenceCollection struct { sync.RWMutex Items []ReducedSequence }
http://dnaeon.github.io/concurrent-maps-and-slices-in-go/
func (*SequenceCollection) AddSVD ¶
func (sc *SequenceCollection) AddSVD(svd *Dense)
func (*SequenceCollection) Append ¶
func (cs *SequenceCollection) Append(item ReducedSequence)
func (*SequenceCollection) ToCSV ¶
func (sc *SequenceCollection) ToCSV(fname string)
func (*SequenceCollection) ToParquet ¶
func (sc *SequenceCollection) ToParquet(fname string)
Write results to parquet file. This is the recommended output format.
Click to show internal directories.
Click to hide internal directories.