1 # bioperl module for Bio::Variation::SNP
3 # Copyright Allen Day <allenday@ucla.edu>, Stan Nelson <snelson@ucla.edu>
4 # Human Genetics, UCLA Medical School, University of California, Los Angeles
8 Bio::Variation::SNP - submitted SNP
12 $SNP = Bio::Variation::SNP->new ();
16 Inherits from Bio::Variation::SeqDiff and Bio::Variation::Allele, with
17 additional methods that are (db)SNP specific (ie, refSNP/subSNP IDs, batch
18 IDs, validation methods).
24 User feedback is an integral part of the evolution of this and other
25 Bioperl modules. Send your comments and suggestions preferably to one
26 of the Bioperl mailing lists. Your participation is much appreciated.
28 bioperl-l@bioperl.org - General discussion
29 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
33 Please direct usage questions or support issues to the mailing list:
35 I<bioperl-l@bioperl.org>
37 rather than to the module maintainer directly. Many experienced and
38 reponsive experts will be able look at the problem and quickly
39 address it. Please include a thorough description of the problem
40 with code and data examples if at all possible.
44 Report bugs to the Bioperl bug tracking system to help us keep track
45 the bugs and their resolution. Bug reports can be submitted via the
48 https://github.com/bioperl/bioperl-live/issues
52 Allen Day E<lt>allenday@ucla.eduE<gt>
56 The rest of the documentation details each of the object
57 methods. Internal methods are usually preceded with a _
61 # Let the code begin...
63 package Bio
::Variation
::SNP
;
66 use vars
qw($AUTOLOAD);
69 use base qw(Bio::Variation::SeqDiff Bio::Variation::Allele);
71 =head2 get/set-able methods
73 Usage : $is = $snp->method()
74 Function: for getting/setting attributes
75 Returns : a value. probably a scalar.
76 Args : if you're trying to set an attribute, pass in the new value.
122 heterozygous_SE
=> '',
132 functional_class
=> '',
137 my $param = $AUTOLOAD;
139 $self->throw(__PACKAGE__
." doesn't implement $param") unless defined $OK_AUTOLOAD{$param};
141 if( ref $OK_AUTOLOAD{$param} eq 'ARRAY' ) {
142 push @
{$self->{$param}}, shift if @_;
143 return $self->{$param}->[scalar(@
{$self->{$param}}) - 1];
145 $self->{$param} = shift if @_;
146 return $self->{$param};
151 #foreach my $slot (keys %RWSLOT){
152 # no strict "refs"; #add class methods to package
155 # $RWSLOT{$slot} = shift if @_;
156 # return $RWSLOT{$slot};
164 Usage : $is = $snp->is_subsnp()
165 Function: returns 1 if $snp is a subSNP
172 return shift->{is_subsnp
};
178 Usage : $subsnp = $snp->subsnp()
179 Function: returns the currently active subSNP of $snp
180 Returns : Bio::Variation::SNP
187 return $self->{subsnps
}->[ scalar($self->each_subsnp) - 1 ];
193 Usage : $subsnp = $snp->add_subsnp()
194 Function: pushes the previous value returned by subsnp() onto a stack,
195 accessible with each_subsnp().
196 Sets return value of subsnp() to a new Bio::Variation::SNP
197 object, and returns that object.
198 Returns : Bio::Varitiation::SNP
205 $self->throw("add_subsnp(): cannot add subSNP to subSNP, only to refSNP")
208 my $subsnp = Bio
::Variation
::SNP
->new;
209 push @
{$self->{subsnps
}}, $subsnp;
210 $self->subsnp->{is_subsnp
} = 1;
211 return $self->subsnp;
217 Usage : @subsnps = $snp->each_subsnp()
218 Function: returns a list of the subSNPs of a refSNP
226 $self->throw("each_subsnp(): cannot be called on a subSNP")
228 return @
{$self->{subsnps
}};