pileup

package
v0.0.0-...-d966d87 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2020 Grail Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// BaseA represents an A base.
	BaseA byte = iota
	// BaseC represents an C base.
	BaseC
	// BaseG represents an G base.
	BaseG
	// BaseT represents an T base.
	BaseT
	// BaseX is a catch-all.
	BaseX
)
View Source
const (
	// NBase is the number of regular base types.
	NBase = 4
	// NBaseEnum counts BaseX as well as the regular base types.
	NBaseEnum = 5
)
View Source
const PosTypeMax = interval.PosTypeMax

PosTypeMax is the maximum value that can be represented by a PosType.

Variables

View Source
var EnumToASCIITable = [...]byte{'A', 'C', 'G', 'T', 'N'}

EnumToASCIITable is the A/C/G/T/X -> ASCII mapping, with X rendered as 'N'.

View Source
var Seq8ToASCIITable = [...]byte{'=', 'A', 'C', 'M', 'G', 'R', 'S', 'V', 'T', 'W', 'Y', 'H', 'K', 'D', 'B', 'N'}

Seq8ToASCIITable is the .bam seq nibble -> ASCII mapping.

Seq8ToEnumTable is the .bam seq nibble -> A/C/G/T/X enum mapping.

View Source
var StrandTypeToASCIITable = [...]byte{'.', '+', '-'}

StrandTypeToASCIITable is the StrandType -> ASCII mapping.

Functions

func FaToStringSlice

func FaToStringSlice(fa fasta.Fasta, headerRefs []*sam.Reference) ([]string, error)

FaToStringSlice returns the data in fa as a []string, using the reference order in headerRefs[]. It performs reference-length consistency checks between headerRefs and fa in the process.

func LoadFa

func LoadFa(ctx context.Context, fapath string, enc fasta.Encoding) (fa fasta.Fasta, err error)

LoadFa is a thin wrapper around fasta.New().

func ParseCols

func ParseCols(colsParam string, colNameMap map[string]int, defaultColBitset int) (colBitset int, err error)

ParseCols parses a column-set-descriptor string given on the command line (colsParam) into a 64-bit integer bitset for internal use.

Types

type PosType

type PosType = interval.PosType

PosType is the integer type used to represent genomic positions.

type StrandType

type StrandType int

StrandType describes which strand a read-pair is aligned to.

const (
	// StrandNone means either no strand restriction, or (when returned by
	// GetStrand) undefined-strand (read ends on different chromosomes, or appear
	// to be part of an inversion).
	StrandNone StrandType = iota
	// StrandFwd means that the read-pair's start is on the 5' side and the end
	// is on the 3' side of the same chromosome.
	StrandFwd
	// StrandRev means that the read-pair's start is on the 3' side and the end
	// is on the 5' side of the same chromosome.
	StrandRev
)

func GetStrand

func GetStrand(samr *sam.Record) StrandType

GetStrand returns the strand the read-pair is aligned to.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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