| Bsoft 2.0.5 Bernard's software package

Functions
seq_util.h File Reference

Header file for sequence utilities. More...

`#include "Bstring.h"`
`#include "rwmolecule.h"`

Go to the source code of this file.

## Functions
int | seq_show (Bmolgroup *molgroup)
| Shows all molecular sequences. More...
int | seq_mass (Bmolgroup *molgroup)
| Shows the masses of all molecular sequences. More...
vector< double > | seq_elements (Bmolgroup *molgroup, Bstring &paramfile)
| Shows the elemental composition of all molecular sequences. More...
int | seq_complement_all (Bmolgroup *molgroup)
| Complements all nucleotide sequences. More...
int | seq_translate_all (Bmolgroup *molgroup, int frame, Bstring &gcname)
| Translates all nucleotide sequences to protein sequences. More...
long | seq_find_dna (Bmolgroup *molgroup, Bstring &seq)
| Finds a nucleotide sequence. More...
long | seq_find_protein (Bmolgroup *molgroup, Bstring &seq)
| Finds an amino acid sequence. More...
Bstring | seq_find_protein_in_dna (Bmolgroup *molgroup, Bstring &seq, int seqlenmin, int seqlenmax, int side1, int side2, double threshold, Bstring &gcfile)
| Finds the coding region for an amino acid sequence. More...
int | getcode3 (char c, char *cod)
| Converts a one-letter amino acid designation to the three-letter equivalent. More...
char | getcode1 (char *acode)
| Converts a three-letter amino acid designation to the one-letter equivalent. More...
int | complement_sequence (Bstring &nucseq)
| Complements a nucleotide sequence in place. More...
char | get_complement (char nuc)
| Get the Watson-Crick complement of a nucleotide base. More...
Bstring | sequence_translate (Bstring &nucseq, long frame, Bstring &gencode)
| Translates a nucleotide sequence to a protein sequence. More...

## Detailed Description

Header file for sequence utilities.

Author
  Bernard Heymann

Date
  Created: 20001029
  Modified: 20190603

Definition in file seq_util.h.

## Function Documentation

## ◆ complement_sequence()

int complement_sequence | ( | Bstring & | nucseq | ) |

Complements a nucleotide sequence in place.

Parameters

  &nucseq | nucleotide sequence to be translated.

Returns
  int 0.

Definition at line 550 of file seq_util.cpp.

## ◆ get_complement()

char get_complement | ( | char | nuc | ) |

Get the Watson-Crick complement of a nucleotide base.

Parameters

  nuc | nucleotide.

Returns
  char complementing nucleotide.

Definition at line 570 of file seq_util.cpp.

## ◆ getcode1()

char getcode1 | ( | char * | acode | ) |

Converts a three-letter amino acid designation to the one-letter equivalent.

Parameters

  *acode | the desired amino acid three-letter code

Returns
  char the corresponding one-letter code

      Search through a list of 3-1 mappings for the desired three-letter code.

Definition at line 531 of file seq_util.cpp.

## ◆ getcode3()

int getcode3 | ( | char | c,
|  | char * | cod
| ) |  |

Converts a one-letter amino acid designation to the three-letter equivalent.

Parameters

  c | the desired amino acid code letter
  *cod | the corresponding three-letter code

Returns
  int 0.

      Search through a list of 1-3 mappings for the desired letter.

Definition at line 510 of file seq_util.cpp.

## ◆ seq_complement_all()

int seq_complement_all | ( | Bmolgroup * | molgroup | ) |

Complements all nucleotide sequences.

Parameters

  *molgroup | the molecule group.

Returns
  int 0.

      Search through a list of 1-3 mappings for the desired letter.

Definition at line 265 of file seq_util.cpp.

## ◆ seq_elements()

vector<double> seq_elements | ( | Bmolgroup * | molgroup,
|  | Bstring & | paramfile
| ) |  |

Shows the elemental composition of all molecular sequences.

Parameters

  *molgroup | set of sequences.
  &paramfile | file of residue parameters.

Returns
  vector<double> array of element numbers: HCNOS

Definition at line 176 of file seq_util.cpp.

## ◆ seq_find_dna()

long seq_find_dna | ( | Bmolgroup * | molgroup,
|  | Bstring & | seq
| ) |  |

Finds a nucleotide sequence.

Parameters

  *molgroup | the molecule group.
  &seq | sequence to find.

Returns
  long position.

Definition at line 314 of file seq_util.cpp.

## ◆ seq_find_protein()

long seq_find_protein | ( | Bmolgroup * | molgroup,
|  | Bstring & | seq
| ) |  |

Finds an amino acid sequence.

Parameters

  *molgroup | the molecule group.
  &seq | sequence to find.

Returns
  long position.

Definition at line 356 of file seq_util.cpp.

## ◆ seq_find_protein_in_dna()

Bstring seq_find_protein_in_dna | ( | Bmolgroup * | molgroup,
|  | Bstring & | seq,
|  | int | seqlenmin,
|  | int | seqlenmax,
|  | int | side1,
|  | int | side2,
|  | double | threshold,
|  | Bstring & | gcfile
| ) |  |

Finds the coding region for an amino acid sequence.

Parameters

  *molgroup | the molecule group.
  &seq | sequence to find.
  seqlenmin | sequence length minimum.
  seqlenmax | sequence length maximum.
  side1 | preceding sequence length to include.
  side2 | succeeding sequence length to include.
  threshold | threshold for reporting possible hits.
  &gcfile | file with genetic code.

Returns
  Bstring coding sequence.

      All molecules in the group are searched in all 6 possible frames.

Definition at line 394 of file seq_util.cpp.

## ◆ seq_mass()

int seq_mass | ( | Bmolgroup * | molgroup | ) |

Shows the masses of all molecular sequences.

Parameters

  *molgroup | set of sequences.

Returns
  int 0

Definition at line 131 of file seq_util.cpp.

## ◆ seq_show()

int seq_show | ( | Bmolgroup * | molgroup | ) |

Shows all molecular sequences.

Parameters

  *molgroup | set of sequences.

Returns
  int 0

Definition at line 81 of file seq_util.cpp.

## ◆ seq_translate_all()

int seq_translate_all | ( | Bmolgroup * | molgroup,
|  | int | frame,
|  | Bstring & | gcfile
| ) |  |

Translates all nucleotide sequences to protein sequences.

Parameters

  *molgroup | the molecule group.
  frame | the frame for translation.
  &gcfile | file with genetic code.

Returns
  int 0.

      Each nucleic acid sequence in the molecule group is translated to the
      protein sequence.

Definition at line 289 of file seq_util.cpp.

## ◆ sequence_translate()

Bstring sequence_translate | ( | Bstring & | nucseq,
|  | long | frame,
|  | Bstring & | gencode
| ) |  |

Translates a nucleotide sequence to a protein sequence.

Parameters

  &nucseq | nucleotide sequence to be translated.
  frame | coding frame.
  &gencode | genetic code: array of amino acids.

Returns
  Bstring translated protein sequence.

Definition at line 593 of file seq_util.cpp.