Documentation ¶
Overview ¶
Sets of utilities to parse Fastq/a files
Index ¶
- func ExtractFna(file, prefix, taxid string, heads map[string]bool) error
- func GetAvgQuality(input *os.File, output *os.File, phred bool) error
- func GetFileType(inf *os.File) string
- func Opener(inf, outf string) (*os.File, *os.File, error)
- func ParseFastq(r *bufio.Scanner, phred64 bool) (float64, float64)
- type Association
- type Converter
- type Fasta
- type FastaIndex
- type Fastq
- type Fna
- func (f *Fna) AddFasta(seq *Fasta)
- func (f *Fna) AddHeaderPrefix(h, d string) (Converter, error)
- func (f *Fna) AddHeaderSuffix(h, d string) (Converter, error)
- func (f *Fna) FilterLength(min, max int)
- func (f *Fna) Index() (FastaIndex, error)
- func (f *Fna) ReplaceHeader(h string) (Converter, error)
- func (f Fna) Write(o string) error
- type Fsq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFna ¶
Could be merged / removed because it can be accomplished with combination of simpler function/methods combination Load, Index, NewFasta, AddSequence, Write
func GetAvgQuality ¶
GetAvgQuality takes an fastq file and attempts to calculate the average sequence quality and the sequence count. Utilises phred33 representation. usage : GetAvgQuality(<input>, <output>) Keyword arguments: input : File pointer (*os.File()), input data, either gunzipped or plain text. output : File pointer, output data containing the average quality and sequence count.
If output is nil, writes to Stdout
Return: None : Directly writes to file or Stdout
func GetFileType ¶
Types ¶
type Association ¶ added in v0.9.0
Type used to keep track of old and new header names. For use with Replace, AddHeaderPrefix and AddHeaderSuffix
type Converter ¶ added in v0.9.0
type Converter []*Association
func NewConverter ¶ added in v0.9.0
Convenience method to create a new converter and allocate enough space for `nb` Associations
func (*Converter) AddAssociation ¶ added in v0.9.0
Adds an `Association` to the converter, replacing any existing one at position `idx` Return an error if `idx >= len(c)`
type Fasta ¶
type FastaIndex ¶ added in v0.7.0
type Fna ¶
type Fna []*Fasta
func (*Fna) AddHeaderPrefix ¶ added in v0.9.0
Adds prefix `h` to the sequences' header seperating both by delimiter `d` Return the associated Converter and an error.
func (*Fna) AddHeaderSuffix ¶ added in v0.9.0
Adds prefix `h` to the sequences' header seperating both by delimiter `d` Return the associated Converter and an error.
func (*Fna) FilterLength ¶
Simple Utility to filter the lengths of fasta sequences. Iterates over a slice of Sequences (Fna) and filters out the sequences whose lengths are lower or greater than the specified mininimum and maximum. If maximum <= 0, max is set to the length of the sequence. Returns filtered Fna
func (*Fna) Index ¶ added in v0.7.0
func (f *Fna) Index() (FastaIndex, error)
Index the loaded fasta file using fasta headers Assumes that all headers are unique, raises an error if not
func (*Fna) ReplaceHeader ¶ added in v0.9.0
Replaces all existing headers by `h` follow by a sequential number Return the associated Converter and an error.