Bio::T...::IUPAC(3pm)
π¦ 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β meaningA, nucleic acid: AdenineCβ meaningC, nucleic acid: CytosineGβ meaningG, nucleic acid: GuanineTβ meaningT, nucleic acid: ThymineUβ meaningU, nucleic acid: UracilMβAorC, nucleic acid: aMinoRβAorG, nucleic acid: puRineWβAorT, nucleic acid: WeakSβCorG, nucleic acid: StrongYβCorT, nucleic acid: pYrimidineKβGorT, nucleic acid: KetoVβAorCorG, nucleic acid: not T (closest unused char after T)HβAorCorT, nucleic acid: not G (closest unused char after G)DβAorGorT, nucleic acid: not C (closest unused char after C)BβCorGorT, nucleic acid: not A (closest unused char after A)XβGorAorTorC, nucleic acid: Unknown (very rarely used)NβGorAorTorC, 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β AlanineBβ Aspartic Acid, AsparagineCβ CysteineDβ Aspartic AcidEβ Glutamic AcidFβ PhenylalanineGβ GlycineHβ HistidineIβ IsoleucineJβ Isoleucine/LeucineKβ LysineLβ LeucineMβ MethionineNβ AsparagineOβ PyrrolysinePβ ProlineQβ GlutamineRβ ArginineSβ SerineTβ ThreonineUβ SelenocysteineVβ ValineWβ TryptophanXβ UnknownYβ TyrosineZβ 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::Seqobjects 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::IUPACobject.
π next_seq
- Title:
next_seq - Usage:
$iupac->next_seq(); - Function: returns the next unique sequence object
- Args: none.
- Returns: a
Bio::Seqobject
𧬠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()ifBio::Tools::IUPACwas given a proteic sequence, oriupac_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_iubhash). - 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::SeqPatternmodule. 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:
TandUcharacters 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
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms