pals

package
v0.0.0-...-7b6cf24 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2012 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package implementing functions required for PALS sequence alignment

Index

Constants

View Source
const (
	MaxIGap    = 5
	DiffCost   = 3
	SameCost   = 1
	MatchCost  = DiffCost + SameCost
	BlockCost  = DiffCost * MaxIGap
	RMatchCost = DiffCost + 1
)
View Source
const (
	DefaultLength      = 400
	DefaultMinIdentity = 0.94
	MaxAvgIndexListLen = 15
	TubeOffsetDelta    = 32
)

Variables

View Source
var (
	MinWordLength = 4  // For minimum word length, choose k=4 arbitrarily.
	MaxKmerLen    = 15 // Currently limited to 15 due to 32 bit int limit for indexing slices
)

Functions

This section is empty.

Types

type FeaturePair

type FeaturePair struct {
	A, B   *feat.Feature
	Score  int     // Score of alignment between features.
	Error  float64 // Identity difference between feature sequences.
	Strand int8    // Strand relationship: positive indicates same strand, negative indicates opposite strand.
}

A FeaturePair holds a pair of features with additional information relating the two.

func NewFeaturePair

func NewFeaturePair(target, query *seq.Seq, hit dp.DPHit, comp bool) (pair *FeaturePair, err error)

Convert a DPHit and two packed sequences into a FeaturePair.

type Logger

type Logger interface {
	Print(v ...interface{})
	Printf(format string, v ...interface{})
	Println(v ...interface{})
	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})
	Fatalln(v ...interface{})
}

Interface for logger used by PALS.

type PALS

type PALS struct {
	FilterParams *filter.Params
	DPParams     *dp.Params
	// contains filtered or unexported fields
}

PALS is a type that can perform pairwise alignments of large sequences based on the papers:

PILER: identification and classification of genomic repeats.
 Robert C. Edgar and Eugene W. Myers. Bioinformatics Suppl. 1:i152-i158 (2005)
Efficient q-gram filters for finding all 𝛜-matches over a given length.
 Kim R. Rasmussen, Jens Stoye, and Eugene W. Myers. J. of Computational Biology 13:296–308 (2006).

func New

func New(target, query *seq.Seq, selfComp bool, m *morass.Morass, threads, tubeOffset int, mem *uintptr, log Logger) *PALS

Return a new PALS aligner. Requires

func (*PALS) Align

func (self *PALS) Align(complement bool) (hits dp.DPHits, err error)

Perform filtering and alignment for one strand of query.

func (*PALS) AvgIndexListLength

func (self *PALS) AvgIndexListLength(filterParams *filter.Params) float64

Return an estimate of the average number of hits for any given kmer.

func (*PALS) BuildIndex

func (self *PALS) BuildIndex() (err error)

Build the kmerindex for filtering.

func (*PALS) CleanUp

func (self *PALS) CleanUp() error

Remove filesystem components of filter. This should be called after the last use of the aligner.

func (*PALS) MemRequired

func (self *PALS) MemRequired(filterParams *filter.Params) uintptr

Return an estimate of the total amount of memory required.

func (*PALS) Optimise

func (self *PALS) Optimise(minHitLen int, minId float64) (err error)

Optimise the PALS parameters for given memory, kmer length, hit length and sequence identity. An error is returned if no satisfactory parameters can be found.

type Packer

type Packer struct {
	Packed *seq.Seq
	// contains filtered or unexported fields
}

A Packer collects a set of sequence into a Packed sequence.

func NewPacker

func NewPacker(id string) (p *Packer)

Create a new Packer.

func (*Packer) FinalisePack

func (self *Packer) FinalisePack()

Finalise the sequence packing.

func (*Packer) Pack

func (self *Packer) Pack(sequence *seq.Seq) string

Pack a sequence into the Packed sequence. Returns a string giving diagnostic information.

type Writer

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

PALS pair writer type.

func NewWriter

func NewWriter(f io.WriteCloser, v, width int, header bool) (w *Writer)

Returns a new PALS writer using f.

func NewWriterName

func NewWriterName(name string, v, width int, header bool) (w *Writer, err error)

Returns a new PALS writer using a filename, truncating any existing file. If appending is required use NewWriter and os.OpenFile.

func (*Writer) Close

func (self *Writer) Close() (err error)

Close the writer, flushing any unwritten data.

func (*Writer) Write

func (self *Writer) Write(pair *FeaturePair) (n int, err error)

Write a single feature and return the number of bytes written and any error.

Directories

Path Synopsis
Package providing PALS dynamic programming alignment routines.
Package providing PALS dynamic programming alignment routines.
Package providing PALS sequence hit filter routines based on 'Efficient q-gram filters for finding all 𝛜-matches over a given length.' Kim R. Rasmussen, Jens Stoye, and Eugene W. Myers.
Package providing PALS sequence hit filter routines based on 'Efficient q-gram filters for finding all 𝛜-matches over a given length.' Kim R. Rasmussen, Jens Stoye, and Eugene W. Myers.

Jump to

Keyboard shortcuts

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