2 # BioPerl module for Bio::Tools::Seg
4 # Copyright Balamurugan Kumarasamy
5 # Totally re-written, added docs and tests -- Torsten Seemann, Sep 2006
8 # You may distribute this module under the same terms as perl itself
10 # POD documentation - main docs before the code
14 Bio::Tools::Seg - parse C<seg> output
19 my $parser = Bio::Tools::Seg->(-file => 'seg.fasta');
20 while ( my $f = $parser->next_result ) {
21 if ($f->score < 1.5) {
22 print $f->location->to_FTstring, " is low complexity\n";
28 C<seg> identifies low-complexity regions on a protein sequence.
29 It is usually part of the C<WU-BLAST> and C<InterProScan> packages.
31 The L<Bio::Tools::Seg> module will only parse the "fasta" output
32 modes of C<seg>, i.e. C<seg -l> (low complexity regions only),
33 C<seg -h> (high complexity regions only), or C<seg -a> (both low
36 It creates a L<Bio::SeqFeature::Generic> for each FASTA-like entry
37 found in the input file. It is up to the user to appropriately filter
38 these using the feature's score.
44 User feedback is an integral part of the evolution of this and other
45 Bioperl modules. Send your comments and suggestions preferably to
46 the Bioperl mailing list. Your participation is much appreciated.
48 bioperl-l@bioperl.org - General discussion
49 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
53 Please direct usage questions or support issues to the mailing list:
55 I<bioperl-l@bioperl.org>
57 rather than to the module maintainer directly. Many experienced and
58 reponsive experts will be able look at the problem and quickly
59 address it. Please include a thorough description of the problem
60 with code and data examples if at all possible.
64 Report bugs to the Bioperl bug tracking system to help us keep track
65 of the bugs and their resolution. Bug reports can be submitted via the
68 https://redmine.open-bio.org/projects/bioperl/
70 =head1 AUTHOR - Torsten Seemann
72 Email - torsten.seemann AT infotech.monash.edu.au
74 =head1 CONTRIBUTOR - Bala
76 Email - savikalpa@fugu-sg.org
80 The rest of the documentation details each of the object methods.
81 Internal methods are usually preceded with a _
85 package Bio
::Tools
::Seg
;
88 use Bio
::SeqFeature
::Generic
;
89 use base
qw(Bio::Root::Root Bio::Root::IO);
94 Usage : my $obj = Bio::Tools::Seg->new();
95 Function: Builds a new Bio::Tools::Seg object
96 Returns : Bio::Tools::Seg
97 Args : -fh/-file => $val, # for initing input, see Bio::Root::IO
103 my($class,@args) = @_;
104 my $self = $class->SUPER::new
(@args);
105 $self->_initialize_io(@args);
112 Usage : my $feat = $seg->next_result
113 Function: Get the next result set from parser data
114 Returns : Bio::SeqFeature::Generic
122 # For example in this line
123 # test_prot(214-226) complexity=2.26 (12/2.20/2.50)
129 while (my $line = $self->_readline) {
130 if ($line =~ /^\>\s*?(\S+)?\s*?\((\d+)\-(\d+)\)\s*complexity=(\S+)/) {
131 return Bio
::SeqFeature
::Generic
->new(
136 -source_tag
=> 'Seg',
137 -primary
=> 'low_complexity'