Permalink
Browse files

doc: fix indentation, remove hard tabs and trailing whitespace

  • Loading branch information...
1 parent 3a08414 commit db792bdb8feb8b0a56d4e9cc4caa5b50c70ef659 @carandraug carandraug committed Mar 26, 2013
Showing with 102 additions and 105 deletions.
  1. +102 −105 Bio/Cluster/SequenceFamily.pm
@@ -1,7 +1,7 @@
#
# BioPerl module for Bio::Cluster::SequenceFamily
#
-# Please direct questions and support issues to <bioperl-l@bioperl.org>
+# Please direct questions and support issues to <bioperl-l@bioperl.org>
#
# Cared for by Shawn Hoon <shawnh@fugu-sg.org>
#
@@ -68,15 +68,15 @@ of the Bioperl mailing lists. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
-=head2 Support
+=head2 Support
Please direct usage questions or support issues to the mailing list:
I<bioperl-l@bioperl.org>
-rather than to the module maintainer directly. Many experienced and
-reponsive experts will be able look at the problem and quickly
-address it. Please include a thorough description of the problem
+rather than to the module maintainer directly. Many experienced and
+reponsive experts will be able look at the problem and quickly
+address it. Please include a thorough description of the problem
with code and data examples if at all possible.
=head2 Reporting Bugs
@@ -124,47 +124,46 @@ See L<Bio::Cluster::SequenceFamily>.
=cut
sub new {
- my ($class,@args) = @_;
- my $self = $class->SUPER::new(@args);
- my ($id,$description,$version,$annot_score,
- $family_score,$members) = $self->_rearrange([qw(FAMILY_ID DESCRIPTION VERSION
- ANNOTATION_SCORE
- FAMILY_SCORE MEMBERS)],@args);
- $self->{'_members'} = [];
- $id && $self->family_id($id);
- $description && $self->description($description);
- $version && $self->version($version);
- $annot_score && $self->annotation_score($annot_score);
- $family_score && $self->family_score($family_score);
- $members && $self->add_members($members);
-
- return $self;
-
+ my ($class,@args) = @_;
+ my $self = $class->SUPER::new(@args);
+ my ($id,$description,$version,$annot_score,
+ $family_score,$members) = $self->_rearrange([qw(FAMILY_ID DESCRIPTION VERSION
+ ANNOTATION_SCORE
+ FAMILY_SCORE MEMBERS)],@args);
+ $self->{'_members'} = [];
+ $id && $self->family_id($id);
+ $description && $self->description($description);
+ $version && $self->version($version);
+ $annot_score && $self->annotation_score($annot_score);
+ $family_score && $self->family_score($family_score);
+ $members && $self->add_members($members);
+
+ return $self;
}
=head2 version
Title : version
Usage : $family->version("1.0");
Function: get/set for version
- Returns : a string version of the family generated.
+ Returns : a string version of the family generated.
=cut
sub version{
- my ($self,$value) = @_;
- if($value){
- $self->{'_version'} =$value;
- }
- return $self->{'_version'};
+ my ($self,$value) = @_;
+ if($value){
+ $self->{'_version'} =$value;
+ }
+ return $self->{'_version'};
}
=head2 annotation_score
Title : annotation_score
Usage : $family->annotation_score(100);
Function: get/set for annotation_score which
- represent the confidence in which the
+ represent the confidence in which the
consensus description has been assigned
to the family.
Returns : Bio::SimpleAlign
@@ -174,11 +173,11 @@ See L<Bio::SimpleAlign>
=cut
sub annotation_score{
- my ($self,$score) = @_;
- if($score){
- $self->{'_annotation_score'} = $score;
- }
- return $self->{'_annotation_score'};
+ my ($self,$score) = @_;
+ if($score){
+ $self->{'_annotation_score'} = $score;
+ }
+ return $self->{'_annotation_score'};
}
=head2 alignment
@@ -194,10 +193,10 @@ See L<Bio::SimpleAlign>
=cut
sub alignment {
- my ($self,$align) = @_;
- if($align){
- $self->{'_alignment'} = $align;
- }
+ my ($self,$align) = @_;
+ if($align){
+ $self->{'_alignment'} = $align;
+ }
return $self->{'_alignment'};
}
@@ -206,19 +205,19 @@ sub alignment {
Title : tree
Usage : $family->tree($tree);
Function: get/set for an tree object representing
- the phylogenetic tree of the family.
+ the phylogenetic tree of the family.
Returns : Bio::Tree
See L<Bio::Tree>
=cut
sub tree {
- my ($self,$tree) = @_;
- if($tree) {
- $self->{'_tree'} = $tree;
- }
- return $self->{'_tree'};
+ my ($self,$tree) = @_;
+ if($tree) {
+ $self->{'_tree'} = $tree;
+ }
+ return $self->{'_tree'};
}
=head1 L<Bio::Cluster::FamilyI> methods
@@ -247,17 +246,17 @@ sub family_score {
=head2 family_id
Title : family_id
- Usage : $family->family_id("Family_1");
- Function: get/set for family id
+ Usage : $family->family_id("Family_1");
+ Function: get/set for family id
This is aliased to display_id().
- Returns : a string specifying identifier of the family
+ Returns : a string specifying identifier of the family
=cut
sub family_id{
- return shift->display_id(@_);
+ return shift->display_id(@_);
}
=head1 L<Bio::ClusterI> methods
@@ -267,37 +266,37 @@ sub family_id{
=head2 display_id
Title : display_id
- Usage :
+ Usage :
Function: Get/set the display name or identifier for the cluster
Returns : a string
Args : optional, on set the display ID ( a string)
=cut
sub display_id{
- my ($self,$id) = @_;
- if($id){
- $self->{'_cluster_id'} = $id;
- }
- return $self->{'_cluster_id'};
+ my ($self,$id) = @_;
+ if($id){
+ $self->{'_cluster_id'} = $id;
+ }
+ return $self->{'_cluster_id'};
}
=head2 description
Title : description
Usage : $fam->description("POLYUBIQUITIN")
Function: get/set for the consensus description of the cluster
- Returns : the description string
- Args : Optional the description string
+ Returns : the description string
+ Args : Optional the description string
=cut
sub description{
- my ($self,$desc) = @_;
- if($desc){
- $self->{'_description'} = $desc;
- }
- return $self->{'_description'};
+ my ($self,$desc) = @_;
+ if($desc){
+ $self->{'_description'} = $desc;
+ }
+ return $self->{'_description'};
}
=head2 get_members
@@ -318,51 +317,49 @@ sub description{
Function: get members using methods from L<Bio::Species>
the phylogenetic tree of the family.
- Returns : an array of objects that are member of this family.
+ Returns : an array of objects that are member of this family.
=cut
sub get_members {
- my $self = shift;
- my @ret;
-
- if(@_) {
- my %hash = @_;
- foreach my $mem ( @{$self->{'_members'}} ) {
- foreach my $key ( keys %hash){
- my $method = $key;
- $method=~s/-//g;
- if($mem->can('species')){
- my $species = $mem->species;
- $species->can($method) ||
- $self->throw("$method is an invalid criteria");
- if($species->$method() eq $hash{$key} ){
- push @ret, $mem;
- }
- }
- }
- }
- return @ret;
- }
- return @{$self->{'_members'}};
+ my $self = shift;
+ my @ret;
+
+ if(@_) {
+ my %hash = @_;
+ foreach my $mem ( @{$self->{'_members'}} ) {
+ foreach my $key ( keys %hash){
+ my $method = $key;
+ $method=~s/-//g;
+ if($mem->can('species')){
+ my $species = $mem->species;
+ $species->can($method) ||
+ $self->throw("$method is an invalid criteria");
+ if($species->$method() eq $hash{$key} ){
+ push @ret, $mem;
+ }
+ }
+ }
+ }
+ return @ret;
+ }
+ return @{$self->{'_members'}};
}
=head2 size
Title : size
Usage : $fam->size();
- Function: get/set for the size of the family,
+ Function: get/set for the size of the family,
calculated from the number of members
- Returns : the size of the family
- Args :
+ Returns : the size of the family
+ Args :
=cut
sub size {
- my ($self) = @_;
-
- return scalar(@{$self->{'_members'}});
-
+ my ($self) = @_;
+ return scalar(@{$self->{'_members'}});
}
=head2 cluster_score
@@ -377,11 +374,11 @@ sub size {
=cut
sub cluster_score{
- my ($self,$score) = @_;
- if($score){
- $self->{'_cluster_score'} = $score;
- }
- return $self->{'_cluster_score'};
+ my ($self,$score) = @_;
+ if($score){
+ $self->{'_cluster_score'} = $score;
+ }
+ return $self->{'_cluster_score'};
}
@@ -396,7 +393,7 @@ sub cluster_score{
Title : add_members
Usage : $fam->add_member([$seq1,$seq1]);
Function: add members to a family
- Returns :
+ Returns :
Args : the member(s) to add, as an array or arrayref
=cut
@@ -420,7 +417,7 @@ sub add_members{
Title : remove_members
Usage : $fam->remove_members();
- Function: remove all members from a family
+ Function: remove all members from a family
Returns : the previous array of members
Args : none
@@ -451,15 +448,15 @@ sub remove_members{
sub members{
my $self = shift;
if(@_) {
- # this is in set mode
- $self->warn("setting members() in ".ref($self)." is deprecated.\n".
- "Use add_members() instead.");
- return $self->add_members(@_);
+ # this is in set mode
+ $self->warn("setting members() in ".ref($self)." is deprecated.\n".
+ "Use add_members() instead.");
+ return $self->add_members(@_);
} else {
- # get mode
- $self->warn("members() in ".ref($self)." is deprecated.\n".
- "Use get_members() instead.");
- return $self->get_members();
+ # get mode
+ $self->warn("members() in ".ref($self)." is deprecated.\n".
+ "Use get_members() instead.");
+ return $self->get_members();
}
}

0 comments on commit db792bd

Please sign in to comment.