Documentation
¶
Index ¶
- Constants
- func AlphabetFromString(alphabet string) int
- func Complement(seq []rune) (err error)
- func DetectAlphabet(seq string) int
- func NewAlign(alphabet int) *align
- func NewPwAligner(seq1, seq2 Sequence, algo int) *pwaligner
- func NewSeqBag(alphabet int) *seqbag
- func NewSequence(name string, sequence []rune, comment string) *seq
- func RandomSequence(alphabet, length int) ([]rune, error)
- func Reverse(seq []rune)
- type AlignChannel
- type Alignment
- type PairwiseAligner
- type SeqBag
- type Sequence
Constants ¶
View Source
const ( ALIGN_UP = iota ALIGN_LEFT ALIGN_DIAG ALIGN_STOP ALIGN_ALGO_SW = iota ALIGN_ALGO_ATG )
View Source
const ( AMINOACIDS = 0 // Amino acid sequence alphabet NUCLEOTIDS = 1 // Nucleotid sequence alphabet BOTH = 2 // Could be both UNKNOWN = 3 // Unkown alphabet GAP = '-' POINT = '.' OTHER = '*' ALL_AMINO = 'X' ALL_NUCLE = 'N' PSSM_NORM_NONE = 0 // No normalization PSSM_NORM_FREQ = 1 // Normalization by freq in the site PSSM_NORM_DATA = 2 // Normalization by aa/nt frequency in data PSSM_NORM_UNIF = 3 // Normalization by uniform frequency PSSM_NORM_LOGO = 4 // Normalization like LOGO : v(site)=freq*(log2(alphabet)-H(site)-pseudocount FORMAT_FASTA = 0 FORMAT_PHYLIP = 1 FORMAT_NEXUS = 2 FORMAT_CLUSTAL = 3 POSITION_IDENTICAL = 0 // All characters in a position are the same POSITION_CONSERVED = 1 // Same strong group POSITION_SEMI_CONSERVED = 2 // Same weak group POSITION_NOT_CONSERVED = 3 // None of the above values )
Variables ¶
This section is empty.
Functions ¶
func AlphabetFromString ¶ added in v0.2.3
func DetectAlphabet ¶
func NewPwAligner ¶ added in v0.3.0
func NewSequence ¶
func RandomSequence ¶ added in v0.1.3
Types ¶
type AlignChannel ¶ added in v0.2.4
type Alignment ¶
type Alignment interface {
SeqBag
AddGaps(rate, lenprop float64)
AvgAllelesPerSite() float64
BuildBootstrap() Alignment
CharStatsSite(site int) (map[rune]int, error)
Clone() (Alignment, error)
CodonAlign(ntseqs SeqBag) (codonAl *align, err error)
Concat(Alignment) error // concatenates the given alignment with this alignment
Entropy(site int, removegaps bool) (float64, error) // Entropy of the given site
Length() int // Length of the alignment
Mask(start, length int) error // Masks given positions
MaxCharStats() ([]rune, []int)
Mutate(rate float64) // Adds uniform substitutions in the alignment (~sequencing errors)
NbVariableSites() int // Nb of variable sites
Pssm(log bool, pseudocount float64, normalization int) (pssm map[rune][]float64, err error) // Normalization: PSSM_NORM_NONE, PSSM_NORM_UNIF, PSSM_NORM_DATA
Rarefy(nb int, counts map[string]int) (Alignment, error) // Take a new rarefied sample taking into accounts weights
RandSubAlign(length int) (Alignment, error) // Extract a random subalignment with given length from this alignment
Recombine(rate float64, lenprop float64)
RemoveGapSeqs(cutoff float64) // Removes sequences having >= cutoff gaps
RemoveGapSites(cutoff float64) // Removes sites having >= cutoff gaps
Sample(nb int) (Alignment, error) // generate a sub sample of the sequences
ShuffleSites(rate float64, roguerate float64, randroguefirst bool) []string
SimulateRogue(prop float64, proplen float64) ([]string, []string) // add "rogue" sequences
SiteConservation(position int) (int, error) // If the site is conserved:
SubAlign(start, length int) (Alignment, error) // Extract a subalignment from this alignment
Swap(rate float64)
TrimSequences(trimsize int, fromStart bool) error
}
func RandomAlignment ¶ added in v0.1.3
type PairwiseAligner ¶ added in v0.3.0
type PairwiseAligner interface {
AlignEnds() (int, int)
AlignStarts() (int, int)
SetGapOpenScore(open float64)
SetGapExtendScore(extend float64)
SetScore(match, mismatch float64)
MaxScore() float64 // Maximum score of the alignment
NbMatches() int // Number of matches
NbMisMatches() int // Number of mismatches
NbGaps() int // Nuber of gaps
Length() int // Length of the alignment
Alignment() (Alignment, error)
AlignmentStr() string
}
type SeqBag ¶ added in v0.3.0
type SeqBag interface {
AddSequence(name string, sequence string, comment string) error
AddSequenceChar(name string, sequence []rune, comment string) error
AppendSeqIdentifier(identifier string, right bool)
Alphabet() int
AlphabetStr() string
AlphabetCharacters() []rune
AutoAlphabet() // detects and sets alphabet automatically for all the sequences
CharStats() map[rune]int64
CleanNames() // Clean sequence names (newick special char)
Clear() // Removes all sequences
CloneSeqBag() (seqs SeqBag, err error) // Clones the seqqbag
Deduplicate() error // Remove duplicate sequences
GetSequence(name string) (string, bool) // Get a sequence by names
GetSequenceById(ith int) (string, bool)
GetSequenceChar(name string) ([]rune, bool)
GetSequenceCharById(ith int) ([]rune, bool)
GetSequenceNameById(ith int) (string, bool)
SetSequenceChar(ithAlign, ithSite int, char rune) error
Sequence(ith int) (Sequence, bool)
SequenceByName(name string) (Sequence, bool)
Identical(SeqBag) bool
Iterate(it func(name string, sequence string))
IterateChar(it func(name string, sequence []rune))
IterateAll(it func(name string, sequence []rune, comment string))
Sequences() []Sequence
LongestORF(reverse bool) (orf Sequence, err error)
MaxNameLength() int // maximum sequence name length
NbSequences() int
Phase(orfs SeqBag, lencutoff, matchcutoff float64, reverse bool, cutend bool, cpus int) (seqs SeqBag, aaseqs SeqBag, positions []int, removed []string, err error)
PhaseNt(orf Sequence, lencutoff, matchcutoff float64, reverse bool, cutend bool, cpus int) (seqs SeqBag, positions []int, removed []string, err error)
Rename(namemap map[string]string)
RenameRegexp(regex, replace string, namemap map[string]string) error
ShuffleSequences() // Shuffle sequence order
String() string // Raw string representation (just write all sequences)
Translate(phase int) (err error) // Translates nt sequence in aa
TrimNames(namemap map[string]string, size int) error
TrimNamesAuto(namemap map[string]string, curid *int) error
Sort() // Sorts the sequences by name
Unalign() SeqBag
}
type Sequence ¶
type Sequence interface {
Sequence() string
SequenceChar() []rune
CharAt(int) rune
Name() string
SetName(name string)
Comment() string
Length() int
LongestORF() (start, end int) // Detects the longest ORF in forward strand only
Reverse()
Complement() error // Returns an error if not nucleotide sequence
Translate(phase int) (Sequence, error) // Translates the sequence using the standard code
DetectAlphabet() int // Try to detect alphabet (nt or aa)
Clone() Sequence
}
Click to show internal directories.
Click to hide internal directories.