3 # BioPerl module for Bio::Tools::RepeatMasker
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Shawn Hoon <shawnh@fugu-sg.org>
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::Tools::RepeatMasker - a parser for RepeatMasker output
21 use Bio::Tools::RepeatMasker;
22 my $parser = Bio::Tools::RepeatMasker->new(-file => 'seq.fa.out');
23 while( my $result = $parser->next_result ) {
29 A parser for RepeatMasker output
35 User feedback is an integral part of the evolution of this and other
36 Bioperl modules. Send your comments and suggestions preferably to
37 the Bioperl mailing list. Your participation is much appreciated.
39 bioperl-l@bioperl.org - General discussion
40 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
44 Please direct usage questions or support issues to the mailing list:
46 I<bioperl-l@bioperl.org>
48 rather than to the module maintainer directly. Many experienced and
49 reponsive experts will be able look at the problem and quickly
50 address it. Please include a thorough description of the problem
51 with code and data examples if at all possible.
55 Report bugs to the Bioperl bug tracking system to help us keep track
56 of the bugs and their resolution. Bug reports can be submitted via
59 http://bugzilla.open-bio.org/
61 =head1 AUTHOR - Shawn Hoon
63 Email shawnh@fugu-sg.org
67 The rest of the documentation details each of the object methods.
68 Internal methods are usually preceded with a _
73 # Let the code begin...
76 package Bio
::Tools
::RepeatMasker
;
79 use Bio
::SeqFeature
::FeaturePair
;
81 use base
qw(Bio::Root::Root Bio::Root::IO);
86 Usage : my $obj = Bio::Tools::RepeatMasker->new();
87 Function: Builds a new Bio::Tools::RepeatMasker object
88 Returns : Bio::Tools::RepeatMasker
89 Args : -fh/-file => $val, for initing input, see Bio::Root::IO
94 my($class,@args) = @_;
96 my $self = $class->SUPER::new
(@args);
97 $self->_initialize_io(@args);
105 Usage : my $r = $rpt_masker->next_result
106 Function: Get the next result set from parser data
107 Returns : Bio::SeqFeature::FeaturePair
108 Feature1 is the Query coordinates and Feature2 is the Hit
115 while (defined($_=$self->_readline()) ) {
116 if (/no repetitive sequences detected/) {
117 $self->warn( "RepeatMasker didn't find any repetitive sequences\n");
120 #ignore introductory lines
123 # ignore features with negatives
124 next if ($element[11-13] =~ /-/);
127 my ($score, $query_name, $query_start, $query_end, $strand,
128 $repeat_name, $repeat_class ) = @line[0, 4, 5, 6, 8, 9, 10];
130 my ($hit_start,$hit_end);
132 if ($strand eq '+') {
133 ($hit_start, $hit_end) = @line[11, 12];
135 } elsif ($strand eq 'C') {
136 ($hit_start, $hit_end) = @line[12, 13];
139 my $rf = Bio
::SeqFeature
::Generic
->new
140 (-seq_id
=> $query_name,
142 -start
=> $query_start,
145 -source_tag
=> 'RepeatMasker',
146 -primary_tag
=> $repeat_class,
147 -tag
=> { 'Target'=> [$repeat_name,$hit_start,$hit_end]},
150 my $rf2 = Bio
::SeqFeature
::Generic
->new
151 (-seq_id
=> $repeat_name,
153 -start
=> $hit_start,
156 -source_tag
=> "RepeatMasker",
157 -primary_tag
=> $repeat_class,
158 -tag
=> { 'Target'=> [$query_name,$query_start,$query_end] },
161 my $fp = Bio
::SeqFeature
::FeaturePair
->new(-feature1
=> $rf,