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
- Variables
- func FaToStringSlice(fa fasta.Fasta, headerRefs []*sam.Reference) ([]string, error)
- func LoadFa(ctx context.Context, fapath string, enc fasta.Encoding) (fa fasta.Fasta, err error)
- func ParseCols(colsParam string, colNameMap map[string]int, defaultColBitset int) (colBitset int, err error)
- type PosType
- type StrandType
Constants ¶
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 )
const ( // NBase is the number of regular base types. NBase = 4 // NBaseEnum counts BaseX as well as the regular base types. NBaseEnum = 5 )
const PosTypeMax = interval.PosTypeMax
PosTypeMax is the maximum value that can be represented by a PosType.
Variables ¶
var EnumToASCIITable = [...]byte{'A', 'C', 'G', 'T', 'N'}
EnumToASCIITable is the A/C/G/T/X -> ASCII mapping, with X rendered as 'N'.
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.
var Seq8ToEnumTable = [...]byte{BaseX, BaseA, BaseC, BaseX, BaseG, BaseX, BaseX, BaseX, BaseT, BaseX, BaseX, BaseX, BaseX, BaseX, BaseX, BaseX}
Seq8ToEnumTable is the .bam seq nibble -> A/C/G/T/X enum mapping.
var StrandTypeToASCIITable = [...]byte{'.', '+', '-'}
StrandTypeToASCIITable is the StrandType -> ASCII mapping.
Functions ¶
func FaToStringSlice ¶
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.
Types ¶
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.