File Coverage

Bio/Phenotype/OMIM/OMIMentry.pm
Criterion Covered Total %
statement 190 214 88.7
branch 49 84 58.3
condition 15 27 55.5
subroutine 29 32 90.6
pod 21 23 91.3
total 304 380 80.0


line stmt bran cond sub pod time code
1             #
2             # BioPerl module for Bio::Phenotype::OMIM::OMIMentry
3             #
4             # Please direct questions and support issues to
5             #
6             # Cared for by Christian M. Zmasek or
7             #
8             # (c) Christian M. Zmasek, czmasek-at-burnham.org, 2002.
9             # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002.
10             #
11             # You may distribute this module under the same terms as perl itself.
12             # Refer to the Perl Artistic License (see the license accompanying this
13             # software package, or see http://www.perl.com/language/misc/Artistic.html)
14             # for the terms under which you may use, modify, and redistribute this module.
15             #
16             # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
17             # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18             # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19             #
20             # You may distribute this module under the same terms as perl itself
21              
22             # POD documentation - main docs before the code
23              
24             =head1 NAME
25              
26             Bio::Phenotype::OMIM::OMIMentry - represents OMIM (Online Mendelian
27             Inheritance in Man) database entries
28              
29             =head1 SYNOPSIS
30              
31             $obj = Bio::Phenotype::OMIM::OMIMentry->new( -mim_number => 200000,
32             -description => "This is ...",
33             -more_than_two_genes => 1 );
34              
35             =head1 DESCRIPTION
36              
37             Inherits from Bio::Phenotype::PhenotypeI.
38             Bio::Phenotype::OMIM::OMIMparser parses the flat file representation
39             of OMIM (i.e. files "omim.txt" and "genemap") returning OMIMentry objects.
40              
41             =head1 FEEDBACK
42              
43             =head2 Mailing Lists
44              
45             User feedback is an integral part of the evolution of this and other
46             Bioperl modules. Send your comments and suggestions preferably to the
47             Bioperl mailing lists Your participation is much appreciated.
48              
49             bioperl-l@bioperl.org - General discussion
50             http://bioperl.org/wiki/Mailing_lists - About the mailing lists
51              
52             =head2 Support
53              
54             Please direct usage questions or support issues to the mailing list:
55              
56             I
57              
58             rather than to the module maintainer directly. Many experienced and
59             reponsive experts will be able look at the problem and quickly
60             address it. Please include a thorough description of the problem
61             with code and data examples if at all possible.
62              
63             =head2 Reporting Bugs
64              
65             report bugs to the Bioperl bug tracking system to help us keep track
66             the bugs and their resolution. Bug reports can be submitted via the
67             web:
68              
69             https://github.com/bioperl/bioperl-live/issues
70              
71             =head1 AUTHOR
72              
73             Christian M. Zmasek
74              
75             Email: czmasek-at-burnham.org or cmzmasek@yahoo.com
76              
77             WWW: http://monochrome-effect.net/
78              
79             Address:
80              
81             Genomics Institute of the Novartis Research Foundation
82             10675 John Jay Hopkins Drive
83             San Diego, CA 92121
84              
85             =head1 APPENDIX
86              
87             The rest of the documentation details each of the object
88             methods. Internal methods are usually preceded with a _
89              
90             =cut
91              
92              
93             # Let the code begin...
94              
95              
96             package Bio::Phenotype::OMIM::OMIMentry;
97 2     2   523 use strict;
  2         3  
  2         65  
98              
99 2     2   670 use Bio::Phenotype::OMIM::MiniMIMentry;
  2         4  
  2         60  
100 2     2   728 use Bio::Phenotype::OMIM::OMIMentryAllelicVariant;
  2         6  
  2         73  
101              
102 2     2   13 use constant TRUE => 1;
  2         3  
  2         167  
103 2     2   10 use constant FALSE => 0;
  2         3  
  2         96  
104 2     2   11 use constant DEFAULT_MIM_NUMER => 0;
  2         3  
  2         99  
105              
106 2     2   8 use base qw(Bio::Phenotype::Phenotype);
  2         4  
  2         815  
107              
108              
109              
110              
111             =head2 new
112              
113             Title : new
114             Usage : $obj = Bio::Phenotype::OMIM::OMIMentry->new( -mim_number => 200000,
115             -description => "This is ...",
116             -more_than_two_genes => 1 );
117             Function: Creates a new OMIMentry object.
118             Returns : A new OMIMentry object.
119             Args : -mim_number => the MIM number
120             -title => the title or name
121             -alternative_titles_and_symbols => the "alternative titles and symbols"
122             -more_than_two_genes => can phenotype can be caused by mutation in any of two or more genes?
123             -is_separate => is this phenotype separate from those represented by other entries
124             -description => the description of this phenotype
125             -mapping_method => the mapping method
126             -gene_status => the gene status of this
127             -comment => a comment
128             -species => ref to the the species (human)
129             -created => created by whom/when
130             -edited => edited by whom/when
131             -contributors => contributed by whom/when
132             -additional_references => "see also"
133             -clinical_symptoms => the clinical symptoms
134             -minimim => the Mini MIM associated with this OMIM antry
135              
136             =cut
137              
138             sub new {
139              
140 3     3 1 148 my( $class,@args ) = @_;
141            
142 3         30 my $self = $class->SUPER::new( @args );
143            
144 3         20 my ( $mim_number,
145             $title,
146             $alternative_titles_and_symbols,
147             $more_than_two_genes,
148             $is_separate,
149             $description,
150             $mapping_method,
151             $gene_status,
152             $comment,
153             $species,
154             $created,
155             $edited,
156             $contributors,
157             $additional_references,
158             $clinical_symptoms,
159             $miniMIM )
160             = $self->_rearrange( [ qw( MIM_NUMBER
161             TITLE
162             ALTERNATIVE_TITLES_AND_SYMBOLS
163             MORE_THAN_TWO_GENES
164             IS_SEPARATE
165             DESCRIPTION
166             MAPPING_METHOD
167             GENE_STATUS
168             COMMENT
169             SPECIES
170             CREATED
171             EDITED
172             CONTRIBUTORS
173             ADDITIONAL_REFERENCES
174             CLINICAL_SYMPTOMS
175             MINIMIM ) ], @args );
176            
177 3         12 $self->init();
178            
179 3 50       9 $mim_number && $self->MIM_number( $mim_number );
180 3 50       10 $title && $self->title( $title );
181 3 50       8 $alternative_titles_and_symbols && $self->alternative_titles_and_symbols( $alternative_titles_and_symbols );
182 3 50       9 $more_than_two_genes && $self->more_than_two_genes( $more_than_two_genes );
183 3 50       6 $is_separate && $self->is_separate( $is_separate );
184 3 50       7 $description && $self->description( $description );
185 3 50       260 $mapping_method && $self->mapping_method( $mapping_method );
186 3 50       9 $gene_status && $self->gene_status( $gene_status );
187 3 50       7 $comment && $self->comment( $comment );
188 3 50       6 $species && $self->species( $species );
189 3 50       6 $created && $self->created( $created );
190 3 50       6 $edited && $self->edited( $edited );
191 3 50       7 $contributors && $self->contributors( $contributors );
192 3 50       5 $additional_references && $self->additional_references( $additional_references );
193 3 50       5 $clinical_symptoms && $self->clinical_symptoms_raw( $clinical_symptoms );
194 3 50       6 $miniMIM && $self->miniMIM( $miniMIM );
195            
196 3         11 return $self;
197            
198             } # new
199              
200              
201              
202             =head2 init
203              
204             Title : init()
205             Usage : $obj->init();
206             Function: Initializes this OMIMentry to all "" and empty lists.
207             Returns :
208             Args :
209              
210             =cut
211              
212             sub init {
213              
214 6     6 1 9 my( $self ) = @_;
215              
216 6         61 $self->MIM_number( DEFAULT_MIM_NUMER );
217 6         17 $self->title( "" );
218 6         15 $self->alternative_titles_and_symbols( "" );
219 6         20 $self->more_than_two_genes( FALSE );
220 6         16 $self->is_separate( FALSE );
221 6         19 $self->description( "" );
222 6         16 $self->mapping_method( "" );
223 6         14 $self->gene_status( "" );
224 6         21 $self->comment( "" );
225 6         35 my $species = Bio::Species->new();
226 6         23 $species->classification( qw( sapiens Homo ) );
227 6         37 $self->species( $species );
228 6         16 $self->created( "" );
229 6         13 $self->edited( "" );
230 6         13 $self->contributors( "" );
231 6         16 $self->additional_references( "" );
232 6         15 $self->clinical_symptoms( {} );
233 6         20 $self->remove_Correlates();
234 6         21 $self->remove_References();
235 6         18 $self->remove_AllelicVariants();
236 6         18 $self->remove_CytoPositions();
237 6         16 $self->remove_gene_symbols();
238 6         18 $self->remove_Genotypes();
239 6         20 $self->remove_DBLinks();
240 6         20 $self->remove_keywords();
241 6         15 $self->remove_Variants();
242 6         17 $self->remove_Measures();
243 6         29 $self->miniMIM( Bio::Phenotype::OMIM::MiniMIMentry->new() );
244            
245             } # init
246              
247              
248              
249             sub to_string {
250              
251 1     1 0 707 my( $self ) = @_;
252              
253 1         2 my $s = "";
254              
255 1         2 $s .= "-- MIM number:\n";
256 1         3 $s .= $self->MIM_number()."\n\n";
257 1         2 $s .= "-- Title:\n";
258 1         3 $s .= $self->title()."\n\n";
259 1         2 $s .= "-- Alternative Titles and Symbols:\n";
260 1         3 $s .= $self->alternative_titles_and_symbols()."\n\n";
261 1         2 $s .= "-- Can be caused by Mutation in any of two or more Genes:\n";
262 1         3 $s .= $self->more_than_two_genes()."\n\n";
263 1         2 $s .= "-- Phenotype is separate:\n";
264 1         4 $s .= $self->is_separate()."\n\n";
265 1         2 $s .= "-- Description:\n";
266 1         2 $s .= $self->description()."\n\n";
267 1         3 $s .= "-- Species:\n";
268 1         4 $s .= $self->species()->binomial()."\n\n";
269 1         2 $s .= "-- Clinical Symptoms:\n";
270 1         3 $s .= $self->clinical_symptoms()."\n\n";
271 1         2 $s .= "-- Allelic Variants:\n";
272 1         2 $s .= $self->_array_to_string( $self->each_AllelicVariant() )."\n";
273 1         2 $s .= "-- Cyto Positions:\n";
274 1         2 $s .= $self->_array_to_string( $self->each_CytoPosition() )."\n";
275 1         2 $s .= "-- Gene Symbols:\n";
276 1         3 $s .= $self->_array_to_string( $self->each_gene_symbol() )."\n";
277 1         1 $s .= "-- Correlates:\n";
278 1         3 $s .= $self->_array_to_string( $self->each_Correlate() )."\n";
279 1         1 $s .= "-- References:\n";
280 1         7 $s .= $self->_array_to_string( $self->each_Reference() )."\n";
281 1         2 $s .= "-- Additional References:\n";
282 1         3 $s .= $self->additional_references()."\n\n";
283 1         2 $s .= "-- Mapping Method:\n";
284 1         2 $s .= $self->mapping_method()."\n\n";
285 1         2 $s .= "-- Gene status:\n";
286 1         2 $s .= $self->gene_status()."\n\n";
287 1         2 $s .= "-- Created:\n";
288 1         3 $s .= $self->created()."\n\n";
289 1         2 $s .= "-- Contributors:\n";
290 1         2 $s .= $self->contributors()."\n\n";
291 1         2 $s .= "-- Edited:\n";
292 1         2 $s .= $self->edited()."\n\n";
293 1         2 $s .= "-- Comment:\n";
294 1         2 $s .= $self->comment()."\n\n";
295 1         1 $s .= "-- MiniMIM:\n";
296 1         36 $s .= $self->miniMIM()->to_string()."\n\n";
297 1         6 return $s;
298            
299              
300             } # to_string
301              
302              
303              
304             =head2 MIM_number
305              
306             Title : MIM_number
307             Usage : $omim->MIM_number( "100050" );
308             or
309             print $omim->MIM_number();
310             Function: Set/get for the MIM number of this OMIM entry.
311             Returns : The MIM number [an integer larger than 100000].
312             Args : The MIM number [an integer larger than 100000] (optional).
313              
314             =cut
315              
316             sub MIM_number {
317 13     13 1 1474 my ( $self, $value ) = @_;
318              
319 13 100       32 if ( defined $value ) {
320 9 50 66     92 if ( $value =~ /\D/
      33        
321             || ( $value < 100000 && $value != DEFAULT_MIM_NUMER ) ) {
322 0         0 $self->throw( "Found [$value]"
323             . " where [integer larger than 100000] expected" );
324             }
325 9         31 $self->{ "_MIM_number" } = $value;
326             }
327              
328 13         36 return $self->{ "_MIM_number" };
329              
330             } # MIM_number
331              
332              
333              
334              
335             =head2 title
336              
337             Title : title
338             Usage : $omim->title( "AARSKOG SYNDROME" );
339             or
340             print $omim->title();
341             Function: Set/get for the title or name of this OMIM entry.
342             This method is an alias to the method "name" of
343             Bio::Phenotype::PhenotypeI.
344             Returns : The title [scalar].
345             Args : The title [scalar] (optional).
346              
347             =cut
348              
349             sub title {
350 13     13 1 17 my $self = shift;
351            
352 13         43 $self->name(@_);
353            
354             } # title
355              
356              
357              
358              
359             =head2 alternative_titles_and_symbols
360              
361             Title : alternative_titles_and_symbols
362             Usage : $omim->alternative_titles_and_symbols( "AORTIC ANEURYSM, ABDOMINAL" );
363             or
364             print $omim->alternative_titles_and_symbols();
365             Function: Set/get for the "alternative titles and symbols" of this OMIM entry.
366             Currently, everything after the first line of title (TI) field is
367             considered "alternative titles and symbols".
368             Returns : "alternative titles and symbols" [scalar].
369             Args : "alternative titles and symbols" [scalar] (optional).
370              
371             =cut
372              
373             sub alternative_titles_and_symbols {
374 13     13 1 20 my ( $self, $value ) = @_;
375              
376 13 100       27 if ( defined $value ) {
377 9         16 $self->{ "_alternative_titles_and_symbols" } = $value;
378             }
379              
380 13         26 return $self->{ "_alternative_titles_and_symbols" };
381              
382             } # alternative_titles_and_symbols
383              
384              
385              
386              
387             =head2 more_than_two_genes
388              
389             Title : more_than_two_genes
390             Usage : $omim->more_than_two_genes( 1 );
391             or
392             print $omim->more_than_two_genes();
393             Function: This is true if this phenotype can be caused
394             by mutation in any of two or more genes.
395             In OMIM, this is indicated by a number symbol (#)
396             before an entry number (e.g. #114480 -- BREAST CANCER).
397             Returns : [1 or 0].
398             Args : [1 or 0] (optional).
399              
400             =cut
401              
402             sub more_than_two_genes {
403 12     12 1 16 my ( $self, $value ) = @_;
404              
405 12 100       31 if ( defined $value ) {
406 8         24 $self->_is_true_or_false( $value );
407 8         15 $self->{ "_more_than_two_genes" } = $value;
408             }
409              
410 12         27 return $self->{ "_more_than_two_genes" };
411              
412             } # more_than_two_genes
413              
414              
415              
416              
417             =head2 is_separate
418              
419             Title : is_separate
420             Usage : $omim->is_separate( 1 );
421             or
422             print $omim->is_separate();
423             Function: This is true if the phenotype determined by the gene at
424             the given locus is separate from those represented by
425             other entries where "is_separate" is true and if the mode
426             of inheritance of the phenotype has been proved
427             (in the judgment of the authors and editors).
428             In OMIM, this is indicated by a asterisk (*)
429             before an entry number (e.g. *113705 BREAST CANCER,
430             TYPE 1; BRCA1).
431             Returns : [1 or 0].
432             Args : [1 or 0] (optional).
433              
434             =cut
435              
436             sub is_separate {
437 12     12 1 16 my ( $self, $value ) = @_;
438              
439 12 100       26 if ( defined $value ) {
440 8         17 $self->_is_true_or_false( $value );
441 8         14 $self->{ "_is_separate" } = $value;
442             }
443              
444 12         26 return $self->{ "_is_separate" };
445              
446             } # is_separate
447              
448              
449              
450              
451             =head2 mapping_method
452              
453             Title : mapping_method
454             Usage : $omim->mapping_method( "PCR of somatic cell hybrid DNA" );
455             or
456             print $omim->mapping_method();
457             Function: Set/get for the mapping method of this OMIM entry.
458             Returns : The mapping method [scalar].
459             Args : The mapping method [scalar] (optional).
460              
461             =cut
462              
463             sub mapping_method {
464 13     13 1 19 my $self = shift;
465 13 100       38 return $self->{ "_mapping_method" } = shift if(@_);
466 4         15 return $self->{ "_mapping_method" };
467             } # mapping_method
468              
469             =head2 gene_status
470              
471             Title : gene_status
472             Usage : $omim->gene_status( "C" );
473             or
474             print $omim->gene_status();
475             Function: Set/get for the gene status of this OMIM entry.
476             The certainty with which assignment of loci to chromosomes or the linkage
477             between two loci has been established has been graded into the following
478             classes:
479             C = confirmed - observed in at least two laboratories or in several families.
480             P = provisional - based on evidence from one laboratory or one family.
481             I = inconsistent - results of different laboratories disagree.
482             L = limbo - evidence not as strong as that provisional, but included for
483             heuristic reasons. (Same as `tentative'.)
484              
485             Returns : [C, P, I, or L].
486             Args : [C, P, I, or L] (optional).
487              
488             =cut
489              
490             sub gene_status {
491 13     13 1 22 my ( $self, $value ) = @_;
492              
493 13 100       29 if ( defined $value ) {
494             #unless ( $value eq "C"
495             # || $value eq "P"
496             # || $value eq "I"
497             # || $value eq "L"
498             # || $value eq "A" # !?
499             # || $value eq "H" # !?
500             # || $value eq "U" # !?
501             # || $value eq "" ) {
502             # $self->throw( "Found [$value]"
503             # . " where [C, P, I, or L] expected" );
504             #}
505 9 50 66     95 unless ( $value eq "C"
      100        
      66        
      66        
506             || $value eq "P"
507             || $value eq "I"
508             || $value eq "L"
509             || $value eq "" ) {
510 0         0 $value = "";
511             }
512            
513 9         20 $self->{ "_gene_status" } = $value;
514             }
515              
516 13         27 return $self->{ "_gene_status" };
517              
518             } # gene_status
519              
520              
521             =head2 clinical_symptoms
522              
523             Title : clinical_symptoms
524             Usage : $omim->clinical_symptoms({});
525             Function: Set/get for the clinical symptoms of this OMIM entry.
526             Returns : [hash reference].
527             Args : [hash reference]. Suggested not to assign alone. Parser will do.
528              
529             =cut
530              
531             sub clinical_symptoms {
532 9     9 1 10 my ( $self, $value ) = @_;
533              
534 9 100       21 if ( defined $value ) {
535 6 50       14 unless(ref($value) eq 'HASH'){
536 0         0 $self->throw('a hash referenced needed');
537             }
538 6         9 $self->{ "_clinical_symptoms" } = $value;
539             }
540              
541 9         18 return $self->{ "_clinical_symptoms" };
542              
543             } # clinical_symptoms
544              
545             =head2 clinical_symptoms_raw
546              
547             Title : clinical_symptoms_raw
548             Usage : $omim->clinical_symptoms( "Patients with ..." );
549             print $omim->clinical_symptoms();
550             Functions : Get/set for text information of clinical symptoms
551             Returns : The clinical symptoms [scalar].
552             Args : The clinical symptoms [scalar] (optional).
553              
554             =cut
555              
556             sub clinical_symptoms_raw {
557 8     8 1 11 my $self = shift;
558 8 100       29 return $self->{_clinical_symptoms_raw} = shift if @_;
559 3         15 return $self->{_clinical_symptoms_raw};
560             }
561              
562             =head2 add_clinical_symptoms
563              
564             Title : add_clinical_symptoms
565             Usage : $entry->add_clinical_symptoms('Ears', 'Floppy ears', 'Lop-ears');
566             Function : add one or more symptoms on one part of body.
567             Returns : [none]
568             Args : ($part, @symptoms)
569             $part, the text name of part/organism of human
570             @symptoms, an array of text description
571              
572             =cut
573              
574             sub add_clinical_symptoms {
575 0     0 1 0 my ($self, $part, @symptoms) = @_;
576 0 0       0 unless(defined $part){
577 0         0 $self->throw('a part/organism must be assigned');
578             }
579 0 0       0 $self->{_clinical_symptoms} = {} unless $self->{_clinical_symptoms};
580             $self->{_clinical_symptoms}->{$part} = []
581 0 0       0 unless $self->{_clinical_symptoms}->{$part};
582 0         0 push @{$self->{_clinical_symptoms}->{$part}}, @symptoms;
  0         0  
583             }
584              
585             =head2 query_clinical_symptoms
586              
587             Title : get_clinical_symptoms
588             Usage : @symptoms = $self->query_clinical_symptoms('Ears');
589             Function : get all symptoms specific to one part/organism.
590             Returns : an array of text
591             Args : $organ
592              
593             =cut
594              
595             sub query_clinical_symptoms {
596 0     0 1 0 my ($self, $organ)=@_;
597 0         0 my $symptoms=$self->{_clinical_symptoms}->{$organ};
598 0         0 @$symptoms;
599             }
600              
601             sub get_clinical_symptom_organs {
602 0     0 0 0 my ($self)=@_;
603 0         0 keys %{$self->{_clinical_symptoms}};
  0         0  
604             }
605              
606             =head2 created
607              
608             Title : created
609             Usage : $omim->created( "Victor A. McKusick: 6/4/1986" );
610             or
611             print $omim->created();
612             Function: Set/get for the created field of the OMIM database.
613             Returns : Name(s) and date(s) [scalar - free form].
614             Args : Name(s) and date(s) [scalar - free form] (optional).
615              
616             =cut
617              
618             sub created {
619 13     13 1 15 my $self = shift;
620 13 100       39 return $self->{ "_created" } = shift if(@_);
621 4         14 return $self->{ "_created" };
622              
623             } # created
624              
625              
626              
627              
628             =head2 contributors
629              
630             Title : contributors
631             Usage : $omim->contributors( "Kelly A. Przylepa - revised: 03/18/2002" );
632             or
633             print $omim->contributors();
634             Function: Set/get for the contributors field of the OMIM database.
635             Returns : Name(s) and date(s) [scalar - free form].
636             Args : Name(s) and date(s) [scalar - free form] (optional).
637              
638             =cut
639              
640             sub contributors {
641 13     13 1 20 my $self = shift;
642 13 100       32 $self->{ "_contributors" } = shift if(@_);
643 13         30 return $self->{ "_contributors" };
644              
645             } # contributors
646              
647              
648              
649              
650             =head2 edited
651              
652             Title : edited
653             Usage : $omim->edited( "alopez: 06/03/1997" );
654             or
655             print $omim->edited();
656             Function: Set/get for the edited field of the OMIM database.
657             Returns : Name(s) and date(s) [scalar - free form].
658             Args : Name(s) and date(s) [scalar - free form] (optional).
659              
660             =cut
661              
662             sub edited {
663 13     13 1 15 my $self = shift;
664 13 100       43 return $self->{ "_edited" } = shift if(@_);
665 4         13 return $self->{ "_edited" };
666              
667             } # edited
668              
669              
670              
671              
672             =head2 additional_references
673              
674             Title : additional_references
675             Usage : $omim->additional_references( "Miller er al." );
676             or
677             print $omim->additional_references();
678             Function: Set/get for the additional references of this OMIM antry
679             (see also).
680             Returns : additional reference [scalar].
681             Args : additional reference [scalar] (optional).
682              
683             =cut
684              
685             sub additional_references {
686 11     11 1 14 my $self = shift;
687 11 100       37 return $self->{ "_additional_references" } = shift if(@_);
688 3         9 return $self->{ "_additional_references" };
689              
690             } # additional_references
691              
692             =head2 miniMIM
693              
694             Title : miniMIM
695             Usage : $omim->miniMIM( $MM );
696             or
697             $MM = $omim->miniMIM();
698             Function: Set/get for the Mini MIM associated with this OMIM antry
699             (see also).
700             Returns : [Bio::Phenotype::OMIM::MiniMIMentry].
701             Args : [Bio::Phenotype::OMIM::MiniMIMentry] (optional).
702              
703             =cut
704              
705             sub miniMIM {
706              
707 13     13 1 21 my ( $self, $value ) = @_;
708              
709 13 100       27 if ( defined $value ) {
710 9         22 $self->_check_ref_type( $value, "Bio::Phenotype::OMIM::MiniMIMentry" );
711 9         15 $self->{ "_mini_mim" } = $value;
712             }
713            
714 13         30 return $self->{ "_mini_mim" };
715             }
716              
717             =head2 each_AllelicVariant
718              
719             Title : each_AllelicVariant()
720             Usage : @avs = $obj->each_AllelicVariant();
721             Function: Returns a list of Bio::Phenotype::OMIM::OMIMentryAllelicVariant objects
722             associated with this OMIM entry.
723             Returns : A list of Bio::Phenotype::OMIM::OMIMentryAllelicVariant objects.
724             Args :
725              
726             =cut
727              
728             sub each_AllelicVariant {
729 16     16 1 790 my ( $self ) = @_;
730            
731 16 100       43 return @{$self->{"_allelic_variants"}} if exists($self->{"_allelic_variants"});
  13         40  
732 3         4 return ();
733             } # each_AllelicVariant
734              
735              
736             =head2 add_AllelicVariants
737              
738             Title : add_AllelicVariants
739             Usage : $obj->add_AllelicVariants( @avs );
740             or
741             $obj->add_AllelicVariants( $av );
742             Function: Pushes one or more OMIMentryAllelicVariant
743             into the list of OMIMentryAllelicVariants.
744             Returns :
745             Args : Bio::Phenotype::OMIM::OMIMentryAllelicVariant object(s).
746              
747             =cut
748              
749             sub add_AllelicVariants {
750 3     3 1 7 my ( $self, @values ) = @_;
751            
752 3 50       12 return unless( @values );
753              
754 3         7 foreach my $value ( @values ) {
755 14         19 $self->_check_ref_type( $value, "Bio::Phenotype::OMIM::OMIMentryAllelicVariant" );
756             }
757            
758 3         5 push( @{ $self->{ "_allelic_variants" } }, @values );
  3         18  
759            
760             } # add_AllelicVariants
761              
762              
763             =head2 remove_AllelicVariants
764              
765             Title : remove_AllelicVariants
766             Usage : $obj->remove_AllelicVariants();
767             Function: Deletes (and returns) the list of OMIMentryAllelicVariant objects
768             associated with this OMIM entry.
769             Returns : A list of OMIMentryAllelicVariant objects.
770             Args :
771              
772             =cut
773              
774             sub remove_AllelicVariants {
775 8     8 1 11 my ( $self ) = @_;
776            
777 8         19 my @a = $self->each_AllelicVariant();
778 8         13 $self->{ "_allelic_variants" } = [];
779 8         13 return @a;
780              
781             } # remove_AllelicVariants
782              
783              
784             # Title : _array_to_string
785             # Function:
786             # Returns :
787             # Args :
788             sub _array_to_string {
789 5     5   4 my( $self, @value ) = @_;
790              
791 5         6 my $s = "";
792            
793 5         8 for ( my $i = 0; $i < scalar( @value ); ++$i ) {
794 0 0 0     0 if ( ! ref( $value[ $i ] ) ) {
    0          
    0          
    0          
795 0         0 $s .= "#" . $i . "\n-- Value:\n" . $value[ $i ] . "\n";
796             }
797             elsif ( $value[ $i ]->isa( "Bio::Phenotype::OMIM::OMIMentryAllelicVariant" )
798             || $value[ $i ]->isa( "Bio::Phenotype::Correlate" ) ) {
799 0         0 $s .= "#" . $i . "\n" . ( $value[ $i ] )->to_string() . "\n";
800             }
801             elsif ( $value[ $i ]->isa( "Bio::Annotation::Reference" ) ) {
802 0         0 $s .= "#".$i."\n-- Authors:\n".( $value[ $i ] )->authors()."\n";
803 0         0 $s .= "-- Title:\n".( $value[ $i ] )->title()."\n";
804 0         0 $s .= "-- Location:\n".( $value[ $i ] )->location()."\n";
805             }
806             elsif ( $value[ $i ]->isa( "Bio::Map::CytoPosition" ) ) {
807 0         0 $s .= "#" . $i . "\n-- Value:\n" . ( $value[ $i ] )->value() . "\n";
808             }
809             }
810            
811 5         10 return $s;
812            
813             } # _array_to_string
814              
815              
816             # Title :_is_true_or_false
817             # Function: Checks whether the argument is 1 or 0.
818             # Returns :
819             # Args : The value to be checked.
820             sub _is_true_or_false {
821 16     16   15 my ( $self, $value ) = @_;
822 16 50 66     107 unless ( $value !~ /\D/ && ( $value == TRUE || $value == FALSE ) ) {
      33        
823 0           $self->throw( "Found [" . $value
824             . "] where " . TRUE . " or " . FALSE . " expected" );
825             }
826             } # _is_true_or_false
827              
828              
829             1;