Parses raw RNAMotif output. RNAMotif uses a RNA profile, consisting
of sequence and structural elements stored in a descriptor file, to
search for potential motifs in a DNA sequence file. For more
information, see:
Macke TJ, Ecker DJ, Gutell RR, Gautheret D, Case DA, Sampath R.
RNAMotif, an RNA secondary structure definition and search algorithm.
Nucleic Acids Res. 2001 Nov 15;29(22):4724-35.
http://www.scripps.edu/mb/case/casegr-sh-3.5.html.
This module is not currently complete. As is, it will parse raw
RNAMotif output (i.e. information not passed through the secondary
programs rmfmt or rm2ct) and pack information into
Bio::SeqFeature::Generic objects. Currently, parsing extra output
utilized by the sprintf() function in an RNAMotif descriptor is not
implemented; this information is instead packed into the score tag,
which can be accessed by using the following:
my ($score) = $feature->score;
If the score contains anything besides a digit, it will throw a
warning that sprintf() may have been used.
Several values have also been added in the 'tag' hash. These can be
accessed using the following syntax:
my ($entry) = $feature->get_Annotations('secstructure');
Added tags are :
descline - entire description line (in case the regex used for
sequence ID doesn't adequately catch the name
descfile - name of the descriptor file (may include path to file)
secstrucure - contains structural information from the descriptor
used as a query
sequence - sequence of motif, separated by spaces according to
matches to the structure in the descriptor (in
SecStructure).
See t/RNAMotif.t for example usage.
The clean_features method can also be used to return a list of seqfeatures (in a
Bio::SeqFeature::Collection object) that are within a particular region. RNAMotif
is prone with some descriptors to returning redundant hits; an attempt to rectify
this problem is attempted with RNAMotif's companion program rmprune, which returns
the structure with the longest helices (and theoretically the best scoring structure).
However, this doesn't take into account alternative foldings which may score better.
This method adds a bit more flexibility, giving the user the ability to screen folds
based on where the feature is found and the score. Passing a positive integer x
screens SeqFeatures based on the highest score within x bp, while a negative integer
screens based on the lowest score. So, to return the highest scoring values within
20 bp (likely using an arbitrary scroing system in the SCORE section of a descriptor
file), one could use:
$list = $obj->clean_features(20);
... and returning the lowest scoring structures within the same region (when the
score is based on calculated free energies from efn2) can be accomplished
by the following:
$list = $obj->clean_features(-20);
If you wanted the best feature in a sequence, you could set this to a large number,
preferrably on that exceeds the bases in a sequence
$list = $obj->clean_features(10000000);
Each seqfeature in the collection can then be acted upon:
@sf = $list->get_all_features;
for my $f (@sf) {
# do crazy things here
}
At some point a more complicated feature object may be used to support
this data rather than forcing most of the information into tag/value
pairs in a SeqFeature::Generic. This will hopefully allow for more
flexible analysis of data (specifically RNA secondary structural
data). It works for now...
sub next_prediction
{ my ($self) = @_;
my ($motiftag,$srctag,$desctag) = ( $self->motif_tag,
$self->source_tag,
$self->desc_tag);
my ($score, $strand, $start, $length, $sequence, $end, $seqid, $description)=0;
while($_ = $self->_readline) {
while($_ =~ /^#RM/) { if(/^#RM\sdescr\s(.*)$/) { $self->{'_sec_structure'}=$1;
}
if(/^#RM\sdfile\s(.*)$/) { $self->{'_dfile'}=$1;
}
$_ = $self->_readline;
}
if(m/^>((\S*)\s.*)$/) { $seqid = $2; $description = $1; if($seqid =~ /(gb|emb|dbj|sp|pdb|bbs|ref|lcl)\|(.*)\|/) {
$seqid = $2; }
}
if(m/^\S+\s+(.+)\s+(\d+)\s+(\d+)\s+(\d+)\s(.*)$/) { ($score, $strand, $start, $length, $sequence, $end)= ($1, $2, $3, $4, $5, 0); if( $strand==0 ) {
$end = $start + $length -1;
$strand = 1;
} else {
$end = $start - $length + 1;
($start, $end, $strand) = ($end, $start, -1);
}
my $gene = Bio::SeqFeature::Generic->new(-seq_id => $seqid,
-start => $start,
-end => $end,
-strand => $strand,
-score => $score,
-primary_tag => $motiftag,
-source_tag => $srctag,
-display_name => $desctag,
-tag => {
'descline' => $description,
'descfile' => $self->{'_dfile'},
'secstructure' => $self->{'_sec_structure'},
'sequence' => $sequence});
return $gene;
}
}} |
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _