2 # BioPerl module for Bio::Tools::RepeatMasker
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Shawn Hoon <shawnh@fugu-sg.org>
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Tools::RepeatMasker - a parser for RepeatMasker output
20 use Bio::Tools::RepeatMasker;
21 my $parser = Bio::Tools::RepeatMasker->new(-file => 'seq.fa.out');
22 while( my $result = $parser->next_result ) {
28 A parser for RepeatMasker output
34 User feedback is an integral part of the evolution of this and other
35 Bioperl modules. Send your comments and suggestions preferably to
36 the Bioperl mailing list. Your participation is much appreciated.
38 bioperl-l@bioperl.org - General discussion
39 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
43 Please direct usage questions or support issues to the mailing list:
45 I<bioperl-l@bioperl.org>
47 rather than to the module maintainer directly. Many experienced and
48 reponsive experts will be able look at the problem and quickly
49 address it. Please include a thorough description of the problem
50 with code and data examples if at all possible.
54 Report bugs to the Bioperl bug tracking system to help us keep track
55 of the bugs and their resolution. Bug reports can be submitted via
58 https://github.com/bioperl/bioperl-live/issues
60 =head1 AUTHOR - Shawn Hoon
62 Email shawnh@fugu-sg.org
66 The rest of the documentation details each of the object methods.
67 Internal methods are usually preceded with a _
72 # Let the code begin...
75 package Bio
::Tools
::RepeatMasker
;
78 use Bio
::SeqFeature
::FeaturePair
;
80 use base
qw(Bio::Root::Root Bio::Root::IO);
85 Usage : my $obj = Bio::Tools::RepeatMasker->new();
86 Function: Builds a new Bio::Tools::RepeatMasker object
87 Returns : Bio::Tools::RepeatMasker
88 Args : -fh/-file => $val, for initing input, see Bio::Root::IO
93 my($class,@args) = @_;
95 my $self = $class->SUPER::new
(@args);
96 $self->_initialize_io(@args);
104 Usage : my $r = $rpt_masker->next_result
105 Function: Get the next result set from parser data
106 Returns : Bio::SeqFeature::FeaturePair
107 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_end, $hit_start) = @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,