fasta

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyse

func Analyse(f Fasta, enzyme digest.Enzyme)

Analyse obtains some common properties for proteins in a FASTA file

  • length/mass distribution distribution
  • number of proteins in certain class, e.g.: with motif for export from cell, import golgi, zinc finger, multiple motifs in one prot zinc-binding motif HEXXHXXGXXH N-terminal secretory signal peptide and a prodomain with a conserved PRCGXPD motif isoforms phosphorilation/glycosylation patterns
  • statistically significant sequence features, e.g. missing subsequence/regex, abundant subsequence/regex
  • digest (selectable, default tryptic) for each peptides, print distribution of number of occurrences (unique) print prots with no unique peptides (merging I and L) print prots with no peptides that can be measured or uniquely identified, e.g. because of mass range, ionizability

func FuzzyNameFile

func FuzzyNameFile(name string, dir string) (string, error)

FuzzyNameFile checks a FASTA file exists name can be a real filename (full path) or a fuzzy name (Latin species name, taxonomy id or common name) dir is the directory to use in case on a fuzzy name

func ProteotypicPeps

func ProteotypicPeps(fastas []Fasta, enzyme digest.Enzyme) []proteoTypic

ProteotypicPeps computes proteotypic peptides Proteotypic peptides are peptides that are unique for a specific protein Unique should be interpreted in a Mass Spectrometric way:

equal mass amino acids are treated as the same.

func UniprotURL

func UniprotURL(name string) (string, error)

UniprotURL converts a string with a taxonomy or common (species) name into a URL where the FASTA file can be downloaded

func UpdateFASTA

func UpdateFASTA(name string, dir string) error

UpdateFASTA downloads a FASTA file from internet if the remove version is newer than the local version. name is the name of the species, taxonomy ID or one of the build in common names dir is the download directory

func WriteProteotypicPeps

func WriteProteotypicPeps(fp *os.File, pts []proteoTypic)

WriteProteotypicPeps outputs proteotypic peptide info in a human readable format First, proteins with proteotypic peptides are written. For each protein all proteotypic peptides are listed. Proteotypic peptides that occur multiple times in the same protein should be marked with the multiplicity between brackets e.g. (3) Next, proteins without proteotypic peptides are written.

Types

type Fasta

type Fasta struct {
	// contains filtered or unexported fields
}

Fasta wraps the contents of the FASTA file

func Read

func Read(reader io.Reader) (Fasta, error)

Read reads an FASTA file from an io.Reader

func ReadFiltered

func ReadFiltered(reader io.Reader, filter Filter) (Fasta, error)

ReadFiltered reads an FASTA file from an io.Reader, only storing the entries where the filter function returns 'true'

func (*Fasta) Prots

func (f *Fasta) Prots() []Prot

Prots returns a slice with all proteins in a fasta file

func (*Fasta) Write

func (f *Fasta) Write(writer io.Writer) error

Write writes a new FASTA file to an io.writer

type Filter

type Filter func(Prot) bool

Filter should return true if sequence must be stored

type Prot

type Prot struct {
	// contains filtered or unexported fields
}

Prot single entry (identifier, description and sequence)

func (*Prot) Description

func (p *Prot) Description() string

Description returns the protein description

func (*Prot) ID

func (p *Prot) ID() string

ID returns the protein ID

func (*Prot) Sequence

func (p *Prot) Sequence() string

Sequence returns the protein sequence

Jump to

Keyboard shortcuts

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