Bio-DB-BioFetch-1.7.3000755001750001750 013433043563 14064 5ustar00cdieshcdiesh000000000000Changes100644001750001750 77313433043563 15427 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3Summary of important user-visible changes for Bio-DB-BioFetch ------------------------------------------------------------- 1.7.3 2019-02-19 13:14:08-05:00 America/Detroit * First release after split from bioperl-live. * The default baseaddress was changed to use the https protocol. The EBI servers were already redirecting it to https anyway. * 'refseq' is no longer a valid database for dbfetch requests. Use 'refseqn' (RefSeq nucleotide) or 'refseqp' (RefSeq protein) instead. LICENSE100644001750001750 4374613433043563 15210 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3This software is copyright (c) 2019 by Lincoln Stein . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2019 by Lincoln Stein . This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2019 by Lincoln Stein . This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End dist.ini100644001750001750 41613433043563 15572 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3name = Bio-DB-BioFetch version = 1.7.3 author = Lincoln Stein copyright_holder = Lincoln Stein license = Perl_5 ;; Modules should be fixed so that these don't have to be removed. [@BioPerl] -remove = PodWeaver -remove = Test::NoTabs META.yml100644001750001750 1664013433043563 15445 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3--- abstract: 'Database object interface to BioFetch retrieval' author: - 'Lincoln Stein ' build_requires: Data::Stag: '0' File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::Exception: '0' Test::More: '0' Test::RequiresInternet: '0' Test::Warn: '0' perl: '5.006' warnings: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Bio-DB-BioFetch requires: Bio::DB::WebDBSeqI: '0' Bio::Root::Root: '0' Carp: '0' HTTP::Request::Common: '0' base: '0' constant: '0' strict: '0' vars: '0' resources: bugtracker: https://github.com/bioperl/bio-db-biofetch/issues homepage: https://metacpan.org/release/Bio-DB-BioFetch repository: git://github.com/bioperl/bio-db-biofetch.git version: 1.7.3 x_Dist_Zilla: perl: version: '5.022001' plugins: - class: Dist::Zilla::Plugin::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . name: '@BioPerl/@Filter/GatherDir' version: '6.012' - class: Dist::Zilla::Plugin::PruneCruft name: '@BioPerl/@Filter/PruneCruft' version: '6.012' - class: Dist::Zilla::Plugin::ManifestSkip name: '@BioPerl/@Filter/ManifestSkip' version: '6.012' - class: Dist::Zilla::Plugin::MetaYAML name: '@BioPerl/@Filter/MetaYAML' version: '6.012' - class: Dist::Zilla::Plugin::License name: '@BioPerl/@Filter/License' version: '6.012' - class: Dist::Zilla::Plugin::ExtraTests name: '@BioPerl/@Filter/ExtraTests' version: '6.012' - class: Dist::Zilla::Plugin::ExecDir name: '@BioPerl/@Filter/ExecDir' version: '6.012' - class: Dist::Zilla::Plugin::ShareDir name: '@BioPerl/@Filter/ShareDir' version: '6.012' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@BioPerl/@Filter/MakeMaker' version: '6.012' - class: Dist::Zilla::Plugin::Manifest name: '@BioPerl/@Filter/Manifest' version: '6.012' - class: Dist::Zilla::Plugin::TestRelease name: '@BioPerl/@Filter/TestRelease' version: '6.012' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@BioPerl/@Filter/ConfirmRelease' version: '6.012' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@BioPerl/@Filter/UploadToCPAN' version: '6.012' - class: Dist::Zilla::Plugin::MetaConfig name: '@BioPerl/MetaConfig' version: '6.012' - class: Dist::Zilla::Plugin::MetaJSON name: '@BioPerl/MetaJSON' version: '6.012' - class: Dist::Zilla::Plugin::PkgVersion name: '@BioPerl/PkgVersion' version: '6.012' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@BioPerl/PodSyntaxTests' version: '6.012' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 0 filename: t/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: test script_finder: - ':PerlExecFiles' skips: [] switch: [] name: '@BioPerl/Test::Compile' version: '2.058' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@BioPerl/PodCoverageTests' version: '6.012' - class: Dist::Zilla::Plugin::MojibakeTests name: '@BioPerl/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@BioPerl/AutoPrereqs' version: '6.012' - class: Dist::Zilla::Plugin::AutoMetaResources name: '@BioPerl/AutoMetaResources' version: '1.21' - class: Dist::Zilla::Plugin::MetaResources name: '@BioPerl/MetaResources' version: '6.012' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':ExecFiles' - ':InstallModules' - ':TestFiles' trailing_whitespace: 1 name: '@BioPerl/Test::EOL' version: '0.19' - class: Dist::Zilla::Plugin::Encoding name: '@BioPerl/Encoding' version: '6.012' - class: Dist::Zilla::Plugin::NextRelease name: '@BioPerl/NextRelease' version: '6.012' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.7.4 repo_root: . name: '@BioPerl/Git::Check' version: '2.045' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%v%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.7.4 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@BioPerl/Git::Commit' version: '2.045' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: Bio-DB-BioFetch-v1.7.3 tag_format: '%N-v%v' tag_message: '%N-v%v' Dist::Zilla::Role::Git::Repo: git_version: 2.7.4 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@BioPerl/Git::Tag' version: '2.045' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.012' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.012' x_generated_by_perl: v5.22.1 x_serialization_backend: 'YAML::Tiny version 1.69' MANIFEST100644001750001750 44113433043563 15255 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. Changes LICENSE MANIFEST META.json META.yml Makefile.PL dist.ini eg/dbfetch lib/Bio/DB/BioFetch.pm t/00-compile.t t/BioFetch.t t/author-eol.t t/author-mojibake.t t/author-pod-coverage.t t/author-pod-syntax.t META.json100644001750001750 2735713433043563 15624 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3{ "abstract" : "Database object interface to BioFetch retrieval", "author" : [ "Lincoln Stein " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Bio-DB-BioFetch", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::EOL" : "0", "Test::Mojibake" : "0", "Test::More" : "0.88", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "runtime" : { "requires" : { "Bio::DB::WebDBSeqI" : "0", "Bio::Root::Root" : "0", "Carp" : "0", "HTTP::Request::Common" : "0", "base" : "0", "constant" : "0", "strict" : "0", "vars" : "0" } }, "test" : { "requires" : { "Data::Stag" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::Exception" : "0", "Test::More" : "0", "Test::RequiresInternet" : "0", "Test::Warn" : "0", "perl" : "5.006", "warnings" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bioperl-l@bioperl.org", "web" : "https://github.com/bioperl/bio-db-biofetch/issues" }, "homepage" : "https://metacpan.org/release/Bio-DB-BioFetch", "repository" : { "type" : "git", "url" : "git://github.com/bioperl/bio-db-biofetch.git", "web" : "https://github.com/bioperl/bio-db-biofetch" } }, "version" : "1.7.3", "x_Dist_Zilla" : { "perl" : { "version" : "5.022001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." } }, "name" : "@BioPerl/@Filter/GatherDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@BioPerl/@Filter/PruneCruft", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@BioPerl/@Filter/ManifestSkip", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@BioPerl/@Filter/MetaYAML", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@BioPerl/@Filter/License", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@BioPerl/@Filter/ExtraTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@BioPerl/@Filter/ExecDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@BioPerl/@Filter/ShareDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@BioPerl/@Filter/MakeMaker", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@BioPerl/@Filter/Manifest", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@BioPerl/@Filter/TestRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@BioPerl/@Filter/ConfirmRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@BioPerl/@Filter/UploadToCPAN", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@BioPerl/MetaConfig", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@BioPerl/MetaJSON", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@BioPerl/PkgVersion", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@BioPerl/PodSyntaxTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : "0", "fail_on_warning" : "author", "fake_home" : 0, "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "test", "script_finder" : [ ":PerlExecFiles" ], "skips" : [], "switch" : [] } }, "name" : "@BioPerl/Test::Compile", "version" : "2.058" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@BioPerl/PodCoverageTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@BioPerl/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@BioPerl/AutoPrereqs", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@BioPerl/AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@BioPerl/MetaResources", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":ExecFiles", ":InstallModules", ":TestFiles" ], "trailing_whitespace" : 1 } }, "name" : "@BioPerl/Test::EOL", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::Encoding", "name" : "@BioPerl/Encoding", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@BioPerl/NextRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.7.4", "repo_root" : "." } }, "name" : "@BioPerl/Git::Check", "version" : "2.045" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%v%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.7.4", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@BioPerl/Git::Commit", "version" : "2.045" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "Bio-DB-BioFetch-v1.7.3", "tag_format" : "%N-v%v", "tag_message" : "%N-v%v" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.7.4", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@BioPerl/Git::Tag", "version" : "2.045" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.012" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "6.012" } }, "x_generated_by_perl" : "v5.22.1", "x_serialization_backend" : "Cpanel::JSON::XS version 4.09" } eg000755001750001750 013433043563 14400 5ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3dbfetch100644001750001750 4437413433043563 16116 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3/eg#!/usr/local/bin/perl -- # -*-Perl-*- =head1 NAME dbfetch - generic CGI program to retrieve biological database entries in various formats and styles (using SRS) =head1 SYNOPSIS # URL examples: # prints the interactive page with the HTML form http://www.ebi.ac.uk/Tools/dbfetch/dbfetch # for backward compatibility, implements # single entry queries defaulting to EMBL sequence database http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?J00231 # retrieves one or more entries in default format # and default style (html) # returns nothing for IDs which are not valid http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?id=J00231.1,hsfos,bum # retrieve entries in fasta format without html tags http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?format=fasta&style=raw&id=J00231,hsfos,bum # retrieve a raw Ensembl entry http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?db=ensembl&style=raw&id=AL122059 =head1 DESCRIPTION This program generates a page allowing a web user to retrieve database entries from a local SRS in two styles: html and raw. Other database engines can be used to implement te same interfase. At this stage, on unique identifier queries are supported. Free text searches returning more than one entry per query term are not in these specs. In its default setup, type one or more EMBL accession numbers (e.g. J00231), entry name (e.g. HSFOS) or sequence version into the seach dialog to retieve hypertext linked enties. Note that for practical reasons only the first 50 identifiers submitted are processed. Additional input is needed to change the sequence format or suppress the HTML tags. The styles are html and raw. In future there might be additional styles (e.g. xml). Currently XML is a 'raw' format used by Medline. Each style is implemented as a separate subroutine. =head1 MAINTANENCE A new database can be added simply by adding a new entry in the global hash %IDS. Additionally, if the database defines new formats add an entry for each of them into the hash %IDMATCH. After modifying the hash, run this script from command line for some sanity checks with parameter debug set to true (e.g. dbfetch debug=1 ). Finally, the user interface needs to be updated in the L subroutine. =head1 VERSIONS Version 3 uses EBI SRS server 6.1.3. That server is able to merge release and update libraries automatically which makes this script simpler. The other significant change is the way sequence versions are indexed. They used to be indexed together with the string accession (e.g. 'J00231.1'). Now they are indexed as integers (e.g. '1'). Version 3.1 changes the command line interface. To get the debug information use attribute 'debug' set to true. Also, it uses File::Temp module to create temporary files securely. Version 3.2 fixes fasta format parsing to get the entry id. Version 3.3. Adds RefSeq to the database list. Version 3.4. Make this compliant to BioFetch specs. =head1 AUTHOR - Heikki Lehvaslaiho Email: heikki-at-bioperl-dot-org =cut # Let the code begin... $VERSION = '3.4'; $DATE = '28 Jan 2002'; use CGI "standard"; #use POSIX; use CGI::Carp qw/ fatalsToBrowser /; use File::Temp qw/ tempfile tempdir /; use strict; no strict "refs"; use constant MAXIDS => 50; use constant TMPDIR => '/usr/tmp'; use vars qw( $VERSION $DATE %DBS %STYLES $RWGETZ $RGETZ %IDMATCH %IDLIST $XEMBL $FH ); BEGIN { # paths to SRS binaries $RWGETZ = '/ebi/srs/srs/bin/osf_5/wgetz -e'; $RGETZ = '/ebi/srs/srs/bin/osf_5/getz -e'; $XEMBL = "cd /ebi/www/pages/cgi-bin/xembl/; ./XEMBL.pl"; #$EMBOSSDIR = '/ebi/services/pkgs/emboss/bin'; # RE matching the unique ID in the db entry # - key is the # - put the id string in parenthesis %IDMATCH = ( # 123 embl => 'ID (\w+)', fasta => '>\w+.(\w+)', medlinefull => '[\n><]MedlineID. ?(\w+)', swissprot => 'ID (\w+)', pdb => '.{62}(\w+)', bsml => 'DUMMY', agave => 'DUMMY', refseq => 'LOCUS ([\w_]+)' ); %DBS = ( embl => { fields => ['id', 'acc'], version => 'sv', # name of the SRS field format => { default => 'embl', embl => 1, fasta => 'FastaSeqs', bsml => 1, agave => 1 } }, medline => { fields => ['id'], format => { default => 'medlinefull', # medlineref => 'MedlineRef', medlinefull => 'MedlineFull' } }, ensembl => { fields => ['id'], format => { default => 'embl', embl => 1, fasta => 'FastaSeqs' } }, swall => { fields => ['id', 'acc'], format => { default => 'swissprot', swissprot => 1, fasta => 'FastaSeqs' } }, pdb => { fields => ['id'], format => { default => 'pdb', pdb => '1' } }, refseq => { fields => ['id', 'acc'], format => { default => 'refseq', refseq => 1, fasta => 'FastaSeqs' } } #add more databases here... ); %STYLES = ( html => 1, raw => 1 ); %IDLIST = (); #redundancy check list built during the execution } my $q = new CGI; # sanity checks if the script is running from command line # and debug parameter is set. my $debug = protect($q->param('debug')) if $q->param('debug'); &debugging if not $q->user_agent and $debug; if ( $q->param('id') or $q->param('keywords') ) { # pacify input strings my $value; $value = protect($q->param('id')) if $q->param('id'); $value = protect($q->param('keywords')) if $q->param('keywords'); my $db = lc protect($q->param('db')); # let's keep the case lower my $format = lc protect($q->param('format')); my $style = lc protect($q->param('style')); # check input and set defaults $style ||= 'html'; # default style input_error($q, $style, "2 Unknown style [$style].") unless $STYLES{$style}; $db ||= 'embl'; # default db input_error($q, $style, "1 Unknown database [$db].") unless $DBS{$db}; $format ||= $DBS{$db}{format}{default}; # default format input_error($q, $style, "3 Format [$format] not known for database [$db]") unless $DBS{$db}{format}{$format}; $format = $DBS{$db}{format}{default} if $format eq 'default'; # If people choose Bsml or AGAVE, DB can only be 'embl' input_error($q, $style, "1 Unknown database [$db].") if ($format eq 'bsml' or $format eq 'agave') and $db ne 'embl'; # If people choose Bsml or AGAVE, internal style has to be xml . Make it so. $style = ($format =~ /(bsml|agave)/i) ? 'xml' : $style; if ($style eq 'html') { print $q->header(-type => 'text/html', -charset => 'UTF-8'); } elsif ($style eq 'raw') { print "Content-Type: text/plain; charset=UTF-8\n\n"; } $FH = tempfile('dbfetchXXXXXX', DIR => TMPDIR, UNLINK => 1 ); #automatic unlinking # Check the number of IDs my @ids = split (/ /, $value); input_error($q, $style, "6 Too many IDs [". scalar @ids. "]. Max [". MAXIDS. "] allowed.") if scalar @ids > MAXIDS; # XEMBL cannot 'glue' single entries due to XML setup #- we need to send things in one go. if ($style eq 'xml') { &xml($format, @ids); } else { my $counter; foreach my $id (@ids) { &$style($db, $id, $format); } no_entries($q, $value) if $style eq 'html' and tell($FH) == 0; } seek $FH, 0, 0; print '
' if $style eq 'html';
    print $_ while <$FH>;
} else {
    print_prompt($q);
}


=head2 print_prompt

 Title   : print_prompt
 Usage   :
 Function: Prints the default page with the query form
           to STDOUT (Web page)
 Args    :
 Returns :

=cut

sub print_prompt {
    print $q->header(),
         $q->start_html(-title => 'DB Entry Retrieval',
                        -bgcolor => 'white',
			-author => 'heikki-at-bioperl-dot-org'
			),
	 '',
	  $q->h1('Generic DB Entry Retrieval'),
	  $q->p("This page allows you to retrieve up to ". MAXIDS .
		 " entries at the time from various up-to-date biological databases."),
	  $q->p("For EMBL, enter an  accession number (e.g. J00231) or entry name (e.g.
		 HSFOS) or a sequence version (e.g. J00231.1), or any combination of them
		 separated by a non-word character into your browser's search dialog.
		 SWALL examples are: fos_human, p53_human.
		 For short Ensembl entries, try : AL122059, AL031002, AL031030 .
		 'Random' Medline entry examples are: 20063307, 98276153.
		 PDB entry examples are: 100D, 1FOS. Try NM_006732 for RefSeq.
		 Only one copy of the latest version of the entry is returned."),
	  $q->hr,
	  $q->startform,
	  $q->popup_menu(-name => 'db',
			 -values => ['EMBL',
				     'SWALL',
				     'PDB',
				     'Medline',
				     'Ensembl',
				     'RefSeq'
				     ]),
	  $q->textfield(-name => 'id',
			 -size => 40,
			 -maxlength => 1000),
	  $q->popup_menu(-name => 'format',
			 -values => ['default','Fasta','bsml','agave']),
	  $q->popup_menu(-name => 'style',
			 -values => ['html','raw']),
	  $q->submit('Retrieve'),
	  $q->endform,
	  $q->hr,
	  $q->h2('Direct access'),
	  $q->p('For backward compatibility, the script defaults to EMBL:'),
	  $q->code('
		     http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?J00231'),
	  $q->p('but the preferred way of calling it is:'),
	  $q->code('
		     http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?id=J00231.1,hsfos,bum'),
	  $q->p('which can be extended to retrieve entries in alternative sequence formats
		      and other databases:'),
	  $q->code('
		     http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?db=swall&format=fasta&id=fos_human'),
	  $q->p('Set style to raw to retrieve plain text entries for computational purposes
                 and saving to disk:'),
	  $q->code('
                    http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?db=medline&style=raw&id=21131735'),
 	  $q->p('There is now the possibility to retrieve EMBL sequences formatterd into two XML standards:
                Bsml (Bioinformatic Sequence Markup Language - from 
                Labbook, Inc.) or as AGAVE (Architecture for Genomic Annotation, 
                Visualisation, and Exchange - from Labbook, Inc.). To do this, use the 
                formats \'bsml\' or \'agave\', as follows:'),
	  $q->code('
                   http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?format=bsml&id=J00231
'), $q->code(' http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?format=agave&id=J00231'), $q->p("Version numbers are not supported with the XML retrieval."), $q->hr, $q->address("Version $VERSION, $DATE, support\@ebi.ac.uk"), $q->end_html, "\n" ; } =head2 protect Title : protect Usage : $value = protect($q->param('id')); Function: Removes potentially dangerous characters from the input string. At the same time, converts word separators into a single space character. Args : scalar, string with one or more IDs or accession numbers Returns : scalar =cut sub protect { my ($s) = @_; $s =~ s![^\w\.\_]+! !g; # allow version numbers with '.' & RefSeq IDs with '_' $s =~ s|^\W+||; $s =~ s|\W+$||; return $s; } =head2 input_error Title : input_error Usage : input_error($q, 'html', "Error message"); Function: Standard error message behaviour Args : reference to the CGI object scalar, string to display on input error. Returns : scalar =cut sub input_error { my ($q, $style, $s) = @_; if ($style eq 'html' ) { print $q->header, $q->start_html(-title => 'DB Entry Retrieval: Input error', -bgcolor => 'white' ), "

ERROR in input:

$s\n", $q->end_html, "\n"; } else { print "Content-type: text/plain\n\n", "ERROR $s\n"; } exit 0; } =head2 no_entries Title : no_entries Usage : no_entries($q, "Message"); Function: Standard behaviour when no entries found Args : reference to the CGI object scalar, string to display on input error. Returns : scalar =cut sub no_entries { my ($q, $value) = @_; print $q->start_html(-title => 'DB Entry Retrieval: Input warning', -bgcolor => 'white' ), "

Sorry, your query retrieved no entries.

", "Entries with [$value] where not found.", "Please go back or press here to try again", $q->end_html, "\n"; exit 0; } =head2 raw Title : raw Usage : Function: Retrieves a single database entry in plain text Args : scalar, an ID scaler, format Returns : scalar =cut sub raw { my ($db, $value, $format) = @_; my ($srsq, $qdb, $entry, $id); my ($seqformat) = ''; $seqformat = '-view '. $DBS{$db}{format}{$format} if $format ne $DBS{$db}{format}{default}; my $version = ''; $value =~ /(.+)\.(.+)/; $version = $2 if $2; $value = $1 if $1; # main db $qdb = $db; $srsq = ''; foreach my $field (@{$DBS{$db}{fields}}) { $srsq .= " [$qdb-$field:$value] |"; } chop $srsq; # if database supports versions (EMBL, GenBank, RefSeq...) if ($version) { my $vfname = $DBS{$db}{version}; $srsq = "[$qdb-$vfname:$version] & (". $srsq. ")" } # print "rsh srs $RGETZ $seqformat $srsq\n"; $entry = `rsh srs "$RGETZ $seqformat '$srsq'"`; $entry =~ s|EMBL[^\n]+\n||; $entry =~ s|^\s+||g; $entry =~ s|\s+$|\n|g; my $idmatch = $IDMATCH{$format}; ($id) = $entry =~ /$idmatch/; # die if ID not found input_error(' ', 'raw', "5 ID [$value] not found in database [$db].") unless $id; # my $tmp = substr($entry, 0, 20); # print "Entry:$tmp\n"; # print "-----id=$id---\$1=$1----idmatch=$idmatch=format=$format=\n"; # print $FH $entry unless $IDLIST{$id}; $IDLIST{$id} = 1; } =head2 html Title : html Usage : Function: Retrieves a single database entry with HTML hypertext links in place. Limits retieved enties to ones with correct version if the string has '.' in it. Args : scalar, a UID scalar, format Returns : scalar =cut sub html { my ($db, $value, $format) = @_; my ($srsq, $qdb, $entry, $id, $idmatch); my ($seqformat) = ''; $seqformat = '-view '. $DBS{$db}{format}{$format} if $format ne $DBS{$db}{format}{default}; my $version = ''; $value =~ /(.+)\.(.+)/; $version = $2 if $2; $value = $1 if $1; # SWALL plain format at EBI $seqformat .= ' -vn 2 ' if $db eq 'swall' or $db eq 'refseq'; $qdb = $db; $srsq = ''; foreach my $field (@{$DBS{$db}{fields}}) { $srsq .= " [$qdb-$field:$value] |"; } chop $srsq; # if database supports versions (EMBL...) if ($version) { my $vfname = $DBS{$db}{version}; $srsq = "[$qdb-$vfname:$version] & (". $srsq. ")" } # print "rsh srs $RWGETZ $seqformat $srsq\n"; ### '-id EBISRS' is (hopefully) a temporary addtion until SRS HTML output is fixed $entry = `rsh srs "$RWGETZ $seqformat '$srsq'"`; return if $entry =~ /SRS error/; $entry =~ s|^Content-type:[^\n]+\n||; $entry =~ s|\n||g; $entry =~ s|||g; $entry =~ s|\n+|\n|g; $entry =~ s|^\n+||g; $idmatch = $IDMATCH{$format}; ($id) = $entry =~ /$idmatch/; # my $tmp = substr($entry, 0, 20); # print "Entry:$tmp\n"; # print "-----id=$id---\$1=$1----idmatch=$idmatch=format=$format=\n"; print $FH $entry unless $IDLIST{$id}; $IDLIST{$id} = 1; } =head2 xml Title : xml Usage : Function: Retrieves an entry formatted as XML Args : array, UID scalar, format Returns : scalar =cut sub xml { my ($format, @ids) = @_; my ($entry, $id, $content, $counter, $reg); $content = ($ENV{'HTTP_USER_AGENT'} =~ /MSIE/) ? "Content-type: text/xml\n\n" : "Content-type: text/plain\n\n"; $entry = "--format ".(($format eq "bsml") ? "Bsml" : "sciobj") . " " . join (" ", @ids); $entry = `rsh mercury "$XEMBL $entry"`; $reg = (($format eq "bsml") ? ' "Database object interface to BioFetch retrieval", "AUTHOR" => "Lincoln Stein ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Bio-DB-BioFetch", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", "NAME" => "Bio::DB::BioFetch", "PREREQ_PM" => { "Bio::DB::WebDBSeqI" => 0, "Bio::Root::Root" => 0, "Carp" => 0, "HTTP::Request::Common" => 0, "base" => 0, "constant" => 0, "strict" => 0, "vars" => 0 }, "TEST_REQUIRES" => { "Data::Stag" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Exception" => 0, "Test::More" => 0, "Test::RequiresInternet" => 0, "Test::Warn" => 0, "warnings" => 0 }, "VERSION" => "1.7.3", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Bio::DB::WebDBSeqI" => 0, "Bio::Root::Root" => 0, "Carp" => 0, "Data::Stag" => 0, "File::Spec" => 0, "HTTP::Request::Common" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Exception" => 0, "Test::More" => 0, "Test::RequiresInternet" => 0, "Test::Warn" => 0, "base" => 0, "constant" => 0, "strict" => 0, "vars" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); t000755001750001750 013433043563 14250 5ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3BioFetch.t100644001750001750 534113433043563 16263 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3/t# -*-Perl-*- Test Harness script for Bioperl # $Id$ use strict; use Test::More; use Test::RequiresInternet; use Test::Warn; use Test::Exception; use Bio::DB::BioFetch; my ($db,$db2,$seq,$seqio); ok defined($db = Bio::DB::BioFetch->new()); { # get a single seq # get a RefSeq entry ok $db->db('refseqn'); $seq = $db->get_Seq_by_acc('NM_006732.2'); # RefSeq VERSION isa_ok($seq, 'Bio::SeqI'); is($seq->accession_number,'NM_006732'); is($seq->accession_number,'NM_006732'); is( $seq->length, 3776); } { # EMBL $db->db('embl'); $seq = $db->get_Seq_by_acc('J02231'); isa_ok($seq, 'Bio::SeqI'); is($seq->id, 'J02231'); is($seq->length, 200); } { $seqio = $db->get_Stream_by_id(['AEE33958']); undef $db; # testing to see if we can remove gb $seq = $seqio->next_seq(); isa_ok($seqio, 'Bio::SeqIO'); isa_ok($seq, 'Bio::SeqI'); cmp_ok( $seq->length, '>=', 1); } ok $db2 = Bio::DB::BioFetch->new(-db => 'swissprot'); SKIP: { eval { require Data::Stag }; skip "Data::Stag not installed", 5 if $@; $seq = $db2->get_Seq_by_id('YNB3_YEAST'); isa_ok($seq, 'Bio::SeqI'); is($seq->length, 125); is($seq->division, 'YEAST'); $db2->request_format('fasta'); $seq = $db2->get_Seq_by_acc('P43780'); isa_ok($seq, 'Bio::SeqI'); is($seq->length,103); } $seq = $seqio = undef; { ok $db = Bio::DB::BioFetch->new(-retrievaltype => 'tempfile', -format => 'fasta', ); $db->db('embl'); $seqio = $db->get_Stream_by_id('J00522 AF303112 J02231'); my %seqs; # don't assume anything about the order of the sequences while ( my $s = $seqio->next_seq ) { isa_ok($s, 'Bio::SeqI'); my ($type,$x,$name) = split(/\|/,$s->display_id); $seqs{$x} = $s->length; } isa_ok($seqio, 'Bio::SeqIO'); is($seqs{'J00522'},408); is($seqs{'AF303112'},1611); is($seqs{'J02231'},200); } { ok $db = Bio::DB::BioFetch->new(-db => 'embl'); # check contig warning (WebDBSeqI) throws_ok (sub { $seq = $db->get_Seq_by_acc('NT_006732') }, qr/contigs are whole chromosome files/, 'contig warning'); warning_like (sub { $seq = $db->get_Seq_by_acc('NM_006732.2') }, qr/RefSeq \(nucleotide\) entry\. Redirecting the request\./, 'Warn redirection from EMBL to RefSeq'); isa_ok($seq, 'Bio::SeqI'); is($seq->length,3776); } # unisave { ok $db = Bio::DB::BioFetch->new(-db => 'unisave'); $seq = $db->get_Seq_by_acc('P14733'); isa_ok($seq, 'Bio::SeqI'); is($seq->display_id, 'LMNB1_MOUSE'); is($seq->accession, 'P14733'); is($seq->length, 588); } done_testing; 00-compile.t100644001750001750 264013433043563 16444 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3/tuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More; plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Bio/DB/BioFetch.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; author-eol.t100644001750001750 103013433043563 16646 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3/t BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/Bio/DB/BioFetch.pm', 't/00-compile.t', 't/BioFetch.t', 't/author-eol.t', 't/author-mojibake.t', 't/author-pod-coverage.t', 't/author-pod-syntax.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; author-mojibake.t100644001750001750 35313433043563 17637 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3/t#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); author-pod-syntax.t100644001750001750 45413433043563 20166 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3/t#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); DB000755001750001750 013433043563 15551 5ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3/lib/BioBioFetch.pm100644001750001750 3513513433043563 17761 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3/lib/Bio/DB# # BioPerl module for Bio::DB::BioFetch # # Please direct questions and support issues to # # Cared for by Lincoln Stein # # Copyright Lincoln Stein # # You may distribute this module under the same terms as perl itself # # POD documentation - main docs before the code # package Bio::DB::BioFetch; $Bio::DB::BioFetch::VERSION = '1.7.3'; use strict; use Carp; use HTTP::Request::Common 'POST'; =head1 NAME Bio::DB::BioFetch - Database object interface to BioFetch retrieval =head1 SYNOPSIS use Bio::DB::BioFetch; $bf = Bio::DB::BioFetch->new(); $seq = $bf->get_Seq_by_id('HSFOS'); # EMBL or SWALL ID # change formats, storage procedures $bf = Bio::DB::BioFetch->new(-format => 'fasta', -retrievaltype => 'tempfile', -db => 'EMBL'); $stream = $bf->get_Stream_by_id(['HSFOS','J00231']); while (my $s = $stream->next_seq) { print $s->seq,"\n"; } # get a RefSeq entry $bf->db('refseq'); eval { $seq = $bf->get_Seq_by_version('NM_006732.1'); # RefSeq VERSION }; print "accession is ", $seq->accession_number, "\n" unless $@; =head1 DESCRIPTION Bio::DB::BioFetch is a guaranteed best effort sequence entry fetching method. It goes to the Web-based dbfetch server located at the EBI (http://www.ebi.ac.uk/Tools/dbfetch/dbfetch) to retrieve sequences in the EMBL or GenBank sequence repositories. This module implements all the Bio::DB::RandomAccessI interface, plus the get_Stream_by_id() and get_Stream_by_acc() methods that are found in the Bio::DB::SwissProt interface. =head1 FEEDBACK =head2 Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://github.com/bioperl/bioperl-live/issues =head1 AUTHOR - Lincoln Stein Email Lincoln Stein Elstein@cshl.orgE Also thanks to Heikki Lehvaslaiho Eheikki-at-bioperl-dot-orgE for the BioFetch server and interface specification. =head1 APPENDIX The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ =cut # Let the code begin... use vars qw(%FORMATMAP); use base qw(Bio::DB::WebDBSeqI Bio::Root::Root); # warning: names used here must map into Bio::SeqIO::* space use constant DEFAULT_LOCATION => 'http://www.ebi.ac.uk/Tools/dbfetch/dbfetch'; BEGIN { %FORMATMAP = ( 'embl' => { default => 'embl', # default BioFetch format/SeqIOmodule pair embl => 'embl', # alternative BioFetch format/module pair fasta => 'fasta', # alternative BioFetch format/module pair namespace => 'embl', }, 'swissprot' => { default => 'swiss', swissprot => 'swiss', fasta => 'fasta', namespace => 'uniprot', }, 'refseq' => { default => 'genbank', genbank => 'genbank', fasta => 'fasta', namespace => 'RefSeq', }, 'refseqn' => { default => 'genbank', genbank => 'genbank', fasta => 'fasta', namespace => 'refseqn', }, 'refseqp' => { default => 'genbank', genbank => 'genbank', fasta => 'fasta', namespace => 'refseqp', }, 'swall' => { default => 'swiss', swissprot => 'swiss', fasta => 'fasta', namespace => 'uniprot', }, 'uniprot' => { default => 'swiss', swissprot => 'swiss', fasta => 'fasta', namespace => 'uniprot', }, 'genbank' => { default => 'genbank', genbank => 'genbank', namespace => 'genbank', }, 'genpep' => { default => 'genbank', genbank => 'genbank', namespace => 'genpep', }, 'unisave' => { default => 'swiss', swissprot => 'swiss', fasta => 'fasta', namespace => 'unisave', } ); } =head2 new Title : new Usage : $bf = Bio::DB::BioFetch->new(@args) Function: Construct a new Bio::DB::BioFetch object Returns : a Bio::DB::BioFetch object Args : see below Throws : @args are standard -name=Evalue options as listed in the following table. If you do not provide any options, the module assumes reasonable defaults. Option Value Default ------ ----- ------- -baseaddress location of dbfetch server http://www.ebi.ac.uk/Tools/dbfetch/dbfetch -retrievaltype "tempfile" or "io_string" io_string -format "embl", "fasta", "swissprot", embl or "genbank" -db "embl", "genbank" or "swissprot" embl =cut #' sub new { my ($class,@args) = @_; my $self = $class->SUPER::new(@args); my ($db) = $self->_rearrange([qw(DB)],@args); $db ||= $self->default_db; $self->db($db); $self->url_base_address(DEFAULT_LOCATION) unless $self->url_base_address; $self; } =head2 new_from_registry Title : new_from_registry Usage : $biofetch = $db->new_from_registry(%config) Function: Creates a BioFetch object from the registry config hash Returns : itself Args : A configuration hash (see Registry.pm) Throws : =cut sub new_from_registry { my ($class,%config)=@_; my $self = $class->SUPER::new( -BASEADDRESS=>$config{'location'} ); $self->db($config{'dbname'}) if $config{dbname}; return $self; } # from Bio::DB::RandomAccessI =head2 get_Seq_by_id Title : get_Seq_by_id Usage : $seq = $db->get_Seq_by_id('ROA1_HUMAN') Function: Gets a Bio::Seq object by its name Returns : a Bio::Seq object Args : the id (as a string) of a sequence Throws : "id does not exist" exception =cut =head2 get_Seq_by_acc Title : get_Seq_by_acc Usage : $seq = $db->get_Seq_by_acc('X77802'); Function: Gets a Bio::Seq object by accession number Returns : A Bio::Seq object Args : accession number (as a string) Throws : "acc does not exist" exception =cut =head2 get_Seq_by_gi Title : get_Seq_by_gi Usage : $seq = $db->get_Seq_by_gi('405830'); Function: Gets a Bio::Seq object by gi number Returns : A Bio::Seq object Args : gi number (as a string) Throws : "gi does not exist" exception =cut =head2 get_Seq_by_version Title : get_Seq_by_version Usage : $seq = $db->get_Seq_by_version('X77802.1'); Function: Gets a Bio::Seq object by sequence version Returns : A Bio::Seq object Args : accession.version (as a string) Throws : "acc.version does not exist" exception =cut sub get_Seq_by_version { my ($self,$seqid) = @_; return $self->get_Seq_by_acc($seqid); } =head2 get_Stream_by_id Title : get_Stream_by_id Usage : $stream = $db->get_Stream_by_id( [$uid1, $uid2] ); Function: Gets a series of Seq objects by unique identifiers Returns : a Bio::SeqIO stream object Args : $ref : a reference to an array of unique identifiers for the desired sequence entries =cut =head2 get_Stream_by_gi Title : get_Stream_by_gi Usage : $seq = $db->get_Seq_by_gi([$gi1, $gi2]); Function: Gets a series of Seq objects by gi numbers Returns : a Bio::SeqIO stream object Args : $ref : a reference to an array of gi numbers for the desired sequence entries Note : For GenBank, this just calls the same code for get_Stream_by_id() =cut =head2 get_Stream_by_batch Title : get_Stream_by_batch Usage : $seq = $db->get_Stream_by_batch($ref); Function: Get a series of Seq objects by their IDs Example : Returns : a Bio::SeqIO stream object Args : $ref : an array reference containing a list of unique ids/accession numbers. In some of the Bio::DB::* moduels, get_Stream_by_id() is called get_Stream_by_batch(). Since there seems to be no consensus, this is provided as an alias. =cut *get_Stream_by_batch = \&Bio::DB::WebDBSeqI::get_Stream_by_id; =head1 The remainder of these methods are for internal use =head2 get_request Title : get_request Usage : my $url = $self->get_request Function: returns a HTTP::Request object Returns : Args : %qualifiers = a hash of qualifiers (ids, format, etc) =cut sub get_request { my ($self, @qualifiers) = @_; my ($uids, $format) = $self->_rearrange([qw(UIDS FORMAT)], @qualifiers); my $db = $self->db; my $namespace = $self->_namespace; $self->throw("Must specify a value for UIDs to fetch") unless defined $uids; my $tmp; my $format_string = ''; $format ||= $self->default_format; ($format, $tmp) = $self->request_format($format); my $base = $self->url_base_address; my $uid = join('+',ref $uids ? @$uids : $uids); $self->debug("\n$base$format_string&id=$uid\n"); return POST($base, [ db => $namespace, id => join('+',ref $uids ? @$uids : $uids), format => $format, style => 'raw' ]); } =head2 default_format Title : default_format Usage : $format = $self->default_format Function: return the default format Returns : a string Args : =cut sub default_format { return 'default'; } =head2 default_db Title : default_db Usage : $db = $self->default_db Function: return the default database Returns : a string Args : =cut sub default_db { 'embl' } =head2 db Title : db Usage : $db = $self->db([$db]) Function: get/set the database Returns : a string Args : new database =cut sub db { my $self = shift; if (@_) { my $db = lc shift; ## This is a special case error message because 'refseq' was ## once a valid database. With time, remove this special error ## handling. See issue #1. if ($db eq 'refseq') { croak "'refseq' is an invalid db. Try 'refseqn' or 'refseqn'"; } my $base = $self->url_base_address; $FORMATMAP{$db} or $self->throw("invalid db [$db] at [$base], must be one of [". join(' ',keys %FORMATMAP). "]"); $self->{_db} = $db; } return $self->{_db} || $self->default_db ; } sub _namespace { my $self = shift; my $db = $self->db; return $FORMATMAP{$db}{namespace} || $db; } =head2 postprocess_data Title : postprocess_data Usage : $self->postprocess_data ( 'type' => 'string', 'location' => \$datastr); Function: process downloaded data before loading into a Bio::SeqIO Returns : void Args : hash with two keys - 'type' can be 'string' or 'file' - 'location' either file location or string reference containing data =cut sub postprocess_data { my ($self,%args) = @_; # check for errors in the stream if ($args{'type'} eq 'string') { my $stringref = $args{'location'}; if ($$stringref =~ /^ERROR (\d+) (.+)/m) { $self->throw("BioFetch Error $1: $2"); } } elsif ($args{'type'} eq 'file') { open my $F, '<', $args{'location'} or $self->throw("Could not read file '$args{location}': $!"); # this is dumb, but the error may be anywhere on the first three lines because the # CGI headers are sometimes printed out by the server... my @data = grep {defined $_} (scalar <$F>, scalar <$F>, scalar <$F>); close $F; if (join('',@data) =~ /^ERROR (\d+) (.+)/m) { $self->throw("BioFetch Error $1: $2"); } } else { $self->throw("Don't know how to postprocess data of type $args{'type'}"); } } =head2 request_format Title : request_format Usage : my ($req_format, $ioformat) = $self->request_format; $self->request_format("genbank"); $self->request_format("fasta"); Function: Get/Set sequence format retrieval. The get-form will normally not be used outside of this and derived modules. Returns : Array of two strings, the first representing the format for retrieval, and the second specifying the corresponding SeqIO format. Args : $format = sequence format =cut sub request_format { my ($self, $value) = @_; if ( defined $value ) { my $db = $self->db; my $namespace = $self->_namespace; my $format = lc $value; print "format:", $format, " module:", $FORMATMAP{$db}->{$format}, " ($namespace)\n" if $self->verbose > 0; $self->throw("Invalid format [$format], must be one of [". join(' ',keys %{$FORMATMAP{$db}}). "]") unless $format eq 'default' || $FORMATMAP{$db}->{$format}; $self->{'_format'} = [ $format, $FORMATMAP{$db}->{$format}]; } return @{$self->{'_format'}}; } =head2 Bio::DB::WebDBSeqI methods Overriding WebDBSeqI method to help newbies to retrieve sequences. EMBL database is all too often passed RefSeq accessions. This redirects those calls. See L. =head2 get_Stream_by_acc Title : get_Stream_by_acc Usage : $seq = $db->get_Seq_by_acc([$acc1, $acc2]); Function: Gets a series of Seq objects by accession numbers Returns : a Bio::SeqIO stream object Args : $ref : a reference to an array of accession numbers for the desired sequence entries =cut sub get_Stream_by_acc { my ($self, $ids ) = @_; $self->_check_id($ids); return $self->get_seq_stream('-uids' => $ids, '-mode' => 'single'); } =head2 _check_id Title : _check_id Usage : Function: Throw on whole chromosome NCBI sequences not in sequence databases and redirect RefSeq accession requests sent to EMBL. Returns : Args : $id(s), $string Throws : if accessionn number indicates whole chromosome NCBI sequence =cut sub _check_id { my ($self, $id) = @_; # NT contigs can not be retrieved $self->throw("NT_ contigs are whole chromosome files which are not part of regular ". "database distributions. Go to ftp://ftp.ncbi.nih.gov/genomes/.") if $id =~ /NT_/; ## Asking for a RefSeq from EMBL/GenBank if ($id =~ /^(AC|NC|NG|NM|NR|NS)_/ && $self->db ne 'refseqn') { carp "[$id] is a RefSeq (nucleotide) entry. Redirecting the request." if $self->verbose >= 0; $self->db('refseqn'); } elsif ($id =~ /^(AP|NP|XP|YP)_/ && $self->db ne 'refseqp') { carp "[$id] is a RefSeq (protein) entry. Redirecting the request." if $self->verbose >= 0; $self->db('refseqp'); } } 1; author-pod-coverage.t100644001750001750 53613433043563 20434 0ustar00cdieshcdiesh000000000000Bio-DB-BioFetch-1.7.3/t#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });