Documentation ¶
Overview ¶
Package pasta provides primitives for manipulating PASTA streams.
Index ¶
- Constants
- Variables
- func ControlMessagePrint(msg *ControlMessage, out *bufio.Writer)
- func InterleaveStreams(stream_A, stream_B io.Reader, w io.Writer) error
- func InterleaveToDiff(stream *bufio.Reader, process RefVarProcesser) error
- func InterleaveToDiffInterface(stream *bufio.Reader, p RefVarPrinter, w io.Writer) error
- type ControlMessage
- type PastaHandle
- type RefVarInfo
- type RefVarPrinter
- type RefVarProcesser
Constants ¶
Variables ¶
var AltMap map[byte]byte
Key is the pasta character, value is the implied sequence character
var BPState map[byte]int
var DelMap map[byte]byte
var InsMap map[byte]byte
var IsAltDel map[byte]bool
var RefDelBP map[byte]int
var RefMap map[byte]byte
Key is pasta character, value is the lower case sequence value of the reference
var SubMap map[byte]map[byte]byte
Maps lower case sequence [gcat] reference and alt to pasta character e.g. reference 'c' and alt 'a': SubMap['c']['a'] = '='
var Token []byte
All valid pasta tokens
Functions ¶
func ControlMessagePrint ¶
func ControlMessagePrint(msg *ControlMessage, out *bufio.Writer)
func InterleaveToDiff ¶
func InterleaveToDiff(stream *bufio.Reader, process RefVarProcesser) error
Read from an interleaved stream and print out a simplified variant difference format
Each token from the stream should be interleaved and aligned. Each token can be processed two at a time, where the first token is from the first stream and the second is from the second stream. The resulting difference format spits out contigs of ref, non-ref and alts where appropriate.
The 'process' callback will be called for every variant line that gets processed.
func InterleaveToDiffInterface ¶
Read from an interleaved stream and print out a simplified variant difference format
Each token from the stream should be interleaved and aligned. Each token can be processed two at a time, where the first token is from the first stream and the second is from the second stream. The resulting difference format spits out contigs of ref, non-ref and alts where appropriate.
The 'process' callback will be called for every variant line that gets processed.
func interleave_to_diff_iface(stream *bufio.Reader, p RefVarPrinter, w io.Writer) error {
Types ¶
type ControlMessage ¶
type ControlMessage struct { Type int N int NBytes int Chrom string RefPos int RefLen int Comment string }
func ControlMessageProcess ¶
func ControlMessageProcess(stream *bufio.Reader) (ControlMessage, error)
type PastaHandle ¶
type RefVarInfo ¶
type RefVarPrinter ¶
type RefVarPrinter interface { Header(out *bufio.Writer) error Print(vartype int, ref_start, ref_len int, refseq []byte, altseq [][]byte, out *bufio.Writer) error PrintEnd(out *bufio.Writer) error Pasta(line string, ref_stream *bufio.Reader, out *bufio.Writer) error PastaBegin(out *bufio.Writer) error PastaEnd(out *bufio.Writer) error Chrom(chr string) Pos(pos int) GetRefPos() int Init() }