.\" 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::Writer 3pm" .TH MAGE::XML::Writer 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::Writer \- a module for exporting MAGE\-ML .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Bio::MAGE::XMLUtils; \& \& my $writer = Bio::MAGE::XML::Writer\->new(@args); \& $writer\->write($mage); \& \& # \& # attributes to modify where the output is written \& # \& \& # set the output filehandle \& my $fh = \e*STDOUT; \& $writer\->fh($fh); \& \& # whether to write data cubes externally (default == FALSE) \& $writer\->external_data($bool); \& \& # which directory to write external data cubes (default == /tmp) \& $writer\->external_data_dir($path); \& \& # whether the to interpret the C as data or a file \& # path (default == FALSE) \& $writer\->cube_holds_path($bool); \& \& # \& # attributes to modify the output format \& # \& \& # which format is the external data file \& $writer\->data_format($dataformat); \& \& # to change the level of indent for each new tag (defaul == 2) \& $writer\->indent_increment($num); \& \& # to change the beginning indent level (defaul == 0) \& $writer\->indent_level($num); \& \& # set to true to not format attributes (default == FALSE) \& $writer\->attrs_on_one_line($bool); \& \& # how many extra spaces attributes should be indented past start \& # tag end (default == 1) \& $writer\->attr_indent($num); \& \& # whether to write all sub\-tags on the same line (default == undef) \& $writer\->collapse_tag($bool); \& \& # \& # attributes to modify the the document \& # \& \& # to change the encoding (default == ISO\-8859\-1) \& $writer\->encoding($format); \& \& # to set the public id (default == undef) \& $writer\->public_id($id); \& \& # to change the system id (default == MAGE\-ML.dtd) \& $writer\->system_id($id); \& \& # check to see that objects set more than just identifier (default == TRUE) \& $writer\->empty_identifiable_check(); \& \& # \& # attributes to handle identifiers \& # \& \& # whether to create identifiers if not specified (default == FALSE) \& $writer\->generate_new_identifiers(); \& \& # code reference to be invoked for creating new identifiers \& $writer\->generate_identifier(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Methods for transforming information from a MAGE-OM objects into MAGE-ML. .SH "METHODS" .IX Header "METHODS" .IP "write($MAGE_object);" 4 .IX Item "write($MAGE_object);" \&\f(CW\*(C`write()\*(C'\fR prints the objects contained in \f(CW$MAGE_object\fR as MAGE-ML to the file handle used by the writer. .SH "ATTRIBUTE METHODS" .IX Header "ATTRIBUTE METHODS" .Vb 1 \& The following methods must all be invoked using an instance of Bio::MAGE::XML::Writer; .Ve .IP "indent_level($num)" 4 .IX Item "indent_level($num)" This attribute controls the current level of indentation while writing a document. It should not be manipulated by users, unless for some reason you wanted to set the starting indent level to something other than zero. .Sp \&\fBDefault Value:\fR 0 (zero) .IP "indent_increment($num)" 4 .IX Item "indent_increment($num)" This attribute controls the the number of spaces that added to the indent for every new level of elements. .Sp \&\fBDefault Value:\fR 2 .IP "attrs_on_one_line($bool)" 4 .IX Item "attrs_on_one_line($bool)" This attribute controls whether attribute values should be pretty-printed. If true, attributes will not pretty-printed, but will instead be written out all on one line. .Sp \&\fBDefault Value:\fR false .IP "attr_indent($bool)" 4 .IX Item "attr_indent($bool)" Controls how many spaces past the end start tag that attributes should be indented. This example shows an \f(CW\*(C`attr_inden\*(C'\fR of 1: .Sp .Vb 2 \& .Ve .Sp The following illustrates and \f(CW\*(C`attr_indent\*(C'\fR of \-2: .Sp .Vb 4 \& .Ve .Sp \&\fBDefault Value:\fR 1 .IP "collapse_tag($bool)" 4 .IX Item "collapse_tag($bool)" This attribute is not very useful at the moment. In the future it may be used to specify tags that should have their contents all on a single line. .Sp Currently it controls whether or not to write a newline after each elements start tag, with no method to decide to write or not to write based on the name of the tag. .Sp \&\fBDefault Value:\fR false .IP "encoding($string)" 4 .IX Item "encoding($string)" This is the value that value be written out as the encoding attribute for the \s-1XML\s0 Declaration of the output MAGE-ML document: .Sp .Vb 1 \& .Ve .Sp \&\fBDefault Value:\fR \s-1ISO\-8859\-1\s0 .IP "public)_id($string)" 4 .IX Item "public)_id($string)" If defined, this value will be written out as the value of the \s-1PUBLIC\s0 attribute of the \s-1DOCTYPE\s0 tag in the output MAGE-ML document. .Sp \&\fBDefault Value:\fR undef .IP "system_id($string)" 4 .IX Item "system_id($string)" If defined, this value will be written out as the value of the \s-1SYSTEM\s0 attribute of the \s-1DOCTYPE\s0 tag in the output MAGE-ML document: .Sp .Vb 1 \& .Ve .Sp \&\fBDefault Value:\fR \s-1MAGE\-ML\s0.dtd .IP "generate_identifier($code_ref)" 4 .IX Item "generate_identifier($code_ref)" This attribute stores a code reference that will be invoked to create a new identifier for any object that does not already have one defined. This will happen only if the \f(CW\*(C`generate_new_identifiers\*(C'\fR attribute is set to true. .Sp \&\fBDefault Value:\fR \e&identifier_generation .IP "generate_new_identifier($bool)" 4 .IX Item "generate_new_identifier($bool)" If this attribute is set to true, the code reference store in the \&\f(CW\*(C`generate_identifier\*(C'\fR attribute will be invoked to create a new identifier for any object that does not already have one defined. .Sp \&\fBDefault Value:\fR false .IP "fh($file_handle)" 4 .IX Item "fh($file_handle)" This is the file handle to which the MAGE-ML document will be written. .Sp \&\fBDefault Value:\fR undef .IP "external_data($bool)" 4 .IX Item "external_data($bool)" If defined, this will cause all BioAssayData objects to write themselves out using the DataExternal format. .Sp \&\fBDefault Value:\fR false .IP "data_format($format)" 4 .IX Item "data_format($format)" \&\f(CW$format\fR is either 'tab delimited' or 'space delimited' .Sp \&\fBDefault Value:\fR 'tab delimited' .IP "external_data_dir($path)" 4 .IX Item "external_data_dir($path)" The \f(CW\*(C`fh\*(C'\fR attribute only controls where the main MAGE-ML document is written. If the \f(CW\*(C`external_data\*(C'\fR attribute is set, the writer will also create a separate external data file for each data cube. .Sp The \f(CW\*(C`external_data_dir\*(C'\fR controls what director those files are written to. .Sp \&\fBDefault Value:\fR /tmp .IP "cube_holds_path($path)" 4 .IX Item "cube_holds_path($path)" Sometimes, you already have your data written to an external file, and you simply want to reuse the file without any extra overhead. The \&\f(CW\*(C`cube_holds_path\*(C'\fR attribute controls indicates that you are storing the path to the external file in the \f(CW\*(C`cube\*(C'\fR attribute of the \&\f(CW\*(C`BioDataCube\*(C'\fR objects. .Sp \&\fBDefault Value:\fR false .IP "empty_identifiable_check($bool)" 4 .IX Item "empty_identifiable_check($bool)" If true, all objects that define an \f(CW\*(C`identifier\*(C'\fR attribute and no other attributes will only be included as <*_ref> elements. .Sp \&\fB\s-1NOTE:\s0\fR Currently no checking of association values is made, only attributes. So if you want to ensure that an Identifiable object is written, make sure that you set the \f(CW\*(C`name\*(C'\fR attribute as well as the \&\f(CW\*(C`identifier\*(C'\fR attribute. .Sp \&\fBDefault Value:\fR true .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 147:" 4 .IX Item "Around line 147:" \&'=item' outside of any '=over' .IP "Around line 656:" 4 .IX Item "Around line 656:" You forgot a '=back' before '=head1' .IP "Around line 660:" 4 .IX Item "Around line 660:" =over without closing =back