.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "MAGE::XML::Reader 3pm" .TH MAGE::XML::Reader 3pm "2020-12-01" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::MAGE::XML::Reader \- a module for exporting MAGE\-ML .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Bio::MAGE::XML::Reader; \& \& my $reader = Bio::MAGE::XML::Reader\->new(handler=>$handler, \& sax1=>$sax1, \& verbose=>$verbose, \& log_file=>\e*STDERR, \& ); \& \& # set the sax1 attribute \& $reader\->sax1($bool); \& \& # get the current value \& $value = $reader\->sax1(); \& \& # set the content/document handler \- this method is provided for completeness \& # the value should be set in the call to the constructor to be effective \& $reader\->handler($HANDLER); \& \& # get the current handler \& $handler = $reader\->handler(); \& \& # set the attribute \& $reader\->verbose($integer); \& \& # get the current value \& $value = $reader\->verbose(); \& \& # set the attribute \& $reader\->log_file($filename); \& \& # get the current value \& $value = $reader\->log_file(); \& \& # whether to read data cubes externally (default == FALSE) \& $writer\->external_data($bool); \& \& my $fh = \e*STDOUT; \& my $mage = $reader\->read($file_name); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Methods for transforming information from a MAGE-OM objects into MAGE-ML. .SS "\s-1ATTRIBUTE METHODS\s0" .IX Subsection "ATTRIBUTE METHODS" These methods have a polymorphic setter/getter method that sets an attribute which affects the parsing of MAGE-ML. If given a value, the method will save the value to the attribute, if invoked with no argument it will return the current value of the attribute. .PP These attributes can all be set in the call to the constructor using the named parameter style. .IP "sax1" 4 .IX Item "sax1" This attribute determines whether a \s-1SAX1\s0 parser and DocumentHandler or a SAX2XMLReader and a ContentHandler will be used for parsing. The default is to use a \s-1SAX2\s0 parser. .IP "handler" 4 .IX Item "handler" If an application needs a custom handler it can set this attribute in the call to the constructor. It is advised that the object use inherit either from Bio::MAGE::XML::Handler::ContentHandler (if using \s-1SAX2\s0) or Bio::MAGE::DocumentHandler if using \s-1SAX1.\s0 In particular, whatever class is used, it needs to implement the following methods: .RS 4 .IP "\(bu" 4 verbose .Sp called with the integer parameter that specifies the desired level of output .IP "\(bu" 4 log_file .Sp called with the file handle to which output should be sent .IP "\(bu" 4 init .Sp called during the constructor for any needed work .RE .RS 4 .RE .SS "parser" .IX Subsection "parser" .Vb 6 \& Title : parser \& Usage : $obj\->parser($newval) \& Function: \& Example : \& Returns : value of parser (a scalar) \& Args : on set, new value (a scalar or undef, optional) .Ve .IP "verbose" 4 .IX Item "verbose" This attribute determines the desired level of output during the parse. The default is no output. A positive value increases the amount of information. .IP "log_file" 4 .IX Item "log_file" This attribute specifies a file handle to which parse output will be directed. It is only needed if verbose is positive. .IP "external_data($bool)" 4 .IX Item "external_data($bool)" If defined, this will cause all BioAssayData objects to read themselves out using the DataExternal format. .Sp \&\fBDefault Value:\fR false .IP "resolve_identifiers" 4 .IX Item "resolve_identifiers" This attribute specifies whether the reader should attempt to track unhandled identifiers in the document, and then resolve them when parsing is over. This can be a huge performance hit if you know that all identifiers wil not resolve. .Sp \&\fBDefault Value:\fR false .SS "\s-1INSTANCE METHODS\s0" .IX Subsection "INSTANCE METHODS" .ie n .IP "$self\->read($file_name)" 4 .el .IP "\f(CW$self\fR\->read($file_name)" 4 .IX Item "$self->read($file_name)" This method will open the MAGE-ML file specified by \f(CW$file_name\fR and if the \f(CW\*(C`handler\*(C'\fR attribute is not set, it will create either a \s-1SAX2\s0 parser or a \s-1SAX1\s0 parser (depending on the value of the C attribute) and parse the file. .Sp \&\f(CW\*(C`read()\*(C'\fR can read from \s-1STDIN\s0 by specifying '\-' as the filename. This enables you to handle compressed \s-1XML\s0 files: .Sp .Vb 1 \& gzip \-dc file.xml.gz | read.pl [options] .Ve .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 172:" 4 .IX Item "Around line 172:" You forgot a '=back' before '=head2' .IP "Around line 190:" 4 .IX Item "Around line 190:" \&'=item' outside of any '=over'