Genetics/TissueSample.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 40 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
printXML
2.0
BEGIN
2.0
CRAP 2.0
1 # GenPerl module
2 #
3  
4 # POD documentation - main docs before the code
5  
6 =head1 NAME
7  
8 Genetics::TissueSample
9  
10 =head1 SYNOPSIS
11  
12 $sample = new Genetics::TissueSample(name => 'SM20.1',
13 importID => 273,
14 dateCreated => $today,
15 comment => "Hard to make DNA from this",
16 Keywords => [ {name => "Test Data",
17 dataType => "Boolean",
18 value => 1},
19 ],
20 tissue => "Muscle",
21 dateCollected => "2001-01-18",
22 amount => 150,
23 amountUnits => "g",
24 Subject => {name => 'EAPed20.1',
25 importID => 12},
26 DNASamples => [ {name => 'SM20.1-3',
27 importID => 272},
28 ]
29 ) ;
30
31 See the GenPerl Tutorial for more information.
32  
33 =head1 DESCRIPTION
34  
35 TissueSample objects represent the laboratory tissue samples.
36  
37 =head1 LICENSE
38  
39 This program is free software; you can redistribute it and/or modify
40 it under the terms of the GNU General Public License as published by
41 the Free Software Foundation; either version 2 of the License, or
42 (at your option) any later version.
43  
44 This program is distributed in the hope that it will be useful,
45 but WITHOUT ANY WARRANTY; without even the implied warranty of
46 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 GNU General Public License for more details.
48  
49 You should have received a copy of the GNU General Public License
50 along with this program; if not, write to the Free Software
51 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
52  
53 =head1 FEEDBACK
54  
55 Currently, all feedback should be sent directly to the author.
56  
57 =head1 AUTHOR - Steve Mathias
58  
59 Email: mathias@genomica.com
60  
61 Phone: (720) 565-4029
62  
63 Address: Genomica Corporation
64 1745 38th Street
65 Boulder, CO 80301
66  
67 =head1 DETAILS
68  
69 The rest of the documentation describes each of the object variables and
70 methods. The names of internal variables and methods are preceded with an
71 underscore (_).
72  
73 =cut
74  
75 ##################
76 # #
77 # Begin the code #
78 # #
79 ##################
80  
81 package Genetics::TissueSample ;
82  
83 BEGIN {
84 $ID = "Genetics::TissueSample" ;
85 #$DEBUG = $main::DEBUG ;
86 $DEBUG = 0 ;
87 $DEBUG and warn "Debugging in $ID is on" ;
88 }
89  
90 =head1 Imported Packages
91  
92 Genetics::Object Superclass
93 strict Just to be anal
94 vars Global variables
95  
96 =cut
97  
98 use Genetics::Object ;
99 use strict ;
100 use vars qw(@ISA $ID $DEBUG @ATTRS @REQD_ATTRS %DEFAULTS) ;
101  
102 require 5.004 ;
103  
104 @ISA = qw(Genetics::Object) ;
105  
106 @ATTRS = qw(tissue dateCollected amount amountUnits
107 Subject Genotypes DNASamples) ;
108  
109 @REQD_ATTRS = qw(tissue) ;
110  
111 %DEFAULTS = () ;
112  
113  
114 =head1 Public methods
115  
116 printXML Write an XML representation of the object
117  
118 =cut
119  
120 =head2 printXML
121  
122 Function : Write an XML representation of the object according to GnomML.dtd.
123 Argument : A XML::Writer object that will be used to generate the XML.
124 Returns : String
125 Scope : Public
126 Comments : Calls Genetics::Object->writeGeneralXML to generate XML elements
127 common to all Genetics::Object objects.
128  
129 =cut
130  
131 sub printXML {
132 my($self, $writer) = @_ ;
133 my($class, $field) ;
134  
135 $class = ref $self ;
136 $class =~ s/.*::// ;
137
138 ## Common Attributes/Elements
139 $self->printGeneralXML($writer) ;
140
141 $writer->startTag('XX') ;
142 $writer->dataElement('Name', "ZZ") ;
143 $writer->endTag('XX') ;
144  
145 $writer->endTag($class) ;
146  
147 return(1) ;
148 }
149  
150 1;
151