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