PoaGo

package
v0.0.0-...-565bcb6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2016 License: GPL-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoTraceBack

func DoTraceBack(scores, backSeqMatrix, backGrphMatrix *DpMatrix, IndexToId map[int]int) ([]int, []int)

func MakeNodeIndexMaps

func MakeNodeIndexMaps(g *PoaGraph) (map[int]int, map[int]int)

Types

type DpMatrix

type DpMatrix struct {
	// contains filtered or unexported fields
}

func DpMatrixConstruct

func DpMatrixConstruct(lX, lY int) *DpMatrix

func DpMatrixConstructFull

func DpMatrixConstructFull(lX, lY int, value float64) *DpMatrix

func (*DpMatrix) GetValue

func (self *DpMatrix) GetValue(x, y int) float64

func (*DpMatrix) SetValue

func (self *DpMatrix) SetValue(x, y int, value float64) error

func (*DpMatrix) String

func (self *DpMatrix) String() string

func (*DpMatrix) WhereMax

func (self *DpMatrix) WhereMax() (int, int, float64)

type Edge

type Edge struct {
	// contains filtered or unexported fields
}

Edge : Directed edge object

func EdgeConstruct

func EdgeConstruct(inNodeID, outNodeID int) Edge

func (*Edge) AddLabel

func (self *Edge) AddLabel(label string)

func (Edge) String

func (self Edge) String() string

type FqReader

type FqReader struct {
	Reader *bufio.Reader
	// contains filtered or unexported fields
}

FqReader holds all the necessary fields that will be use during the processing of a fasta fastq file

func (*FqReader) Iter

func (fq *FqReader) Iter() (record, bool)

Iter iterates over the records in a fasta fastq file Example (number of reacords and sequence/qual lenghts):

fp, r := files.Xopen("-") defer fp.Close() n, sLen, qLen := 0, int64(0), int64(0) var fqr fasta.FqReader fqr.Reader = r // Any reader you want ..

for r, done := fqr.iter(); !done; r, done = fqr.iter() {
	n += 1
 sLen += int64(len(r.seq))
 qLen += int64(len(r.qual))
}

type MoveOption

type MoveOption struct {
	// contains filtered or unexported fields
}

func MaxMoveOption

func MaxMoveOption(options []*MoveOption) (*MoveOption, error)

returns the MoveOption with the max score

func MoveOptionConstruct

func MoveOptionConstruct(score float64, backGraphIdx, backSeqIdx int, move string) *MoveOption

func (MoveOption) GetScore

func (self MoveOption) GetScore() float64

func (MoveOption) String

func (self MoveOption) String() string

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node : Vertex in a DAG

func NodeConstruct

func NodeConstruct(id int, base string) *Node

func (*Node) AddInEdge

func (self *Node) AddInEdge(neighborID int, label string)

func (*Node) AddOutEdge

func (self *Node) AddOutEdge(neighborID int, label string)

func (Node) InDegree

func (self Node) InDegree() int

func (Node) Labels

func (self Node) Labels() []string

func (Node) NextNode

func (self Node) NextNode(label string) int

func (Node) OutDegree

func (self Node) OutDegree() int

func (Node) String

func (self Node) String() string

type PairwiseAlignment

type PairwiseAlignment struct {
	// contains filtered or unexported fields
}

func AlignStringToGraph

func AlignStringToGraph(g *PoaGraph, aln *PairwiseAlignmentParameters, sequence, label string) *PairwiseAlignment

func PairwiseAlignmentConstruct

func PairwiseAlignmentConstruct(strIdxs, matches []int, sequence, label string) *PairwiseAlignment

type PairwiseAlignmentParameters

type PairwiseAlignmentParameters struct {
	// contains filtered or unexported fields
}

func PairwiseAlignmentParametersConstruct

func PairwiseAlignmentParametersConstruct(matchScore, mismatchScore, openGapScore, extendGapScore float64) *PairwiseAlignmentParameters

func (*PairwiseAlignmentParameters) MatchBases

func (self *PairwiseAlignmentParameters) MatchBases(c1, c2 string) float64

type PoaGraph

type PoaGraph struct {
	// contains filtered or unexported fields
}

POAGraph : A partial order graph for multiple sequence alignment

func PoaGraphConstruct

func PoaGraphConstruct() *PoaGraph

func (*PoaGraph) AddBaseSequence

func (self *PoaGraph) AddBaseSequence(sequence string, label string, updateSequence bool) (int, int)

func (*PoaGraph) AddEdge

func (self *PoaGraph) AddEdge(startId, endId int, label string)

func (*PoaGraph) AddNode

func (self *PoaGraph) AddNode(base string) int

func (*PoaGraph) AddSequenceAlignment

func (self *PoaGraph) AddSequenceAlignment(pA *PairwiseAlignment)

func (*PoaGraph) AllConsensuses

func (self *PoaGraph) AllConsensuses(maxFraction float64) ([]*[]int, []*[]string, int)

func (*PoaGraph) GenerateAlignmentStrings

func (self *PoaGraph) GenerateAlignmentStrings() ([]string, []string)

func (*PoaGraph) TopoSort

func (self *PoaGraph) TopoSort()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL