Bio::Util::DNA - Basic DNA utilities
use Bio::Util::DNA qw(:all); my $clean_ref = cleanDNA($seq_ref); my $seq_ref = randomDNA(100); my $rev_ref = reverse_complement($seq_ref);
Provides a set of functions and predefined variables which are handy when working with DNA.
Basic nucleotide variables that could be useful. All of the variables have a prefix and a suffix;
String of the different nucleotides
Array of the different nucleotides
Precompiled regular expression which matches nucleotide characters
Precompiled regular expression which matches non-nucleotide characters
Hash of degenerate nucleotide definitions. Each entry contains a reference to an array of DNA nucleotides that each degenerate nucleotide stands for.
Reverse of %degenerate2nucleotides. Keys are alphabetically-sorted DNA nucleotides and values are the degenerate nucleotide that can represent those nucleotides.
Contains the heirarchy of degenerate nucleotides; N of course contains all the other degenerates, and the four degenerates that can stand for three different bases contain three of the two-base degenerates.
my $clean_ref = cleanDNA($seq_ref);
Cleans the sequence for use. Strips out comments (lines starting with '>') and whitespace, converts uracil to thymine, and capitalizes all characters.
my $clean_ref = cleanDNA($seq_ref); my $seq_ref = cleanDNA(\'actg'); my $seq_ref = cleanDNA(\'act tag cta'); my $seq_ref = cleanDNA(\'>some mRNA acugauauagau uauagacgaucc');
my $seq_ref = randomDNA($length);
Generate random DNA for testing this module or your own scripts. Default length is 100 nucleotides.
my $seq_ref = randomDNA(); my $seq_ref = randomDNA(600);
my $reverse_ref = reverse_complement($seq_ref);
Finds the reverse complement of the sequence and handles degenerate nucleotides.
$reverse_ref = reverse_complement(\'act');
my $seq_arrayref = unrollDNA( $seq_ref );
Unroll a DNA string containing degenerate nucleotides. The first entry of the arrayref will be the actual sequence.
my $seq_arrayref = unrollDNA( \'ACSTAD' ) = [ 'ACSTAD', 'ACCTAD', 'ACGTAD', 'ACSTAR', 'ACCTAR', 'ACGTAR', 'ACSTAW', 'ACCTAW', 'ACGTAW', 'ACSTAK', 'ACCTAK', 'ACGTAK', 'ACSTAA', 'ACCTAA', 'ACGTAA', 'ACSTAG', 'ACCTAG', 'ACGTAG', 'ACSTAT', 'ACCTAT', 'ACGTAT' ];
Kevin Galinsky, <first initial last name plus cpan at gmail dot com>
Copyright (c) 2010-2011, Broad Institute.
Copyright (c) 2008-2009, J. Craig Venter Institute.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.