Bio-Tools-Run-RemoteBlast-1.7.3000755000765000024 013352336533 16367 5ustar00cjfieldsstaff000000000000Changes100644000765000024 36613352336533 17730 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3Summary of important user-visible changes for Bio-Tools-Run-RemoteBlast ----------------------------------------------------------------------- 1.7.3 2018-09-24 23:45:11-05:00 America/Chicago * First release after split from bioperl-live. LICENSE100644000765000024 4375413352336533 17512 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3This software is copyright (c) 2018 by Jason Stajich . 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) 2018 by Jason Stajich . 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) 2018 by Jason Stajich . 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.ini100644000765000024 46413352336533 20100 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3name = Bio-Tools-Run-RemoteBlast version = 1.7.3 author = Jason Stajich copyright_holder = Jason Stajich license = Perl_5 ;; Modules should be fixed so that these don't have to be removed. [@BioPerl] -remove = PodCoverageTests -remove = PodWeaver -remove = Test::EOL META.yml100644000765000024 1646613352336533 17756 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3--- abstract: 'Object for remote execution of the NCBI Blast via HTTP' author: - 'Jason Stajich ' build_requires: File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::More: '0' perl: '5.006' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Bio-Tools-Run-RemoteBlast requires: Bio::Root::IO: '0' Bio::Root::Version: '0' Bio::SearchIO: '0' Bio::SeqIO: '0' Exporter: '0' Getopt::Long: '0' HTTP::Request::Common: '0' IO::String: '0' LWP: '0' base: '0' constant: '0' strict: '0' vars: '0' warnings: '0' resources: bugtracker: https://github.com/bioperl/bio-tools-run-remoteblast/issues homepage: https://metacpan.org/release/Bio-Tools-Run-RemoteBlast repository: git://github.com/bioperl/bio-tools-run-remoteblast.git version: 1.7.3 x_Dist_Zilla: perl: version: '5.026000' 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.010' - class: Dist::Zilla::Plugin::PruneCruft name: '@BioPerl/@Filter/PruneCruft' version: '6.010' - class: Dist::Zilla::Plugin::ManifestSkip name: '@BioPerl/@Filter/ManifestSkip' version: '6.010' - class: Dist::Zilla::Plugin::MetaYAML name: '@BioPerl/@Filter/MetaYAML' version: '6.010' - class: Dist::Zilla::Plugin::License name: '@BioPerl/@Filter/License' version: '6.010' - class: Dist::Zilla::Plugin::ExtraTests name: '@BioPerl/@Filter/ExtraTests' version: '6.010' - class: Dist::Zilla::Plugin::ExecDir name: '@BioPerl/@Filter/ExecDir' version: '6.010' - class: Dist::Zilla::Plugin::ShareDir name: '@BioPerl/@Filter/ShareDir' version: '6.010' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@BioPerl/@Filter/MakeMaker' version: '6.010' - class: Dist::Zilla::Plugin::Manifest name: '@BioPerl/@Filter/Manifest' version: '6.010' - class: Dist::Zilla::Plugin::TestRelease name: '@BioPerl/@Filter/TestRelease' version: '6.010' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@BioPerl/@Filter/ConfirmRelease' version: '6.010' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@BioPerl/@Filter/UploadToCPAN' version: '6.010' - class: Dist::Zilla::Plugin::MetaConfig name: '@BioPerl/MetaConfig' version: '6.010' - class: Dist::Zilla::Plugin::MetaJSON name: '@BioPerl/MetaJSON' version: '6.010' - class: Dist::Zilla::Plugin::PkgVersion name: '@BioPerl/PkgVersion' version: '6.010' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@BioPerl/PodSyntaxTests' version: '6.010' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' name: '@BioPerl/Test::NoTabs' version: '0.15' - 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.057' - class: Dist::Zilla::Plugin::MojibakeTests name: '@BioPerl/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@BioPerl/AutoPrereqs' version: '6.010' - class: Dist::Zilla::Plugin::AutoMetaResources name: '@BioPerl/AutoMetaResources' version: '1.21' - class: Dist::Zilla::Plugin::MetaResources name: '@BioPerl/MetaResources' version: '6.010' - class: Dist::Zilla::Plugin::Encoding name: '@BioPerl/Encoding' version: '6.010' - class: Dist::Zilla::Plugin::NextRelease name: '@BioPerl/NextRelease' version: '6.010' - 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.14.1 repo_root: . name: '@BioPerl/Git::Check' version: '2.042' - 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.14.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@BioPerl/Git::Commit' version: '2.042' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: Bio-Tools-Run-RemoteBlast-v1.7.3 tag_format: '%N-v%v' tag_message: '%N-v%v' Dist::Zilla::Role::Git::Repo: git_version: 2.14.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@BioPerl/Git::Tag' version: '2.042' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.010' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.010' x_serialization_backend: 'YAML::Tiny version 1.70' MANIFEST100644000765000024 54213352336533 17562 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.010. Changes LICENSE MANIFEST META.json META.yml Makefile.PL bin/bp_remote_blast.pl dist.ini lib/Bio/Tools/Run/RemoteBlast.pm t/00-compile.t t/author-mojibake.t t/author-no-tabs.t t/author-pod-syntax.t t/data/ecolitst.fa t/release-RemoteBlast.t t/release-RemoteBlast_rpsblast.t META.json100644000765000024 2700013352336533 20110 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3{ "abstract" : "Object for remote execution of the NCBI Blast via HTTP", "author" : [ "Jason Stajich " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Bio-Tools-Run-RemoteBlast", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Test::Mojibake" : "0", "Test::More" : "0.88", "Test::NoTabs" : "0", "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "Bio::Root::IO" : "0", "Bio::Root::Version" : "0", "Bio::SearchIO" : "0", "Bio::SeqIO" : "0", "Exporter" : "0", "Getopt::Long" : "0", "HTTP::Request::Common" : "0", "IO::String" : "0", "LWP" : "0", "base" : "0", "constant" : "0", "strict" : "0", "vars" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::More" : "0", "perl" : "5.006" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bioperl-l@bioperl.org", "web" : "https://github.com/bioperl/bio-tools-run-remoteblast/issues" }, "homepage" : "https://metacpan.org/release/Bio-Tools-Run-RemoteBlast", "repository" : { "type" : "git", "url" : "git://github.com/bioperl/bio-tools-run-remoteblast.git", "web" : "https://github.com/bioperl/bio-tools-run-remoteblast" } }, "version" : "1.7.3", "x_Dist_Zilla" : { "perl" : { "version" : "5.026000" }, "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.010" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@BioPerl/@Filter/PruneCruft", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@BioPerl/@Filter/ManifestSkip", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@BioPerl/@Filter/MetaYAML", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@BioPerl/@Filter/License", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@BioPerl/@Filter/ExtraTests", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@BioPerl/@Filter/ExecDir", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@BioPerl/@Filter/ShareDir", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@BioPerl/@Filter/MakeMaker", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@BioPerl/@Filter/Manifest", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@BioPerl/@Filter/TestRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@BioPerl/@Filter/ConfirmRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@BioPerl/@Filter/UploadToCPAN", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@BioPerl/MetaConfig", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@BioPerl/MetaJSON", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@BioPerl/PkgVersion", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@BioPerl/PodSyntaxTests", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ] } }, "name" : "@BioPerl/Test::NoTabs", "version" : "0.15" }, { "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.057" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@BioPerl/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@BioPerl/AutoPrereqs", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@BioPerl/AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@BioPerl/MetaResources", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Encoding", "name" : "@BioPerl/Encoding", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@BioPerl/NextRelease", "version" : "6.010" }, { "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.14.1", "repo_root" : "." } }, "name" : "@BioPerl/Git::Check", "version" : "2.042" }, { "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.14.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@BioPerl/Git::Commit", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "Bio-Tools-Run-RemoteBlast-v1.7.3", "tag_format" : "%N-v%v", "tag_message" : "%N-v%v" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.14.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@BioPerl/Git::Tag", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.010" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.010" } }, "x_serialization_backend" : "Cpanel::JSON::XS version 3.0239" } Makefile.PL100644000765000024 345613352336533 20432 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.010. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Object for remote execution of the NCBI Blast via HTTP", "AUTHOR" => "Jason Stajich ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Bio-Tools-Run-RemoteBlast", "EXE_FILES" => [ "bin/bp_remote_blast.pl" ], "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", "NAME" => "Bio::Tools::Run::RemoteBlast", "PREREQ_PM" => { "Bio::Root::IO" => 0, "Bio::Root::Version" => 0, "Bio::SearchIO" => 0, "Bio::SeqIO" => 0, "Exporter" => 0, "Getopt::Long" => 0, "HTTP::Request::Common" => 0, "IO::String" => 0, "LWP" => 0, "base" => 0, "constant" => 0, "strict" => 0, "vars" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => 0 }, "VERSION" => "1.7.3", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Bio::Root::IO" => 0, "Bio::Root::Version" => 0, "Bio::SearchIO" => 0, "Bio::SeqIO" => 0, "Exporter" => 0, "File::Spec" => 0, "Getopt::Long" => 0, "HTTP::Request::Common" => 0, "IO::Handle" => 0, "IO::String" => 0, "IPC::Open3" => 0, "LWP" => 0, "Test::More" => 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); t000755000765000024 013352336533 16553 5ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.300-compile.t100644000765000024 512713352336533 20752 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3/tuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.057 use Test::More; plan tests => 2 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Bio/Tools/Run/RemoteBlast.pm' ); my @scripts = ( 'bin/bp_remote_blast.pl' ); # 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; } } foreach my $file (@scripts) { SKIP: { open my $fh, '<', $file or warn("Unable to open $file: $!"), next; my $line = <$fh>; close $fh and skip("$file isn't perl", 1) unless $line =~ /^#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/; @switches = (@switches, split(' ', $1)) if $1; my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-c', $file)) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-c', $file); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$file compiled ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; # in older perls, -c output is simply the file portion of the path being tested if (@_warnings = grep { !/\bsyntax OK$/ } grep { chomp; $_ ne (File::Spec->splitpath($file))[2] } @_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}; data000755000765000024 013352336533 17464 5ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3/tecolitst.fa100644000765000024 164413352336533 21767 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3/t/data>gi|1786183|gb|AAC73113.1| (AE000111) aspartokinase I, homoserine dehydrogenase I [Escherichia coli] MRVLKFGGTSVANAERFLRVADILESNARQGQVATVLSAPAKITNHLVAMIEKTISGQDALPNISDAERIFAELLTGLAA AQPGFPLAQLKTFVDQEFAQIKHVLHGISLLGQCPDSINAALICRGEKMSIAIMAGVLEARGHNVTVIDPVEKLLAVGHY LESTVDIAESTRRIAASRIPADHMVLMAGFTAGNEKGELVVLGRNGSDYSAAVLAACLRADCCEIWTDVDGVYTCDPRQV PDARLLKSMSYQEAMELSYFGAKVLHPRTITPIAQFQIPCLIKNTGNPQAPGTLIGASRDEDELPVKGISNLNNMAMFSV SGPGMKGMVGMAARVFAAMSRARISVVLITQSSSEYSISFCVPQSDCVRAERAMQEEFYLELKEGLLEPLAVTERLAIIS VVGDGMRTLRGISAKFFAALARANINIVAIAQGSSERSISVVVNNDDATTGVRVTHQMLFNTDQVIEVFVIGVGGVGGAL LEQLKRQQSWLKNKHIDLRVCGVANSKALLTNVHGLNLENWQEELAQAKEPFNLGRLIRLVKEYHLLNPVIVDCTSSQAV ADQYADFLREGFHVVTPNKKANTSSMDYYHQLRYAAEKSRRKFLYDTNVGAGLPVIENLQNLLNAGDELMKFSGILSGSL SYIFGKLDEGMSFSEATTLAREMGYTEPDPRDDLSGMDVARKLLILARETGRELELADIEIEPVLPAEFNAEGDVAAFMA NLSQLDDLFAARVAKARDEGKVLRYVGNIDEDGVCRVKIAEVDGNDPLFKVKNGENALAFYSHYYQPLPLVLRGYGAGND VTAAGVFADLLRTLSWKLGV author-no-tabs.t100644000765000024 107613352336533 21747 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-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::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'bin/bp_remote_blast.pl', 'lib/Bio/Tools/Run/RemoteBlast.pm', 't/00-compile.t', 't/author-mojibake.t', 't/author-no-tabs.t', 't/author-pod-syntax.t', 't/release-RemoteBlast.t', 't/release-RemoteBlast_rpsblast.t' ); notabs_ok($_) foreach @files; done_testing; author-mojibake.t100644000765000024 35313352336533 22142 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-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.t100644000765000024 45413352336533 22471 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-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(); bin000755000765000024 013352336533 17060 5ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3bp_remote_blast.pl100644000765000024 1202413352336533 22735 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3/bin#!/usr/bin/perl # # BioPerl module for bp_remote_blast.pl # # Revived by Evan Weaver for bioperl-1.5.1 # 3/14/2006 # # Copyright Jason Stajich, Evan Weaver # # You may distribute this module under the same terms as perl itself # POD documentation - main docs after the code use strict; use warnings; use vars qw($USAGE); use Bio::Tools::Run::RemoteBlast; use Bio::SeqIO; use Getopt::Long; $USAGE = "remote_blast.pl [-h] [-p prog] [-d db] [-e expect] [-mod Blast] [-f seqformat] -z=\"entrez query\" -v 1 -t output_format -i seqfile\n"; my ($prog, $db, $expect,$method) = ( 'blastp', 'nr', '10', 'Blast'); my ($sequencefile,$sequenceformat,$help, $entrez, $outputformat, $verbose) = (undef, 'fasta',undef, undef, undef, 1); &GetOptions('prog|p=s' => \$prog, 'db|d=s' => \$db, 'expect|e=s' => \$expect, 'blsmod|module|method=s' => \$method, 'input|i=s' => \$sequencefile, 'format|f=s' => \$sequenceformat, 'help|h' => \$help, 'entrez|z=s' => \$entrez, 'output_format|t=s' => \$outputformat, 'verbose|v=s' => \$verbose ); if( $help ) { exec('perldoc', $0); die; } if( !defined $prog ) { die($USAGE . "\n\tMust specify a valid program name ([t]blast[pxn])\n"); } if( !defined $db ) { die($USAGE . "\n\tMust specify a db to search\n"); } if( !defined $sequencefile ) { die($USAGE . "\n\tMust specify an input file\n"); } my $blastfactory = new Bio::Tools::Run::RemoteBlast ('-prog' => $prog, '-data' => $db, '-expect' => $expect, 'readmethod' => $method, ); if ($entrez) { if ($verbose) { print "Entrez query (submission side): $entrez\n"; } #$Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{ FORMAT_ENTREZ_QUERY} = $entrez; $Bio::Tools::Run::RemoteBlast::HEADER{ ENTREZ_QUERY } = $entrez; } if ($outputformat) { print "Don't use output format type; it doesn't work.\n"; $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{ FORMAT_TYPE } = $outputformat; } # submit_blast can only currenly handle fasta format files so I'll # preprocess outside of the module but I'd rather be sure here my $input; if( $sequenceformat !~ /fasta/ ) { my @seqs; my $seqio = new Bio::SeqIO('-format' => $sequenceformat, '-file' => $sequencefile ); while( my $seq = $seqio->next_seq() ) { push @seqs, $seq; } $input = \@seqs; } else { $input = $sequencefile; } my $r = $blastfactory->submit_blast($input); #my $r = $factory->submit_blast(?amino.fa?); print STDERR "waiting...\n" if( $verbose > 0 ); while ( my @rids = $blastfactory->each_rid ) { foreach my $rid ( @rids ) { my $rc = $blastfactory->retrieve_blast($rid); if( !ref($rc) ) { if( $rc < 0 ) { $blastfactory->remove_rid($rid); } print STDERR " checking $rid\n" if ( $verbose > 0 ); sleep 5; } else { my $result = $rc->next_result(); #save the output my $filename = $result->query_name()."\.out"; $blastfactory->save_output($filename); $blastfactory->remove_rid($rid); print "\nQuery Name: ", $result->query_name(), "\n"; while ( my $hit = $result->next_hit ) { next unless ( $verbose > 0); print "\thit name is ", $hit->name, "\n"; while( my $hsp = $hit->next_hsp ) { print "\t\tscore is ", $hsp->score, "\n"; } } } } print STDERR scalar(@rids) . " left\n"; } __END__ # # BioPerl module for bp_remote_blast.pl # # Cared for by Jason Stajich # # Copyright Jason Stajich # # You may distribute this module under the same terms as perl itself # POD documentation - main docs before the code =head1 NAME bp_remote_blast.pl - script for submitting jobs to a remote blast server (ncbi blast queue at this time) =head1 SYNOPSIS % bp_remote_blast.pl -p blastp -d ecoli -e 1e-5 -i myseqs.fa =head1 DESCRIPTION This module will run a remote blast on a set of sequences by submitting them to the NCBI blast queue and printing the output of the request. =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 the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =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 - Jason Stajich Email jason-at-bioperl-dot-org =cut release-RemoteBlast.t100644000765000024 2126113352336533 22761 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3/t BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } # -*-Perl-*- Test Harness script for Bioperl # $Id$ use strict; BEGIN { use lib '.'; use Bio::Root::Test; test_begin(-tests => 21, -requires_modules => [qw(IO::String LWP::UserAgent)], -requires_networking => 1); use_ok('Bio::Tools::Run::RemoteBlast'); } my $prog = 'blastp'; my $db = 'swissprot'; my $e_val = '1e-10'; my $v = test_debug(); SKIP: { my $remote_blast = Bio::Tools::Run::RemoteBlast->new(-verbose => $v, -prog => $prog, -data => $db, -expect => $e_val, ); $remote_blast->submit_parameter('ENTREZ_QUERY', 'Escherichia coli[ORGN]'); my $inputfilename = test_input_file('ecolitst.fa'); ok( -e $inputfilename); ok(1, 'Text BLAST'); my $attempt = 1; my $status; eval{ $status = $remote_blast->submit_blast($inputfilename); }; ok($status,'BLAST text output submitted'); skip("Error accessing remote BLAST interface: $@", 5) if $@; cmp_ok($remote_blast->get_rtoe, '>', 0, "Estimated retrieval time"); diag("Time remaining: ".$remote_blast->get_rtoe) if $v; my @rids = $remote_blast->each_rid; is(@rids, 1, 'should only be one RID'); skip("Wrong number of RIDs: ".scalar(@rids), 3) if @rids != 1; diag("Retrieving $rids[0]...\n") if $v; my $max_attempts = 20; my $rc; while (defined($rc = $remote_blast->retrieve_blast($rids[0]))) { if ( !ref($rc) ) { if ( $rc < 0 ) { skip("need a better solution for when 'Server failed to return any data'",3); } sleep 30; diag("Retrieval attempt: $attempt\n") if $v; $attempt++ < $max_attempts ? next : last; } else { last; } } if ($rc) { ok(1,'retrieve_blast succeeded'); $remote_blast->remove_rid($rids[0]); my $count = 0; isa_ok($rc, 'Bio::SearchIO'); while (my $result = $rc->next_result) { while ( my $hit = $result->next_hit ) { $count++; next unless ( $v > 0); print "sbjct name is ", $hit->name, "\n"; while ( my $hsp = $hit->next_hsp ) { print "score is ", $hsp->bits, "\n"; } } } is($count, 3, 'HSPs returned'); } elsif ($attempt > $max_attempts) { # have a test fail here (there should not be repeated failed attempts to # get reports) ok(0,'Exceeded maximum attempts on server to retrieve report'); diag("Timeout, did not return report after ".($attempt - 1)." attempts"); skip('Remote server timeout problems', 2); } else { # have a test fail here (whatever is returned should be eval as true and # be a SearchIO) ok(0,"Other problem on remote server, no report returned: $rc"); skip('Possible remote server problems', 2); } } SKIP: { # test blasttable my $remote_blast = Bio::Tools::Run::RemoteBlast->new(-verbose => $v, -prog => $prog, -data => $db, -readmethod => 'blasttable', -expect => $e_val, ); $remote_blast->submit_parameter('ENTREZ_QUERY', 'Escherichia coli[ORGN]'); $remote_blast->retrieve_parameter('ALIGNMENT_VIEW', 'Tabular'); my $inputfilename = test_input_file('ecolitst.fa'); my $attempt = 1; my $status; eval{ $status = $remote_blast->submit_blast($inputfilename); }; ok($status,'Tabular BLAST submitted'); skip("Error accessing remote BLAST interface: $@", 5) if $@; cmp_ok($remote_blast->get_rtoe, '>', 0, "Estimated retrieval time"); diag("Time remaining: ".$remote_blast->get_rtoe) if $v; my @rids = $remote_blast->each_rid; is(@rids, 1, 'should only be one RID'); skip("Wrong number of RIDs: ".scalar(@rids), 3) if @rids != 1; diag("waiting [$rids[0]]...") if $v; my $max_attempts = 20; my $rc; while (defined($rc = $remote_blast->retrieve_blast($rids[0]))) { if ( !ref($rc) ) { if ( $rc < 0 ) { skip("need a better solution for when 'Server failed to return any data'",3); } sleep 30; diag("Retrieval attempt: $attempt") if $v; $attempt++ < $max_attempts ? next : last; } else { last; } } if ($rc) { ok(1,'retrieve_blast succeeded'); $remote_blast->remove_rid($rids[0]); my $count = 0; isa_ok($rc, 'Bio::SearchIO'); while (my $result = $rc->next_result) { while ( my $hit = $result->next_hit ) { $count++; next unless ( $v > 0); print "sbjct name is ", $hit->name, "\n"; while ( my $hsp = $hit->next_hsp ) { print "score is ", $hsp->bits, "\n"; } } } is($count, 3, 'HSPs returned'); } elsif ($attempt > $max_attempts) { # have a test fail here (there should not be repeated failed attempts to # get reports) ok(0,'Exceeded maximum attempts on server to retrieve report'); diag("Timeout, did not return report after ".($attempt - 1)." attempts"); skip('Remote server timeout problems', 2); } else { # have a test fail here (whatever is returned should be eval as true and # be a SearchIO) ok(0,"Other problem on remote server, no report returned: $rc"); skip('Possible remote server problems', 2); } } SKIP: { test_skip(-tests => 6, -requires_module => 'Bio::SearchIO::blastxml'); my $remote_blast = Bio::Tools::Run::RemoteBlast->new(-prog => $prog, -data => $db, -readmethod => 'xml', -expect => $e_val, ); $remote_blast->submit_parameter('ENTREZ_QUERY', 'Escherichia coli[ORGN]'); $remote_blast->retrieve_parameter('FORMAT_TYPE', 'XML'); my $inputfilename = test_input_file('ecolitst.fa'); my $attempt = 1; my $status; eval{ $status = $remote_blast->submit_blast($inputfilename); }; ok($status,'XML BLAST submitted'); skip("Error accessing remote BLAST interface: $@", 5) if $@; cmp_ok($remote_blast->get_rtoe, '>', 0, "Estimated retrieval time"); diag("Time remaining: ".$remote_blast->get_rtoe) if $v; my @rids = $remote_blast->each_rid; is(@rids, 1, 'should only be one RID'); skip("Wrong number of RIDs: ".scalar(@rids), 3) if @rids != 1; diag("waiting [$rids[0]]...") if $v; # This blast usually takes 2x time compared to the other two my $max_attempts = 30; my $rc; while (defined($rc = $remote_blast->retrieve_blast($rids[0]))) { if ( !ref($rc) ) { if ( $rc < 0 ) { skip("need a better solution for when 'Server failed to return any data'",3); } sleep 30; diag("Retrieval attempt: $attempt") if $v; $attempt++ < $max_attempts ? next : last; } else { last; } } if ($rc) { ok(1,'retrieve_blast succeeded'); $remote_blast->remove_rid($rids[0]); my $count = 0; isa_ok($rc, 'Bio::SearchIO'); while (my $result = $rc->next_result) { while ( my $hit = $result->next_hit ) { $count++; } } is($count, 3, 'HSPs returned'); } elsif ($attempt > $max_attempts) { # have a test fail here (there should not be repeated failed attempts to # get reports) ok(0,'Exceeded maximum attempts on server to retrieve report'); diag("Timeout, did not return report after ".($attempt - 1)." attempts"); skip('Remote server timeout problems', 2); } else { # have a test fail here (whatever is returned should be eval as true and # be a SearchIO) ok(0,"Other problem on remote server, no report returned: $rc"); skip('Possible remote server problems', 2); } } release-RemoteBlast_rpsblast.t100644000765000024 737213352336533 24662 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3/t BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } # -*-Perl-*- Test Harness script for Bioperl # $Id$ # malcolm_cook@stowers.org: this test is in a separate file from # RemoteBlast.t (on which it is modelled) since there is some sort of # side-effecting between the multiple remote blasts that is causing # this test to fail, if it comes last, or the other test to fail, if # this one comes first. THIS IS A BUG EITHER IN REMOTE BLAST OR MY # UNDERSTANDING, i.e. of how to initialize it. use strict; BEGIN { use lib '.'; use Bio::Root::Test; test_begin(-tests => 7, -requires_modules => [qw(IO::String LWP::UserAgent)], -requires_networking => 1); use_ok('Bio::Tools::Run::RemoteBlast'); } my $v = test_debug(); my $inputfilename = test_input_file('ecolitst.fa'); ok( -e $inputfilename); my $remote_rpsblast = Bio::Tools::Run::RemoteBlast->new(-verbose => test_debug(), -prog => 'blastp', -data => 'cdd', -readmethod => 'blasttable', -expect => '1e-10', ); $remote_rpsblast->retrieve_parameter('ALIGNMENT_VIEW', 'Tabular'); # This is the key to getting job run using rpsblast: $Bio::Tools::Run::RemoteBlast::HEADER{'SERVICE'} = 'rpsblast'; my $attempt = 1; SKIP: { my $status; eval{ $status = $remote_rpsblast->submit_blast($inputfilename); }; ok($status,'rpsblast blasttable submitted'); skip("Error accessing remote BLAST interface: $@", 4) if $@; my @rids = $remote_rpsblast->each_rid; is(@rids, 1, 'should only be one RID'); skip("Wrong number of RIDs: ".scalar(@rids), 3) if @rids != 1; diag("Retrieving $rids[0]...\n") if $v; my $rc; while (defined($rc = $remote_rpsblast->retrieve_blast($rids[0]))) { if ( !ref($rc) ) { if ( $rc < 0 ) { skip("need a better solution for when 'Server failed to return any data'",2); } sleep 5; diag("Retrieval attempt: $attempt\n") if $v; $attempt++ < 10 ? next : last; } else { last; } } $remote_rpsblast->remove_rid($rids[0]); if ($rc) { ok(1,'retrieve_blast succeeded'); $remote_rpsblast->remove_rid($rids[0]); my $count = 0; isa_ok($rc, 'Bio::SearchIO'); while (my $result = $rc->next_result) { while ( my $hit = $result->next_hit ) { $count++; next unless ( $v > 0); print "sbjct name is ", $hit->name, "\n"; while ( my $hsp = $hit->next_hsp ) { print "score is ", $hsp->bits, "\n"; } } } cmp_ok($count, '>=', 45, 'HSPs returned'); } elsif ($attempt > 10) { # have a test fail here (there should not be repeated failed attempts to # get reports) ok(0,'Exceeded maximum attempts on server to retrieve report'); diag("Timeout, did not return report after ".($attempt - 1)." attempts"); skip('Remote server timeout problems', 2); } else { # have a test fail here (whatever is returned should be eval as true and # be a SearchIO) ok(0,"Other problem on remote server, no report returned: $rc"); skip('Possible remote server problems', 2); } } # To be a good citizen, we should restore the default NCBI service # ('plain') for future tests $Bio::Tools::Run::RemoteBlast::HEADER{'SERVICE'} = 'plain'; Run000755000765000024 013352336533 21433 5ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3/lib/Bio/ToolsRemoteBlast.pm100644000765000024 6020713352336533 24377 0ustar00cjfieldsstaff000000000000Bio-Tools-Run-RemoteBlast-1.7.3/lib/Bio/Tools/Run# # BioPerl module for Bio::Tools::Run::RemoteBlast # # Please direct questions and support issues to # # FORMERLY Cared for by Jason Stajich, Mat Wiepert # # Somewhat cared for by Roger Hall, Chris Fields (when they have time) # # Copyright Jason Stajich, Bioperl # # You may distribute this module under the same terms as perl itself # POD documentation - main docs before the code =head1 NAME Bio::Tools::Run::RemoteBlast - Object for remote execution of the NCBI Blast via HTTP =head1 SYNOPSIS #Remote-blast "factory object" creation and blast-parameter initialization use Bio::Tools::Run::RemoteBlast; use strict; my $prog = 'blastp'; my $db = 'swissprot'; my $e_val= '1e-10'; my @params = ( '-prog' => $prog, '-data' => $db, '-expect' => $e_val, '-readmethod' => 'SearchIO' ); my $factory = Bio::Tools::Run::RemoteBlast->new(@params); #change a query parameter $Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Homo sapiens [ORGN]'; #change a retrieval parameter $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'DESCRIPTIONS'} = 1000; #remove a parameter delete $Bio::Tools::Run::RemoteBlast::HEADER{'FILTER'}; #$v is just to turn on and off the messages my $v = 1; my $str = Bio::SeqIO->new(-file=>'amino.fa' , -format => 'fasta' ); #optional: send BLAST request to a cloud service provider instead of NCBI #$factory->set_url_base("http://host.my.cloud.service.provider.com/cgi-bin/blast.cgi"); while (my $input = $str->next_seq()){ #Blast a sequence against a database: #Alternatively, you could pass in a file with many #sequences rather than loop through sequence one at a time #Remove the loop starting 'while (my $input = $str->next_seq())' #and swap the two lines below for an example of that. my $r = $factory->submit_blast($input); #my $r = $factory->submit_blast('amino.fa'); print STDERR "waiting..." if( $v > 0 ); while ( my @rids = $factory->each_rid ) { foreach my $rid ( @rids ) { my $rc = $factory->retrieve_blast($rid); if( !ref($rc) ) { if( $rc < 0 ) { $factory->remove_rid($rid); } print STDERR "." if ( $v > 0 ); sleep 5; } else { my $result = $rc->next_result(); #save the output my $filename = $result->query_name()."\.out"; $factory->save_output($filename); $factory->remove_rid($rid); print "\nQuery Name: ", $result->query_name(), "\n"; while ( my $hit = $result->next_hit ) { next unless ( $v > 0); print "\thit name is ", $hit->name, "\n"; while( my $hsp = $hit->next_hsp ) { print "\t\tscore is ", $hsp->score, "\n"; } } } } } } # This example shows how to change a CGI parameter: $Bio::Tools::Run::RemoteBlast::HEADER{'MATRIX_NAME'} = 'BLOSUM45'; $Bio::Tools::Run::RemoteBlast::HEADER{'GAPCOSTS'} = '15 2'; # And this is how to delete a CGI parameter: delete $Bio::Tools::Run::RemoteBlast::HEADER{'FILTER'}; =head1 DESCRIPTION Class for remote execution of the NCBI Blast via HTTP. For a description of the many CGI parameters see: https://www.ncbi.nlm.nih.gov/BLAST/Doc/urlapi.html Various additional options and input formats are available. =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 Please do NOT contact Jason directly about this module. Please post to the bioperl mailing list (L). If you would like to be the official maintainer of this module, please volunteer on the list and we will make it official in this POD. First written by Jason Stajich, many others have helped keep it running. =head1 APPENDIX The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ =cut package Bio::Tools::Run::RemoteBlast; $Bio::Tools::Run::RemoteBlast::VERSION = '1.7.3'; use strict; use warnings; use Bio::SeqIO; use IO::String; use Bio::SearchIO; use LWP; use HTTP::Request::Common; use Bio::Root::Version; use constant { NOT_FINISHED => 0, ERR_QBSTATUS => 1, ERR_NOCONTENT => 2, ERR_HTTPFAIL => 4, ERR_QBNONSPEC => 8 }; # Bio::Root::IO is-a Bio::Root::Roo use base qw(Bio::Root::IO Exporter); our @EXPORT = qw( NOT_FINISHED ERR_QBSTATUS ERR_NOCONTENT ERR_HTTPFAIL ERR_QBNONSPEC ); our $MODVERSION = $Bio::Root::Version::VERSION; our $URLBASE = 'https://blast.ncbi.nlm.nih.gov/Blast.cgi'; # In GET/PUTPARAMS the values are regexes which validate the input. our %PUTPARAMS = ( 'AUTO_FORMAT' => '(Off|(Semi|Full)auto)', # Off, Semiauto, Fullauto 'COMPOSITION_BASED_STATISTICS' => '(0|1)', # yes, no on NCBI's site, but actually binary 0/1 'DATABASE' => '.*', 'DB_GENETIC_CODE' => '([1-9]|1[1-6]|2(1|2))', # 1..16,21,22 'DISPLAY_SORT' => '\d', 'ENDPOINTS' => '(yes|no)', # yes,no 'ENTREZ_QUERY' => '.*', 'EXPECT' => '\d+(\.\d+)?([eE]-\d+)?', # Positive double 'FILTER' => '[LRm]', # L or R or m 'GAPCOSTS' => '-?\d+(\.\d+)\s+-?\d+(\.\d+)', # Two space separated float values 'GENETIC_CODE' => '([1-9]|1[1-6]|2(1|2))', # 1..16,21,22 'HITLIST_SIZE' => '\d+', # Positive integer 'I_THRESH' => '-?\d+(\.\d+)([eE]-\d+)?', # float 'LAYOUT' => '(One|Two)Windows?', # onewindow, twowindows 'LCASE_MASK' => '(yes|no)', # yes, no 'MATRIX_NAME' => '.*', 'NUCL_PENALTY' => '-\d+', # Negative integer 'NUCL_REWARD' => '-?\d+', # Integer 'OTHER_ADVANCED' => '.*', 'PERC_IDENT' => '\d\d+', # Integer, 0-99 inclusive 'PHI_PATTERN' => '.*', 'PROGRAM' => 't?blast[pnx]', # tblastp, tblastn, tblastx, blastp, blastn, blastx 'QUERY' => '.*', 'QUERY_FILE' => '.*', 'QUERY_BELIEVE_DEFLINE' => '(yes|no)', # yes, no 'QUERY_FROM' => '\d+', # Positive integer 'QUERY_TO' => '\d+', # Positive integer 'SEARCHSP_EFF' => '\d+', # Positive integer 'SERVICE' => '(plain|p[sh]i|(rps|mega)blast)', # plain,psi,phi,rpsblast,megablast 'SHORT_QUERY_ADJUST' => '(true|false)', 'THRESHOLD' => '-?\d+', # Integer 'UNGAPPED_ALIGNMENT' => '(yes|no)', # yes, no 'WORD_SIZE' => '\d+' # Positive integer ); our %GETPARAMS = ( 'ALIGNMENTS' => '\d+', # Positive integer 'ALIGNMENT_VIEW' => '(Pairwise|(Flat)?QueryAnchored(NoIdentities)?|Tabular)', # Pairwise, QueryAnchored, QueryAnchoredNoIdentities, # FlatQueryAnchored, FlatQueryAnchoredNoIdentities, Tabular 'DATABASE_SORT' => '\d', 'DESCRIPTIONS' => '\d+', # Positive integer 'ENTREZ_LINKS_NEW_WINDOW' => '(yes|no)', # yes, no 'EXPECT_LOW' => '\d+(\.\d+)?([eE]-\d+)?', # Positive double 'EXPECT_HIGH' => '\d+(\.\d+)?([eE]-\d+)?', # Positive double 'FORMAT_ENTREZ_QUERY' => '', 'FORMAT_OBJECT' => '(Alignment|Neighbors|PSSM|SearchInfo|TaxBlast(Parent|MultiFrame)?)', # Alignment, Neighbors, PSSM, SearchInfo # TaxBlast, TaxblastParent, TaxBlastMultiFrame 'FORMAT_TYPE' => '((HT|X)ML|ASN\.1|Text)', # HTML, Text, ASN.1, XML 'NCBI_GI' => '(yes|no)', # yes, no 'NEW_VIEW' => '(true|false)', 'RID' => '.*', 'RESULTS_FILE' => '(yes|no)', # yes, no 'SERVICE' => '(plain|p[sh]i|(rps|mega)blast)', # plain,psi,phi,rpsblast,megablast 'SHOW_OVERVIEW' => '(yes|no)' # yes, no ); # Default values go in here for PUT our %HEADER = ( 'CMD' => 'Put', 'FORMAT_OBJECT' => 'Alignment', 'COMPOSITION_BASED_STATISTICS' => 'off', 'DATABASE' => 'nr', 'EXPECT' => '1e-3', 'FILTER' => 'L', 'PROGRAM' => 'blastp', 'SERVICE' => 'plain' ); # Default values go in here for GET our %RETRIEVALHEADER = ( 'CMD' => 'Get', 'ALIGNMENTS' => '50', 'ALIGNMENT_VIEW' => 'Pairwise', 'DESCRIPTIONS' => '100', 'FORMAT_TYPE' => 'Text', ); sub new { my ($caller, @args) = @_; # chained new my $self = $caller->SUPER::new(@args); # so that tempfiles are cleaned up $self->_initialize_io(); my ($prog, $data, $readmethod, $url_base) = $self->_rearrange([qw(PROG DATA READMETHOD URL_BASE)], @args); # Use these two parameters for backward-compatibility. # Overridden by PROGRAM and DATABASE if supplied. $self->submit_parameter('PROGRAM',$prog) if $prog; $self->submit_parameter('DATABASE',$data) if $data; $readmethod = 'SearchIO' unless defined $readmethod; $self->readmethod($readmethod); # Now read the rest of the parameters and set them all # PUT parameters first my @putValues = $self->_rearrange([keys %PUTPARAMS],@args); my %putNames; @putNames{keys %PUTPARAMS} = @putValues; foreach my $putName (keys %putNames) { $self->submit_parameter($putName,$putNames{$putName}); } # GET parameters second my @getValues = $self->_rearrange([keys %GETPARAMS],@args); my %getNames; @getNames{keys %GETPARAMS} = @getValues; foreach my $getName (keys %getNames) { $self->retrieve_parameter($getName,$getNames{$getName}); } # private variable to keep track of total rids $self->{'_total_rids'} = 0; $url_base ||= $URLBASE; # default to regular NCBI BLAST URL $self->set_url_base($url_base); return $self; } =head2 retrieve_parameter Title : retrieve_parameter Usage : my $db = $self->retrieve_parameter Function: Get/Set the named parameter for the retrieve_blast operation. Returns : string Args : $name : name of GET parameter $val : optional value to set the parameter to =cut sub retrieve_parameter { my ($self, $name, $val) = @_; $name = uc($name); $self->throw($name." is not a valid GET parameter.") unless exists $GETPARAMS{$name}; if (defined $val) { my $regex = $GETPARAMS{$name}; $val =~ m/^$regex$/i or $self->throw("Value ".$val." for GET parameter ".$name." does not match expression ".$regex.". Rejecting."); $RETRIEVALHEADER{$name} = $val; } return $RETRIEVALHEADER{$name}; } =head2 submit_parameter Title : submit_parameter Usage : my $db = $self->submit_parameter Function: Get/Set the named parameter for the submit_blast operation. Returns : string Args : $name : name of PUT parameter $val : optional value to set the parameter to =cut sub submit_parameter { my ($self, $name, $val) = @_; $name = uc($name); $self->throw($name." is not a valid PUT parameter.") unless exists $PUTPARAMS{$name}; if (defined $val) { my $regex = $PUTPARAMS{$name}; $val =~ m/^$regex$/i or $self->throw("Value ".$val." for PUT parameter ".$name." does not match expression ".$regex.". Rejecting."); $HEADER{$name} = $val; } return $HEADER{$name}; } =head2 header Title : header Usage : my $header = $self->header Function: Get HTTP header for blast query Returns : string Args : none =cut sub header { my ($self) = @_; return %HEADER; } =head2 readmethod Title : readmethod Usage : my $readmethod = $self->readmethod Function: Get/Set the method to read the blast report Returns : string Args : string [ blast, blasttable, xml ] =cut sub readmethod { my ($self, $val) = @_; if( defined $val ) { if ($val =~ /bplite/i) { $self->throw("Use of Bio::Tools::BPlite is deprecated; use Bio::SearchIO modules instead"); } $self->{'_readmethod'} = $val; } return $self->{'_readmethod'}; } =head2 program Title : program Usage : my $prog = $self->program Function: Get/Set the program to run. Retained for backwards-compatibility. Returns : string Args : string [ blastp, blastn, blastx, tblastn, tblastx ] =cut sub program { my ($self, $val) = @_; return $self->submit_parameter('PROGRAM',$val); } =head2 database Title : database Usage : my $db = $self->database Function: Get/Set the database to search. Retained for backwards-compatibility. Returns : string Args : string [ swissprot, nr, nt, etc... ] =cut sub database { my ($self, $val) = @_; return $self->submit_parameter('DATABASE',$val); } =head2 expect Title : expect Usage : my $expect = $self->expect Function: Get/Set the E value cutoff. Retained for backwards-compatibility. Returns : string Args : string [ '1e-4' ] =cut sub expect { my ($self, $val) = @_; return $self->submit_parameter('EXPECT',$val); } =head2 ua Title : ua Usage : my $ua = $self->ua or $self->ua($ua) Function: Get/Set a LWP::UserAgent for use Returns : reference to LWP::UserAgent Object Args : none Comments: Will create a UserAgent if none has been requested before. =cut sub ua { my ($self, $value) = @_; if( ! defined $self->{'_ua'} ) { $self->{'_ua'} = LWP::UserAgent->new(env_proxy => 1, parse_head => 0); my $nm = ref($self); $nm =~ s/::/_/g; $self->{'_ua'}->agent("bioperl-$nm/$MODVERSION"); } return $self->{'_ua'}; } =head2 proxy Title : proxy Usage : $httpproxy = $db->proxy('http') or $db->proxy(['http','ftp'], 'http://myproxy' ) Function: Get/Set a proxy for use of proxy Returns : a string indicating the proxy Args : $protocol : an array ref of the protocol(s) to set/get $proxyurl : url of the proxy to use for the specified protocol =cut sub proxy { my ($self,$protocol,$proxy) = @_; return if ( !defined $self->ua || !defined $protocol || !defined $proxy ); return $self->ua->proxy($protocol,$proxy); } sub add_rid { my ($self, @vals) = @_; foreach ( @vals ) { $self->{'_rids'}->{$_} = $self->{'_total_rids'}; $self->{'_total_rids'}++; } return scalar keys %{$self->{'_rids'}}; } sub remove_rid { my ($self, @vals) = @_; foreach ( @vals ) { delete $self->{'_rids'}->{$_}; } return scalar keys %{$self->{'_rids'}}; } sub each_rid { my ($self) = @_; # sort on key value, a little tricky... my @sort_rids = sort {$self->{'_rids'}->{$a} <=> $self->{'_rids'}->{$b}} keys %{$self->{'_rids'}}; return @sort_rids; } =head2 submit_blast Title : submit_blast Usage : $self->submit_blast([$seq1,$seq2]); Function: Submit blast jobs to ncbi blast queue on sequence(s) Returns : Blast report object as defined by $self->readmethod Args : input can be: * sequence object * array ref of sequence objects * filename of file containing fasta formatted sequences =cut sub submit_blast { my ($self, $input) = @_; my @seqs = $self->_load_input($input); my $url_base = $self->get_url_base; return 0 unless ( @seqs ); my $tcount = 0; my %header = $self->header; $header{$_} ||= $RETRIEVALHEADER{$_} foreach (keys %RETRIEVALHEADER); foreach my $seq ( @seqs ) { #If query has a fasta header, the output has the query line. $header{'QUERY'} = ">".(defined $seq->display_id() ? $seq->display_id() : ""). " ".(defined $seq->desc() ? $seq->desc() : "")."\n".$seq->seq(); my $request = POST $url_base, [%header]; $self->debug($request->as_string) if ( $self->verbose > 1); my $response = $self->ua->request( $request); if( $response->is_success ) { my @subdata = split(/\n/, $response->content ); my $count = 0; foreach ( @subdata ) { if( /^\s+RID\s+=\s+(\S+)/ ) { $count++; #$self->debug("RID: $1\n"); $self->add_rid($1); } elsif (/^\s+RTOE\s+=\s+(.*$)/) { $self->{rtoe} = $1; $count++; } last if $count >= 2; } if( $count == 0 ) { $self->warn("req was ". $request->as_string() . "\n"); $self->warn(join('', @subdata)); } $tcount += $count; } else { # should try and be a little more verbose here $self->warn("req was ". $request->as_string() . "\n" . $response->error_as_HTML); $tcount = -1; } } return $tcount; } =head2 retrieve_blast Title : retrieve_blast Usage : my $blastreport = $blastfactory->retrieve_blast($rid); Function: Attempts to retrieve a blast report from remote blast queue Returns : scalar int (constant) or Bio::SearchIO object Constants: NOT_FINISHED (= 0) : 'job not finished' code on error: ERR_QBSTATUS (= 1) : return line matches 'Status=ERROR' ERR_NOCONTENT (= 2): HTTP request successful, but no content returned ERR_HTTPFAIL (= 4) : HTTP request failed ERR_QBNONSPEC (= 8): return line matches 'ERROR' (not status line) Args : Remote Blast ID (RID) =cut sub retrieve_blast { my($self, $rid) = @_; my $url_base = $self->get_url_base; my %hdr = %RETRIEVALHEADER; $hdr{'RID'} = $rid; my $req = HTTP::Request->new( GET => $url_base."?CMD=Get&FORMAT_OBJECT=SearchInfo&RID=$rid", ); #$self->debug("SearchInfo request is " . $req->as_string()); my $response = $self->ua->request($req); if( $response->is_success ) { my $status; if($response->content =~ /Status=(WAITING|ERROR|FAILED|UNKNOWN|READY)/i ) { $status = $1; if( $status eq 'ERROR' ) { $self->warn("Server Error"); return ERR_QBSTATUS; } elsif( $status eq 'FAILED' ) { $self->warn("Request Failed"); return ERR_QBSTATUS; } } else { $self->warn("Error: No status reported\n"); } if ( $status ne 'READY' ) { return 0; } else { my ($fh,$tempfile) = $self->tempfile(); close $fh; my $req = POST $url_base, [%hdr]; $self->debug("retrieve request is " . $req->as_string()); my $response = $self->ua->request($req, $tempfile); my $blastobj; my $mthd = $self->readmethod; $mthd = ($mthd =~ /blasttable/i) ? 'blasttable' : ($mthd =~ /xml/i) ? 'blastxml' : ($mthd =~ /pull/i) ? 'blast_pull' : 'blast'; $blastobj = Bio::SearchIO->new( -file => $tempfile, -format => $mthd); ## store filename in object ## $self->file($tempfile); return $blastobj; } } else { $self->warn($response->error_as_HTML); return ERR_HTTPFAIL; } } =head2 save_output Title : saveoutput Usage : my $saveoutput = $self->save_output($filename) Function: Method to save the blast report Returns : 1 (throws error otherwise) Args : string [rid, filename] =cut sub save_output { my ($self, $filename) = @_; if( not defined $filename ) { $self->throw("Can't save blast output. You must specify a filename to save to."); } my $blastfile = $self->file; #open temp file and output file, have to filter out some HTML open my $TMP, '<', $blastfile or $self->throw("Could not read file '$blastfile': $!"); open my $SAVEOUT, '>', $filename or $self->throw("Could not write file '$filename': $!"); my $seentop = 0; while (my $line = <$TMP>) { next if ($line =~ /
/);

        if (   $line =~ /^(?:[T]?BLAST[NPX])\s*.+$/i
            or $line =~ /^RPS-BLAST\s*.+$/i
            or $line =~ /<\?xml\sversion=/
            or $line =~ /^#\s+(?:[T]?BLAST[NPX])\s*.+$/
           ) {
            $seentop = 1;
        }
        next if !$seentop;
        if ( $seentop ) {
            print $SAVEOUT $line;
        }
    }
    return 1;
}

sub _load_input {
        my ($self, $input) = @_;

        if( ! defined $input ) {
                $self->throw("Calling remote blast with no input");
        }
        my @seqs;
        if( ! ref $input ) {
                if( -e $input ) {
                        my $seqio = Bio::SeqIO->new(-format => 'fasta',
                                                                                                -file => $input);
                        while( my $seq = $seqio->next_seq ) {
                                push @seqs, $seq;
                        }
                } else {
                        $self->throw("Input $input was not a valid filename");
                }
        } elsif( ref($input) =~ /ARRAY/i ) {
                foreach ( @$input ) {
                        if( ref($_) && $_->isa('Bio::PrimarySeqI') ) {
                                push @seqs, $_;
                        } else {
                                $self->warn("Trying to add a " . ref($_) .
                                                                " but expected a Bio::PrimarySeqI");
                        }
                }
                if( ! @seqs) {
                        $self->throw("Did not pass in valid input -- no sequence objects found");
                }
        } elsif( $input->isa('Bio::PrimarySeqI') ) {
                push @seqs, $input;
        }
        return @seqs;
}

=head2 set_url_base

 Title   : set_url_base
 Usage   : $self->set_url_base($url)
 Function: Method to override the default URL to access the NCBI BLAST web service
 Returns : None
 Args    : string (URL used for remote BLAST searches)
 NOTE    : This is highly experimental; we cannot maintain support on
           web services other than the default NCBI BLAST web service at this
           time. Only some URL parameters may be supported by other BLAST
           web services.

=cut

sub set_url_base {
    my $self = shift;
    $self->{'_urlbase'} = shift if @_;
}

=head2 get_url_base

 Title   : get_url_base
 Usage   : my $url = $self->set_url_base
 Function: Get the current URL for BLAST searching
 Returns : string (URL used for remote blast searches)
 Args    : None

=cut

sub get_url_base {
    my $self = shift;
    return $self->{'_urlbase'};
}

=head2 get_rtoe

 Title   : get_rtoe
 Usage   : my $url = $self->rtoe
 Function: Retrieve the retrieval time (defined after submit_blast())
 Returns : number
 Args    : None

=cut

sub get_rtoe {
    my $self = shift;
    return $self->{rtoe};
}

1;

__END__