Bio::T...::IUPAC(3pm)

πŸ“¦
version 1.7.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ¦‹ NAME πŸ¦‹

Bio::Tools::IUPAC β€” bestie, this module generates unique sequence objects or regular expressions from an ambiguous IUPAC sequence. That's the entire job description and it does it flawlessly, no cap. πŸ’…

(This page is part of the User Contributed Perl Documentation, filed in the manual under Bio::T...::IUPAC(3pm).)


✨ SYNOPSIS ✨

okay so here's the whole vibe in one go:

use Bio::PrimarySeq;
use Bio::Tools::IUPAC;

# Get the IUPAC code for proteins
my %iupac_prot = Bio::Tools::IUPAC->new->iupac_iup;

# Create a sequence with degenerate residues
my $ambiseq = Bio::PrimarySeq->new(-seq => 'ARTCGUTGN', -alphabet => 'dna');

# Create all possible non-degenerate sequences
my $iupac = Bio::Tools::IUPAC->new(-seq => $ambiseq);
while ($uniqueseq = $iupac->next_seq()) {
    # process the unique Bio::Seq object.
}

# Get a regular expression that matches all possible sequences
my $regexp = $iupac->regexp();

Obsessed. You hand it a messy ambiguous sequence, it hands you back every single unambiguous possibility as a stream, or one glorious regex. Pick your fighter. 🌸


πŸ’– DESCRIPTION πŸ’–

Bio::Tools::IUPAC is a tool that manipulates sequences with ambiguous residues following the IUPAC conventions. Non-standard characters have the meanings described below β€” memorize them, they WILL come up. 🧬

IUPAC-IUB SYMBOLS FOR NUCLEOTIDE (DNA OR RNA) NOMENCLATURE: Cornish-Bowden (1985) Nucl. Acids Res. 13: 3021-3030

πŸ”€ Nucleotide symbols

  • A β€” meaning A, nucleic acid: Adenine
  • C β€” meaning C, nucleic acid: Cytosine
  • G β€” meaning G, nucleic acid: Guanine
  • T β€” meaning T, nucleic acid: Thymine
  • U β€” meaning U, nucleic acid: Uracil
  • M β€” A or C, nucleic acid: aMino
  • R β€” A or G, nucleic acid: puRine
  • W β€” A or T, nucleic acid: Weak
  • S β€” C or G, nucleic acid: Strong
  • Y β€” C or T, nucleic acid: pYrimidine
  • K β€” G or T, nucleic acid: Keto
  • V β€” A or C or G, nucleic acid: not T (closest unused char after T)
  • H β€” A or C or T, nucleic acid: not G (closest unused char after G)
  • D β€” A or G or T, nucleic acid: not C (closest unused char after C)
  • B β€” C or G or T, nucleic acid: not A (closest unused char after A)
  • X β€” G or A or T or C, nucleic acid: Unknown (very rarely used)
  • N β€” G or A or T or C, nucleic acid: Unknown (commonly used)

IUPAC-IUP AMINO ACID SYMBOLS: Biochem J. 1984 Apr 15; 219(2): 345-373 Eur J Biochem. 1993 Apr 1; 213(1): 2

πŸ§ͺ Amino acid symbols

  • A β€” Alanine
  • B β€” Aspartic Acid, Asparagine
  • C β€” Cysteine
  • D β€” Aspartic Acid
  • E β€” Glutamic Acid
  • F β€” Phenylalanine
  • G β€” Glycine
  • H β€” Histidine
  • I β€” Isoleucine
  • J β€” Isoleucine/Leucine
  • K β€” Lysine
  • L β€” Leucine
  • M β€” Methionine
  • N β€” Asparagine
  • O β€” Pyrrolysine
  • P β€” Proline
  • Q β€” Glutamine
  • R β€” Arginine
  • S β€” Serine
  • T β€” Threonine
  • U β€” Selenocysteine
  • V β€” Valine
  • W β€” Tryptophan
  • X β€” Unknown
  • Y β€” Tyrosine
  • Z β€” Glutamic Acid, Glutamine
  • * β€” Terminator

There are a few things Bio::Tools::IUPAC can do for you, and honestly? All of them are a serve:

  • report the IUPAC mapping between ambiguous and non-ambiguous residues
  • produce a stream of all possible corresponding unambiguous Bio::Seq objects given an ambiguous sequence object
  • convert an ambiguous sequence object to a corresponding regular expression

πŸ“£ FEEDBACK πŸ“£

πŸ’Œ Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated β€” fr fr, they mean it. 🫢

bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

πŸ†˜ Support

Please direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

rather than to the module maintainer directly. Why? Because many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. πŸ™

πŸ› Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues

πŸ‘‘ AUTHOR - Aaron Mackey πŸ‘‘

Email amackey-at-virginia.edu


πŸ“š APPENDIX πŸ“š

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ (iykyk, that underscore is the "do not touch" signal).

🌱 new

  • Title: new
  • Usage: Bio::Tools::IUPAC->new($seq);
  • Function: Create a new IUPAC object, which acts as a sequence stream (akin to SeqIO)
  • Args: an ambiguously coded sequence object that has a specified 'alphabet'
  • Returns: a Bio::Tools::IUPAC object.

🌊 next_seq

  • Title: next_seq
  • Usage: $iupac->next_seq();
  • Function: returns the next unique sequence object
  • Args: none.
  • Returns: a Bio::Seq object

🧬 iupac

  • Title: iupac
  • Usage: my %symbols = $iupac->iupac;
  • Function: Returns a hash of symbols -> symbol components of the right type for the given sequence, i.e. it is the same as iupac_iup() if Bio::Tools::IUPAC was given a proteic sequence, or iupac_iub() if the sequence was nucleic. For example, the key 'M' has the value ['A', 'C'].
  • Args: none
  • Returns: Hash

πŸŽ€ iupac_amb

  • Title: iupac_amb
  • Usage: my %symbols = $iupac->iupac_amb;
  • Function: Same as iupac() but only contains a mapping between ambiguous residues and the ambiguous residues they map to. For example, the key 'N' has the value ['R', 'Y', 'K', 'M', 'S', 'W', 'B', 'D', 'H', 'V', 'N'], i.e. it matches all other ambiguous residues.
  • Args: none
  • Returns: Hash

πŸ’ͺ iupac_iup

  • Title: iupac_iup
  • Usage: my %aasymbols = $iupac->iupac_iup;
  • Function: Returns a hash of PROTEIN symbols -> non-ambiguous symbol components
  • Args: none
  • Returns: Hash

πŸ¦‹ iupac_iup_amb

  • Title: iupac_iup_amb
  • Usage: my %aasymbols = $iupac->iupac_iup_amb;
  • Function: Returns a hash of PROTEIN symbols -> ambiguous symbol components
  • Args: none
  • Returns: Hash

🌈 iupac_iub

  • Title: iupac_iub
  • Usage: my %dnasymbols = $iupac->iupac_iub;
  • Function: Returns a hash of DNA symbols -> non-ambiguous symbol components
  • Args: none
  • Returns: Hash

✨ iupac_iub_amb

  • Title: iupac_iub_amb
  • Usage: my %dnasymbols = $iupac->iupac_iub;
  • Function: Returns a hash of DNA symbols -> ambiguous symbol components
  • Args: none
  • Returns: Hash

πŸ” iupac_rev_iub

  • Title: iupac_rev_iub
  • Usage: my %dnasymbols = $iupac->iupac_rev_iub;
  • Function: Returns a hash of nucleotide combinations -> IUPAC code (a reverse of the iupac_iub hash).
  • Args: none
  • Returns: Hash

πŸ”’ count

  • Title: count
  • Usage: my $total = $iupac->count();
  • Function: Calculates the number of unique, unambiguous sequences that this ambiguous sequence could generate
  • Args: none
  • Return: int

πŸͺ„ regexp

  • Title: regexp
  • Usage: my $re = $iupac->regexp();
  • Function: Converts the ambiguous sequence into a regular expression that matches all of the corresponding ambiguous and non-ambiguous sequences. You can further manipulate the resulting regular expression with the Bio::Tools::SeqPattern module. After you are done building your regular expression, you might want to compile it and make it case-insensitive: $re = qr/$re/i;
  • Args: 1 to match RNA: T and U characters will match interchangeably
  • Return: regular expression

That's the whole page bestie, go generate some sequences. 🫢

Sign-off: this page is perl v5.32.1, dated 2021-08-15, from Bio::T...::IUPAC(3pm) β€” the manual, the myth, the legend. Mwah. πŸ’‹

πŸ“¦ where this page comes from