sequtils

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Sets of utilities to parse Fastq/a files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFna

func ExtractFna(file, prefix, taxid string, heads map[string]bool) error

func GetAvgQuality

func GetAvgQuality(input *os.File, output *os.File, phred bool) error

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

func GetFileType(inf *os.File) string

func Opener

func Opener(inf, outf string) (*os.File, *os.File, error)

func ParseFastq

func ParseFastq(r *bufio.Scanner, phred64 bool) (float64, float64)

Types

type Fasta

type Fasta struct {
	Header   string
	Sequence string
}

type Fastq

type Fastq struct {
	Fasta
	Sep     string
	Quality string
}

type Fna

type Fna []*Fasta

func LoadFasta

func LoadFasta(file string) (Fna, error)

func (*Fna) FilterLength

func (f *Fna) FilterLength(min, max int)

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) Write

func (f Fna) Write(o string) error

type Fsq

type Fsq []*Fastq

Jump to

Keyboard shortcuts

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