.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .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. | will give a .\" real vertical bar. \*(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-|\(bv\*(Tr .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" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Bio::ASN1::EntrezGene 3" .TH Bio::ASN1::EntrezGene 3 "2005-05-04" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Bio::ASN1::EntrezGene \- Regular expression\-based Perl Parser for NCBI Entrez Gene. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Bio::ASN1::EntrezGene; .Ve .PP .Vb 5 \& my $parser = Bio::ASN1::EntrezGene->new('file' => "Homo_sapiens"); \& while(my $result = $parser->next_seq) \& { \& # extract data from $result, or Dumpvalue->new->dumpValue($result); \& } .Ve .PP .Vb 10 \& # a new way to get the $result data hash for a particular gene id: \& use Bio::ASN1::EntrezGene::Indexer; \& my $inx = Bio::ASN1::EntrezGene::Indexer->new(-filename => 'entrezgene.idx'); \& my $seq = $inx->fetch_hash(10); # returns $result for Entrez Gene record \& # with geneid 10 \& # note that the index file 'entrezgene.idx' can be created as follows \& my $inx = Bio::ASN1::EntrezGene::Indexer->new( \& -filename => 'entrezgene.idx', \& -write_flag => 'WRITE'); \& $inx->make_index('Homo_sapiens', 'Mus_musculus'); # files come from NCBI download .Ve .PP .Vb 1 \& # for more detail please refer to Bio::ASN1::EntrezGene::Indexer perldoc .Ve .SH "PREREQUISITE" .IX Header "PREREQUISITE" None. .SH "INSTALLATION" .IX Header "INSTALLATION" Bio::ASN1::EntrezGene package can be installed & tested as follows: .PP .Vb 4 \& perl Makefile.PL \& make \& make test \& make install .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Bio::ASN1::EntrezGene is a regular expression-based Perl Parser for \s-1NCBI\s0 Entrez Gene genome databases (). It parses an \s-1ASN\s0.1\-formatted Entrez Gene record and returns a data structure that contains all data items from the gene record. .PP The parser will report error & line number if input data does not conform to the \&\s-1NCBI\s0 Entrez Gene genome annotation file format. .PP Note that it is possible to provide reading of all \s-1NCBI\s0's \s-1ASN\s0.1\-formatted files through simple variations of the Entrez Gene parser (I need more investigation to be sure, but at least the sequence parser is a very simple variation on Entrez Gene parser and works well). .PP It took the parser version 1.0 11 minutes to parse the human genome Entrez Gene file on one 2.4 GHz Intel Xeon processor. The addition of validation and error reporting in 1.03 and handling of new Entrez Gene format slowed the parser down about 40%. .PP Since V1.07, this package also included an indexer that runs pretty fast (it takes 21 seconds for the indexer to index the human genome on the same processor). Therefore the combination of the modules would allow user to retrieve and parse arbitrary records. .SH "SEE ALSO" .IX Header "SEE ALSO" The parse_entrez_gene_example.pl script included in this package (please see the Bio\-ASN1\-EntrezGene\-x.xx/examples directory) is a very important and near-complete demo on using this module to extract all data items from Entrez Gene records. Do check it out because in fact, this script took me about 3\-4 times more time to make for my project than the parser V1.0 itself. Note that the example script was edited to leave out stuff specific to my internal project. .PP For details on various parsers I generated for Entrez Gene, example scripts that uses/benchmarks the modules, please see . Those other parsers etc. are included in V1.05 download. .SH "AUTHOR" .IX Header "AUTHOR" Dr. Mingyi Liu .SH "COPYRIGHT" .IX Header "COPYRIGHT" The Bio::ASN1::EntrezGene module and its related modules and scripts are copyright (c) 2005 Mingyi Liu, \s-1GPC\s0 Biotech \s-1AG\s0 and Altana Research Institute. All rights reserved. I created these modules when working on a collaboration project between these two companies. Therefore a special thanks for the two companies to allow the release of the code into public domain. .PP You may use and distribute them under the terms of the Perl itself or \&\s-1GPL\s0 (). .SH "CITATION" .IX Header "CITATION" Liu, M and Grigoriev, A (2005) \*(L"Fast Parsers for Entrez Gene\*(R" Bioinformatics. In press .SH "OPERATION SYSTEMS SUPPORTED" .IX Header "OPERATION SYSTEMS SUPPORTED" Any \s-1OS\s0 that Perl runs on. .SH "METHODS" .IX Header "METHODS" .Sh "new" .IX Subsection "new" .Vb 12 \& Parameters: maxerrstr => 20 (optional) - maximum number of characters after \& offending element, used by error reporting, default is 20 \& file or -file => $filename (optional) - name of the file to be \& parsed. call next_seq to parse! \& fh or -fh => $filehandle (optional) - handle of the file to be \& parsed. \& Example: my $parser = Bio::ASN1::EntrezGene->new(); \& Function: Instantiate a parser object \& Returns: Object reference \& Notes: Setting file or fh will reset line numbers etc. that are used \& for error reporting purposes, and seeking on file handle would \& mess up linenumbers! .Ve .Sh "maxerrstr" .IX Subsection "maxerrstr" .Vb 6 \& Parameters: $maxerrstr (optional) - maximum number of characters after \& offending element, used by error reporting, default is 20 \& Example: $parser->maxerrstr(20); \& Function: get/set maxerrstr. \& Returns: maxerrstr. \& Notes: .Ve .Sh "parse" .IX Subsection "parse" .Vb 18 \& Parameters: $string that contains Entrez Gene record, \& $trimopt (optional) that specifies how the data structure \& returned should be trimmed. 2 is recommended and \& default \& $noreset (optional) that species that line number should not \& be reset \& DEPRECATED as external function!!! Do not call this function \& directly! Call next_seq() instead \& Example: my $value = $parser->parse($text); # DEPRECATED as \& # external function!!! Do not call this function \& # directly! Call next_seq() instead \& Function: Takes in a string representing Entrez Gene record, parses \& the record and returns a data structure. \& Returns: A data structure containing all data items from the Entrez \& Gene record. \& Notes: DEPRECATED as external function!!! Do not call this function \& directly! Call next_seq() instead \& $string should not contain 'EntrezGene ::=' at beginning! .Ve .Sh "input_file" .IX Subsection "input_file" .Vb 9 \& Parameters: $filename for file that contains Entrez Gene record(s) \& Example: $parser->input_file($filename); \& Function: Takes in name of a file containing Entrez Gene records. \& opens the file and stores file handle \& Returns: none. \& Notes: Attemps to open file larger than 2 GB even on Perl that \& does not support 2 GB file (accomplished by calling \& "cat" and piping output. On OS that does not have "cat" \& error message will be displayed) .Ve .Sh "next_seq" .IX Subsection "next_seq" .Vb 17 \& Parameters: $trimopt (optional) that specifies how the data structure \& returned should be trimmed. option 2 is recommended and \& default \& Example: my $value = $parser->next_seq(); \& Function: Use the file handle generated by input_file, parses the next \& the record and returns a data structure. \& Returns: A data structure containing all data items from the Entrez \& Gene record. \& Notes: Must pass in a filename through new() or input_file() first! \& For details on how to use the $trimopt data trimming option \& please see comment for the trimdata method. An option \& of 2 is recommended and default \& The acceptable values for $trimopt include: \& 1 - trim as much as possibile \& 2 (or 0, undef) - trim to an easy-to-use structure \& 3 - no trimming (in version 1.06, prior to version \& 1.06, 0 or undef means no trimming) .Ve .Sh "trimdata" .IX Subsection "trimdata" .Vb 15 \& Parameters: $hashref or $arrayref \& $trimflag (optional, see Notes) \& Example: trimdata($datahash); # using the default flag \& Function: recursively process all attributes of a hash/array \& hybrid and get rid of any arrayref that points to \& one-element arrays (trims data structure) depending on \& the optional flag. \& Returns: none - trimming happenes in-place \& Notes: This function is useful to compact a data structure produced by \& Bio::ASN1::EntrezGene::parse. \& The acceptable values for $trimopt include: \& 1 - trim as much as possibile \& 2 (or 0, undef) - trim to an easy-to-use structure \& 3 - no trimming (in version 1.06, prior to version \& 1.06, 0 or undef means no trimming) .Ve .Sh "fh" .IX Subsection "fh" .Vb 7 \& Parameters: $filehandle (optional) \& Example: trimdata($datahash); # using the default flag \& Function: getter/setter for file handle \& Returns: file handle for current file being parsed. \& Notes: Use with care! \& Line number report would not be corresponding to file's line \& number if seek operation is performed on the file handle! .Ve .Sh "rawdata" .IX Subsection "rawdata" .Vb 8 \& Parameters: none \& Example: my $data = $parser->rawdata(); \& Function: Get the entrez gene data file that was just parsed \& Returns: a string containing the ASN1-formatted Entrez Gene record \& Notes: Must first parse a record then call this function! \& Could be useful in interpreting line number value in error \& report (if user did a seek on file handle right before parsing \& call) .Ve