pasta

package module
v0.0.0-...-768acc0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2017 License: AGPL-3.0 Imports: 6 Imported by: 2

README

pasta

Experimental

Documentation

Overview

Package pasta provides primitives for manipulating PASTA streams.

Index

Constants

View Source
const (
	BEG         = iota // 0
	REF         = iota
	NOC         = iota
	ALT         = iota
	MSG         = iota
	MSG_REF_NOC = iota
	MSG_CHROM   = iota
	MSG_POS     = iota
	FIN         = iota
	SNP         = iota
	SUB         = iota
	INS         = iota
	DEL         = iota
	INDEL       = iota
	NOREF       = iota

	CHROM   = iota
	POS     = iota
	COMMENT = iota
)

Variables

View Source
var AltMap map[byte]byte

Key is the pasta character, value is the implied sequence character

View Source
var BPState map[byte]int
View Source
var DelMap map[byte]byte
View Source
var InsMap map[byte]byte
View Source
var IsAltDel map[byte]bool
View Source
var RefDelBP map[byte]int
View Source
var RefMap map[byte]byte

Key is pasta character, value is the lower case sequence value of the reference

View Source
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'] = '='

View Source
var Token []byte

All valid pasta tokens

Functions

func ControlMessagePrint

func ControlMessagePrint(msg *ControlMessage, out *bufio.Writer)

func InterleaveStreams

func InterleaveStreams(stream_A, stream_B io.Reader, w io.Writer) error

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

func InterleaveToDiffInterface(stream *bufio.Reader, p RefVarPrinter, w io.Writer) 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 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 PastaHandle struct {
	Fp      *os.File
	Scanner *bufio.Scanner

	Buf   []byte
	Stage []byte
}

type RefVarInfo

type RefVarInfo struct {
	Type        int
	MessageType int
	RefSeqFlag  bool
	NocSeqFlag  bool
	Out         io.Writer
	Msg         ControlMessage
	RefBP       byte

	Chrom string
}

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()
}

type RefVarProcesser

type RefVarProcesser func(int, int, int, []byte, [][]byte, interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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