Genome-0.06 000755 000765 000024 0 11535205621 12444 5 ustar 00ssmith staff 000000 000000 Genome-0.06/Build.PL 000444 000765 000024 4032 11535205621 14074 0 ustar 00ssmith staff 000000 000000 #!/usr/bin/perl
# Use local perl, not some perl on an application server!
use Config;
use Module::Build;
BEGIN {
unshift @INC, "$ENV{PWD}/blib/lib";
}
my $class = Module::Build->subclass (
class => 'Pod::Builder',
code => <<'EOS',
sub ACTION_clean {
# FIXME: is this safe?
use File::Path qw/rmtree/;
rmtree "./_build";
rmtree "./blib";
rmtree "./gmt-bindoc";
rmtree "./genome-bindoc";
unlink "./Build";
unlink "./MYMETA.yml";
}
sub ACTION_ur_docs {
use File::Copy qw/copy/;
$ENV{ANSI_COLORS_DISABLED} = 1;
eval {
local @INC = @INC;
unshift @INC, 'blib/lib';
die $@ if $@;
eval "use Genome::Model::Tools";
die $@ if $@;
foreach my $exec ('genome','gmt') {
UR::Namespace::Command::Update::Pod->execute(
class_name => 'Genome::Model::Tools',
executable_name => $exec,
targets => ['Genome::Model::Tools'],
output_path => 'cmd-bindoc'
);
}
};
die "failed to extract pod: $!: $@" if ($@);
}
sub ACTION_docs {
my $self = shift;
$self->depends_on('code');
$self->depends_on('ur_docs');
$self->depends_on('manpages', 'html');
}
sub man1page_name {
my ($self, $file) = @_;
$file =~ s/.pod$//;
return $self->SUPER::man1page_name($file);
}
EOS
);
my $build = $class->new(
module_name => 'Genome',
license => 'lgpl',
requires => {
'perl' => 'v5.8.7',
'Carp' => '',
'File::Basename' => '',
'File::Temp' => '',
'IO::File' => '',
'IO::String' => '',
'Sys::Hostname' => '',
'UR' => '0.29',
'Getopt::Complete' => '',
},
cpan_client => 'cpanm',
#test_files => [qw|t/*.t t/*/*.t t/*/*/*.t t/*/*/*/*.t|],
#tap_harness_args => { jobs => 8 },
bindoc_dirs => ['cmd-bindoc'],
script_files => [ 'bin/genome', 'bin/gmt' ]
);
$build->create_build_script;
Genome-0.06/Changes 000444 000765 000024 166 11535205621 14057 0 ustar 00ssmith staff 000000 000000 Revision history for UR
0.06 2011-02-19
Updates to the installer to try a variety of packaging systems.
Genome-0.06/INSTALL 000444 000765 000024 67 11535205621 13575 0 ustar 00ssmith staff 000000 000000 perl Build.PL
./Build
./Build test
sudo Build install
Genome-0.06/LICENSE 000444 000765 000024 16743 11535205621 13641 0 ustar 00ssmith staff 000000 000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser 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
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
Genome-0.06/MANIFEST 000444 000765 000024 2015 11535205621 13730 0 ustar 00ssmith staff 000000 000000 bin/genome
bin/gmt
Build.PL
Changes
INSTALL
lib/Genome.pm
lib/Genome/Env/GENOME_DB.pm
lib/Genome/Env/GENOME_DEV_MODE.pm
lib/Genome/Env/GENOME_EXAMPLES.pm
lib/Genome/Env/GENOME_MODEL_DATA.pm
lib/Genome/Env/GENOME_MODEL_ROOT.pm
lib/Genome/Env/GENOME_MODEL_TESTDIR.pm
lib/Genome/Env/GENOME_NO_REQUIRE_USER_VERIFY.pm
lib/Genome/Env/GENOME_SW.pm
lib/Genome/Env/GENOME_SYS_NO_CLEANUP.pm
lib/Genome/Env/GENOME_TEST_DEV.pm
lib/Genome/Env/GENOME_VIEW_CACHE.pm
lib/Genome/Model/Tools.pm
lib/Genome/Model/Tools/Example1.pm
lib/Genome/Model/Tools/Example2.pm
lib/Genome/Model/Tools/Install.pm
lib/Genome/Model/Tools/Install/AptGet.pm
lib/Genome/Model/Tools/Install/Cpanm.pm
lib/Genome/Site.pm
lib/Genome/Sys.pm
lib/Genome/Vocabulary.pm
LICENSE
MANIFEST This list of files
MANIFEST.SKIP
META.yml
pod/genome-example-1.pod
pod/genome-example-2.pod
pod/genome-install-cpanm.pod
pod/genome-install.pod
pod/genome.pod
pod/gmt-example-1.pod
pod/gmt-example-2.pod
pod/gmt-install-cpanm.pod
pod/gmt-install.pod
pod/gmt.pod
README
t/Genome-Sys.t
t/Genome.t
Genome-0.06/MANIFEST.SKIP 000444 000765 000024 251 11535205621 14455 0 ustar 00ssmith staff 000000 000000 ^MYMETA.yml$
^.git
^debian/
^ubuntu-lucid/
^alt/
^dist-maint/
^MANIFEST.bak$
^_build/
^Build$
\.tar\.gz$
^blib
^genome-bindoc
^gmt-bindoc
^cmd-bindoc
^i
^.modulebuildrc
Genome-0.06/META.yml 000444 000765 000024 3452 11535205621 14056 0 ustar 00ssmith staff 000000 000000 ---
abstract: 'pipelines, tools, and data managment for genomics'
author: []
configure_requires:
Module::Build: 0.36
generated_by: 'Module::Build version 0.3607'
license: lgpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: Genome
provides:
Genome:
file: lib/Genome.pm
version: 0.06
Genome::Env::GENOME_DEV_MODE:
file: lib/Genome/Env/GENOME_DEV_MODE.pm
version: 0
Genome::Env::GENOME_MODEL_DATA:
file: lib/Genome/Env/GENOME_MODEL_DATA.pm
version: 0
Genome::Env::GENOME_MODEL_ROOT:
file: lib/Genome/Env/GENOME_MODEL_ROOT.pm
version: 0
Genome::Env::GENOME_MODEL_TESTDIR:
file: lib/Genome/Env/GENOME_MODEL_TESTDIR.pm
version: 0
Genome::Env::GENOME_NO_REQUIRE_USER_VERIFY:
file: lib/Genome/Env/GENOME_NO_REQUIRE_USER_VERIFY.pm
version: 0
Genome::Env::GENOME_VIEW_CACHE:
file: lib/Genome/Env/GENOME_VIEW_CACHE.pm
version: 0
Genome::Model::Tools:
file: lib/Genome/Model/Tools.pm
version: 0
Genome::Model::Tools::Example1:
file: lib/Genome/Model/Tools/Example1.pm
Genome::Model::Tools::Example2:
file: lib/Genome/Model/Tools/Example2.pm
Genome::Model::Tools::Install:
file: lib/Genome/Model/Tools/Install.pm
Genome::Model::Tools::Install::AptGet:
file: lib/Genome/Model/Tools/Install/AptGet.pm
Genome::Model::Tools::Install::Cpanm:
file: lib/Genome/Model/Tools/Install/Cpanm.pm
Genome::Site:
file: lib/Genome/Site.pm
version: 0
Genome::Sys:
file: lib/Genome/Sys.pm
Genome::Vocabulary:
file: lib/Genome/Vocabulary.pm
requires:
Carp: ''
File::Basename: ''
File::Temp: ''
Getopt::Complete: ''
IO::File: ''
IO::String: ''
Sys::Hostname: ''
UR: 0.29
perl: v5.8.7
resources:
license: http://opensource.org/licenses/lgpl-license.php
version: 0.06
Genome-0.06/README 000444 000765 000024 1530 11535205621 13460 0 ustar 00ssmith staff 000000 000000
NAME
Genome
genome SUBCOMMAND ...
SYNOPSIS
genome (list all available commands)
genome project ...
genome taxon ...
genome population-group ...
genome individual ...
genome sample ...
genome instrument-data ...
genome processing-profile ...
genome model ...
genome tools ...
genome disk ...
DESCRIPTION
This is the top-level tool for working with the genome modeling system and tools.
Just run it with no parameters to get a list of available commands.
Every command and sub-command supports the --help option.
OPTIONS
These depend on the specific sub-command.
DEVELOPER NOTE
Running this WITHIN a source tree under the Genome namespace will automatically "use lib" your tree.
BUGS
Report bugs to software at genome.wustl.edu
Genome-0.06/bin 000755 000765 000024 0 11535205621 13214 5 ustar 00ssmith staff 000000 000000 Genome-0.06/bin/genome 000555 000765 000024 5621 11535205621 14555 0 ustar 00ssmith staff 000000 000000 #!/usr/bin/env perl
use strict;
use warnings;
BEGIN {
# This allows the gmt command to self-serve as a tab completer for the bash shell.
# When "gmt" is run by bash as a tab completer, the code below will service the
# tab-completion request and then exit before doing any real work.
# The code is in an eval to prevent problems on systems which do not have Getopt::Complete
# installed. The code is in a BEGIN block to ensure it still runs before anything else.
if ($ENV{COMP_LINE}) {
eval "use Getopt::Complete::Cache class => 'Genome::Model::Tools', above => 1;";
exit if ($@);
}
};
use above 'Genome';
use Genome::Model::Tools;
Genome::Model::Tools->execute_with_shell_params_and_exit();
=pod
=head1 NAME
genome - bioinformatics tools for genomics
=head1 SYNOPSIS
# get a top-level list
genome
# see the MuSiC tools
genome music
# run the MuSiC smg-test tool (for example)
genome music smg-test
=head1 DESCRIPTION
The B command gives command-line access to any of the genome modeling tools
which are installed on the current system.
Each installed tool group is a sub-command.
Just type B and press for a the top-level list and drill down.
=head1 DEVELOPMENT
Installing any new Perl module with a name starting with Genome::Model::Tools will add to the tree.
=head1 AUTHORS
This software is developed by the analysis and engineering teams at
The Genome Center at Washington Univiersity in St. Louis, with funding from
the National Human Genome Research Institute. Richard K. Wilson, P.I.
Scott Abbott
Travis Abbott
Edward Belter
Paul Bender
Anthony Brummett
Todd C. Carter
Matthew Callaway
C.J. Carey
Lynn Carmichael
Ken Chen
Eric Clark
Kevin Crouse
Indraniel Das
Nathan Dees
Eric deMello
Brian Derickson
Alice Diec
David Dooling
Feiyu Du
Adam Dukes
James Eldred
Xian Fan
Ian Ferguson
Chris Harris
Amy Hawkins
Todd Hepler
Xin Hong
Shunfang Hou
Jasreet Hundal
Erik Hvatum
Mark Johnson
Krisha-Latha Kanchi
Cyriac Kandoth
Phil Kimmey
Michael Kiwala
Daniel Koboldt
Karthik Kota
Kim Kyung
David Larson
Sai Lek
Shawn Leonard
Shin Leong
Ling Lin
Justin Lolofie
Robert Long
Charles Lu
John Martin
Josh McMichael
Rick Meyer
Thomas Mooney
William Nash
Nathan Nutter
Ben Oberkfell
John Osborne
Josh Peck
Jerome Peirick
Craig Pohl
Ryan Richt
Noorus Sahar Abubucker
Gabriel Sanderson
William Schierding
Jon Schindler
William Schroeder
Christopher Schuster
Xiaoqi Shi
Scott Smith
Sasi Suruliraj
Kenneth Swanson
Jason Walker
John Wallis
Jim Weible
Mike Wendl
Todd Wylie
=head1 LICENSE
Copyright (C) 2007-2011 Washington University in St. Louis.
It is released under the Lesser GNU Public License (LGPL) version 3. See the
associated LICENSE file in this distribution.
=head1 BUGS
For defects with any software in the genome namespace,
contact genome-dev ~at~ genome.wustl.edu.
=cut
Genome-0.06/bin/gmt 000555 000765 000024 3522 11535205621 14070 0 ustar 00ssmith staff 000000 000000 #!/usr/bin/env perl
use strict;
use warnings;
BEGIN {
# This allows the gmt command to self-serve as a tab completer for the bash shell.
# When "gmt" is run by bash as a tab completer, the code below will service the
# tab-completion request and then exit before doing any real work.
# The code is in an eval to prevent problems on systems which do not have Getopt::Complete
# installed. The code is in a BEGIN block to ensure it still runs before anything else.
if ($ENV{COMP_LINE}) {
eval "use Getopt::Complete::Cache class => 'Genome::Model::Tools', above => 1;";
exit if ($@);
}
};
use above 'Genome';
use Genome::Model::Tools;
Genome::Model::Tools->execute_with_shell_params_and_exit();
=pod
=head1 NAME
gmt - bioinformatics tools for genomics
=head1 SYNOPSIS
# get a top-level list
gmt
# see the MuSiC tools
gmt music
# run the MuSiC smg-test tool
gmt music smg-test
=head1 DESCRIPTION
The B command gives command-line access to any Genome Model Tools modules
which are installed on the current system.
Each installed tool group is a sub-command.
Just type B and press for a the top-level list and drill down.
=head1 DEVELOPMENT
Installing any new Perl module with a name starting with Genome::Model::Tools will add to the tree.
=head1 AUTHORS
This software is developed by the analysis and engineering teams at
The Genome Center at Washington Univiersity in St. Louis, with funding from
the National Human Genome Research Institute.
=head1 LICENSE
This software is copyright Washington University in St. Louis, 2007-2010.
It is released under the Lesser GNU Public License (LGPL) version 3. See the
associated LICENSE file in this distribution.
=head1 BUGS
For defects with any software in the genome namespace,
contact genome-dev ~at~ genome.wustl.edu.
=cut
Genome-0.06/lib 000755 000765 000024 0 11535205621 13212 5 ustar 00ssmith staff 000000 000000 Genome-0.06/lib/Genome.pm 000444 000765 000024 12333 11535205621 15141 0 ustar 00ssmith staff 000000 000000 package Genome;
use warnings;
use strict;
our $VERSION = '0.06'; # Genome $VERSION
# software infrastructure
use UR;
# local configuration
use Genome::Site;
# environmental configuration
$ENV{GENOME_DB} ||= '/var/lib/genome/db';
$ENV{GENOME_SW} ||= '/var/lib/genome/sw';
# if the search engine is installed, configure its hooks
eval {
local $SIG{__WARN__};
local $SIG{__DIE__};
require Genome::Search;
};
# modules
use File::Temp;
use IO::String;
# account for a perl bug in pre-5.10 by applying a runtime patch to Carp::Heavy
use Carp;
use Carp::Heavy;
if ($] < 5.01) {
no warnings;
*Carp::caller_info = sub {
package
Carp;
our $MaxArgNums;
my $i = shift(@_) + 1;
package DB;
my %call_info;
@call_info{
qw(pack file line sub has_args wantarray evaltext is_require)
} = caller($i);
unless (defined $call_info{pack}) {
return ();
}
my $sub_name = Carp::get_subname(\%call_info);
if ($call_info{has_args}) {
# SEE IF WE CAN GET AROUND THE BIZARRE ARRAY COPY ERROR...
my @args = ();
if ($MaxArgNums and @args > $MaxArgNums) { # More than we want to show?
$#args = $MaxArgNums;
push @args, '...';
}
# Push the args onto the subroutine
$sub_name .= '(' . join (', ', @args) . ')';
}
$call_info{sub_name} = $sub_name;
return wantarray() ? %call_info : \%call_info;
};
use warnings;
}
# this ensures that the search system is updated when certain classes are updated
# the search system is optional so it skips this if usage above fails
if ($INC{"Genome/Search.pm"}) {
Genome::Search->register_callbacks('UR::Object');
}
# DB::single is set to this value in many places, creating a source-embedded break-point
# set it to zero in the debugger to turn off the constant stopping...
$DB::stopper = 1;
# the standard namespace declaration for a UR namespace
UR::Object::Type->define(
class_name => 'Genome',
is => ['UR::Namespace'],
english_name => 'genome',
);
# Genome supports several environment variables, found under Genome/Env
# Any GENOME_* variable which is set but does NOT corresponde to a module found will cause an exit
# (a hedge against typos such as GENOME_NNNNNO_REQUIRE_USER_VERIFY=1 leading to unexpected behavior)
for my $e (keys %ENV) {
next unless ($e =~ /^GENOME_/);
eval "use Genome::Env::$e";
if ($@) {
my $path = __FILE__;
$path =~ s/.pm$//;
my @files = glob($path . '/Env/*');
my @vars = map { /Genome\/Env\/(.*).pm/; $1 } @files;
print STDERR "Environment variable $e set to $ENV{$e} but there were errors using Genome::Env::$e:\n"
. "Available variables:\n\t"
. join("\n\t",@vars)
. "\n";
exit 1;
}
}
1;
=pod
=head1 NAME
Genome - pipelines, tools, and data managment for genomics
=head1 SYNOPSIS
use Genome;
# modules in the Genome namespace will now dynamically load
@i = Genome::InstrumentData::Illumina->get(...);
$m = Genome::Model::SomaticVariation->create(...);
=head1 DESCRIPTION
This is the base namespace module for the Genome software tree.
That tree has several primary components:
Genome::Model: a data modeling pipeline management system for genomics
Genome::Model::Tools a tree of >1000 tools and tool wrappers for genomics
Genome::* a variety of sample tracking classes with an RDBMS back-end
Only the tools system is currently released.
See B for a complete inventory of all tool packages, and for command-line access to
those tools.
=head1 AUTHORS
This software is developed by the analysis and engineering teams at
The Genome Center at Washington Univiersity in St. Louis, with funding from
the National Human Genome Research Institute. Richard K. Wilson, P.I.
Scott Abbott
Travis Abbott
Edward Belter
Paul Bender
Anthony Brummett
Todd C. Carter
Matthew Callaway
C.J. Carey
Lynn Carmichael
Ken Chen
Lei Chen
Eric Clark
Kevin Crouse
Indraniel Das
Nathan Dees
Eric deMello
Brian Derickson
Alice Diec
David Dooling
Feiyu Du
Adam Dukes
James Eldred
Xian Fan
Ian Ferguson
Chris Harris
Amy Hawkins
Todd Hepler
Xin Hong
Shunfang Hou
Jasreet Hundal
Erik Hvatum
Mark Johnson
Krisha-Latha Kanchi
Cyriac Kandoth
Phil Kimmey
Michael Kiwala
Daniel Koboldt
Karthik Kota
Kim Kyung
David Larson
Sai Lek
Shawn Leonard
Shin Leong
Ling Lin
Justin Lolofie
Robert Long
Charles Lu
John Martin
Josh McMichael
Rick Meyer
Thomas Mooney
William Nash
Nathan Nutter
Ben Oberkfell
John Osborne
Josh Peck
Jerome Peirick
Craig Pohl
Ryan Richt
Noorus Sahar Abubucker
Gabriel Sanderson
William Schierding
Jon Schindler
William Schroeder
Christopher Schuster
Xiaoqi Shi
Scott Smith
Sasi Suruliraj
Kenneth Swanson
Jason Walker
John Wallis
Jim Weible
Mike Wendl
Todd Wylie
=head1 LICENSE
Copyright (C) 2007-2011 Washington University in St. Louis.
It is released under the Lesser GNU Public License (LGPL) version 3. See the
associated LICENSE file in this distribution.
=head1 BUGS
For defects with any software in the genome namespace,
contact genome-dev ~at~ genome.wustl.edu.
=cut
Genome-0.06/lib/Genome 000755 000765 000024 0 11535205621 14424 5 ustar 00ssmith staff 000000 000000 Genome-0.06/lib/Genome/Site.pm 000444 000765 000024 4071 11535205621 16025 0 ustar 00ssmith staff 000000 000000 package Genome::Site;
use strict;
use warnings;
our $VERSION = $Genome::VERSION;
BEGIN {
if (my $config = $ENV{GENOME_CONFIG}) {
# call the specified configuration module;
eval "use $config";
die $@ if $@;
}
else {
# look for a config module matching all or part of the hostname
use Sys::Hostname;
my $hostname = Sys::Hostname::hostname();
my @hwords = reverse split('\.',$hostname);
while (@hwords) {
my $pkg = 'Genome::Site::' . join("::",@hwords);
local $SIG{__DIE__};
local $SIG{__WARN__};
eval "use $pkg";
if ($@) {
pop @hwords;
next;
}
else {
last;
}
}
}
}
# This module potentially conflicts to the perl-supplied Config.pm if you've
# set up your @INC or -I options incorrectly. For example, you used -I /path/to/modules/Genome/
# instead of -I /path/to/modules/. Many modules use the real Config.pm to get info and
# you'll get wierd failures if it loads this module instead of the right one.
{
my @caller_info = caller(0);
if ($caller_info[3] eq '(eval)' and $caller_info[6] eq 'Config.pm') {
die "package Genome::Config was loaded from a 'use Config' statement, and is not want you wanted. Are your \@INC and -I options correct?";
}
}
1;
=pod
=head1 NAME
Genome::Site - hostname oriented site-based configuration
=head1 DESCRIPTION
Use the fully-qualified hostname to look up site-based configuration.
=head1 AUTHORS
This software is developed by the analysis and engineering teams at
The Genome Center at Washington Univiersity in St. Louis, with funding from
the National Human Genome Research Institute.
=head1 LICENSE
This software is copyright Washington University in St. Louis. It is released under
the Lesser GNU Public License (LGPL) version 3. See the associated LICENSE file in
this distribution.
=head1 BUGS
For defects with any software in the genome namespace,
contact genome-dev@genome.wustl.edu.
=cut
Genome-0.06/lib/Genome/Sys.pm 000444 000765 000024 30560 11535205621 15721 0 ustar 00ssmith staff 000000 000000 package Genome::Sys;
use strict;
use warnings;
use Genome;
use Cwd;
class Genome::Sys {
# TODO: remove all cases of inheritance
#is => 'UR::Singleton',
};
sub dbpath {
my ($class, $name, $version) = @_;
unless ($version) {
die "Genome::Sys dbpath must be called with a database name and a version. Use 'latest' for the latest installed version.";
}
my $base_dirs = $ENV{"GENOME_DB"} ||= '/var/lib/genome/db';
return $class->_find_in_path($base_dirs, "$name/$version");
}
sub swpath {
my ($class, $name, $version) = @_;
unless ($version) {
die "Genome::Sys swpath must be called with a database name and a version. Use 'latest' for the latest installed version.";
}
my $base = $ENV{"GENOME_SW"} ||= '/var/lib/genome/sw';
return join("/",$base,$name,$version);
}
sub _find_in_path {
my ($class, $base_dirs, $subdir) = @_;
my @base_dirs = split(':',$base_dirs);
my @dirs =
map { -l $_ ? Cwd::abs_path($_) : ($_) }
map {
my $path = join("/",$_,$subdir);
(-e $path ? ($path) : ())
}
@base_dirs;
return $dirs[0];
}
# temp file management
sub _temp_directory_prefix {
my $self = shift;
my $base = join("_", map { lc($_) } split('::',$self->class));
return $base;
}
our $base_temp_directory;
sub base_temp_directory {
my $self = shift;
my $class = ref($self) || $self;
my $template = shift;
my $id;
if (ref($self)) {
return $self->{base_temp_directory} if $self->{base_temp_directory};
$id = $self->id;
}
else {
# work as a class method
return $base_temp_directory if $base_temp_directory;
$id = '';
}
unless ($template) {
my $prefix = $self->_temp_directory_prefix();
$prefix ||= $class;
my $time = $self->__context__->now;
$time =~ s/[\s\: ]/_/g;
$template = "/gm-$prefix-$time-$id-XXXX";
$template =~ s/ /-/g;
}
# See if we're running under LSF and LSF gave us a directory that will be
# auto-cleaned up when the job terminates
my $tmp_location = $ENV{'TMPDIR'} || "/tmp";
if ($ENV{'LSB_JOBID'}) {
my $lsf_possible_tempdir = sprintf("%s/%s.tmpdir", $ENV{'TMPDIR'}, $ENV{'LSB_JOBID'});
$tmp_location = $lsf_possible_tempdir if (-d $lsf_possible_tempdir);
}
# tempdir() thows its own exception if there's a problem
# For debugging purposes, allow cleanup to be disabled
my $cleanup = 1;
if($ENV{'GENOME_SYS_NO_CLEANUP'}) {
$cleanup = 0;
}
my $dir = File::Temp::tempdir($template, DIR=>$tmp_location, CLEANUP => $cleanup);
$self->create_directory($dir);
if (ref($self)) {
return $self->{base_temp_directory} = $dir;
}
else {
# work as a class method
return $base_temp_directory = $dir;
}
unless ($dir) {
Carp::croak("Unable to determine base_temp_directory");
}
return $dir;
}
our $anonymous_temp_file_count = 0;
sub create_temp_file_path {
my $self = shift;
my $name = shift;
unless ($name) {
$name = 'anonymous' . $anonymous_temp_file_count++;
}
my $dir = $self->base_temp_directory;
my $path = $dir .'/'. $name;
if (-e $path) {
Carp::croak "temp path '$path' already exists!";
}
if (!$path or $path eq '/') {
Carp::croak("create_temp_file_path() failed");
}
return $path;
}
sub create_temp_file {
my $self = shift;
my $path = $self->create_temp_file_path(@_);
my $fh = IO::File->new($path, '>');
unless ($fh) {
Carp::croak "Failed to create temp file $path: $!";
}
return ($fh,$path) if wantarray;
return $fh;
}
sub create_temp_directory {
my $self = shift;
my $path = $self->create_temp_file_path(@_);
$self->create_directory($path);
return $path;
}
sub create_directory {
my ($self, $directory) = @_;
unless ( defined $directory ) {
Carp::croak("Can't create_directory: No path given");
}
# FIXME do we want to throw an exception here? What if the user expected
# the directory to be created, not that it already existed
return $directory if -d $directory;
my $errors;
# make_path may throw its own exceptions...
File::Path::make_path($directory, { mode => 02775, error => \$errors });
if ($errors and @$errors) {
my $message = "create_directory for path $directory failed:\n";
foreach my $err ( @$errors ) {
my($path, $err_str) = %$err;
$message .= "Pathname " . $path ."\n".'General error' . ": $err_str\n";
}
Carp::croak($message);
}
unless (-d $directory) {
Carp::croak("No error from 'File::Path::make_path', but failed to create directory ($directory)");
}
return $directory;
}
sub create_symlink {
my ($self, $target, $link) = @_;
unless ( defined $target ) {
Carp::croak("Can't create_symlink: no target given");
}
unless ( defined $link ) {
Carp::croak("Can't create_symlink: no 'link' given");
}
unless ( -e $target ) {
Carp::croak("Cannot create link ($link) to target ($target): target does not exist");
}
if ( -e $link ) { # the link exists and points to spmething
Carp::croak("Link ($link) for target ($target) already exists.");
}
if ( -l $link ) { # the link exists, but does not point to something
Carp::croak("Link ($link) for target ($target) is already a link.");
}
unless ( symlink($target, $link) ) {
Carp::croak("Can't create link ($link) to $target\: $!");
}
return 1;
}
sub _open_file {
my ($self, $file, $rw) = @_;
if ($file eq '-') {
if ($rw eq 'r') {
return 'STDIN';
}
elsif ($rw eq 'w') {
return 'STDOUT';
}
else {
die "cannot open '-' with access '$rw': r = STDIN, w = STDOUT!!!";
}
}
my $fh = IO::File->new($file, $rw);
return $fh if $fh;
Carp::croak("Can't open file ($file) with access '$rw': $!");
}
sub validate_file_for_reading {
my ($self, $file) = @_;
unless ( defined $file ) {
Carp::croak("Can't validate_file_for_reading: No file given");
}
if ($file eq '-') {
return 1;
}
unless (-e $file ) {
Carp::croak("File ($file) does not exist");
}
unless (-f $file) {
Carp::croak("File ($file) exists but is not a plain file");
}
unless ( -r $file ) {
Carp::croak("Do not have READ access to file ($file)");
}
return 1;
}
sub open_file_for_reading {
my ($self, $file) = @_;
$self->validate_file_for_reading($file)
or return;
# _open_file throws its own exception if it doesn't work
return $self->_open_file($file, 'r');
}
sub shellcmd {
# execute a shell command in a standard way instead of using system()\
# verifies inputs and ouputs, and does detailed logging...
# TODO: add IPC::Run's w/ timeout but w/o the io redirection...
my ($self,%params) = @_;
my $cmd = delete $params{cmd};
my $output_files = delete $params{output_files} ;
my $input_files = delete $params{input_files};
my $output_directories = delete $params{output_directories} ;
my $input_directories = delete $params{input_directories};
my $allow_failed_exit_code = delete $params{allow_failed_exit_code};
my $allow_zero_size_output_files = delete $params{allow_zero_size_output_files};
my $skip_if_output_is_present = delete $params{skip_if_output_is_present};
$skip_if_output_is_present = 1 if not defined $skip_if_output_is_present;
if (%params) {
my @crap = %params;
Carp::confess("Unknown params passed to shellcmd: @crap");
}
if ($output_files and @$output_files) {
my @found_outputs = grep { -e $_ } grep { not -p $_ } @$output_files;
if ($skip_if_output_is_present
and @$output_files == @found_outputs
) {
$self->status_message(
"SKIP RUN (output is present): $cmd\n\t"
. join("\n\t",@found_outputs)
);
return 1;
}
}
if ($input_files and @$input_files) {
my @missing_inputs = grep { not -s $_ } grep { not -p $_ } @$input_files;
if (@missing_inputs) {
Carp::croak("CANNOT RUN (missing input files): $cmd\n\t"
. join("\n\t", map { -e $_ ? "(empty) $_" : $_ } @missing_inputs));
}
}
if ($input_directories and @$input_directories) {
my @missing_inputs = grep { not -d $_ } @$input_directories;
if (@missing_inputs) {
Carp::croak("CANNOT RUN (missing input directories): $cmd\n\t"
. join("\n\t", @missing_inputs));
}
}
$self->status_message("RUN: $cmd");
my $exit_code = system($cmd);
if ( $exit_code == -1 ) {
Carp::croak("ERROR RUNNING COMMAND. Failed to execute: $cmd");
} elsif ( $exit_code & 127 ) {
my $signal = $exit_code & 127;
my $withcore = ( $exit_code & 128 ) ? 'with' : 'without';
Carp::croak("COMMAND KILLED. Signal $signal, $withcore coredump: $cmd");
} elsif ($exit_code >> 8 != 0) {
$exit_code = $exit_code >> 8;
$DB::single = $DB::stopper;
if ($allow_failed_exit_code) {
Carp::carp("TOLERATING Exit code $exit_code, msg $! from: $cmd");
} else {
Carp::croak("ERROR RUNNING COMMAND. Exit code $exit_code, msg $! from: $cmd");
}
}
my @missing_output_files;
if ($output_files and @$output_files) {
@missing_output_files = grep { not -s $_ } grep { not -p $_ } @$output_files;
}
if (@missing_output_files) {
if ($allow_zero_size_output_files
and @$output_files == @missing_output_files
) {
for my $output_file (@$output_files) {
Carp::carp("ALLOWING zero size output file '$output_file' for command: $cmd");
my $fh = $self->open_file_for_writing($output_file);
unless ($fh) {
Carp::croak("failed to open $output_file for writing to replace missing output file: $!");
}
$fh->close;
}
@missing_output_files = ();
}
}
my @missing_output_directories;
if ($output_directories and @$output_directories) {
@missing_output_directories = grep { not -s $_ } grep { not -p $_ } @$output_directories;
}
if (@missing_output_files or @missing_output_directories) {
for (@$output_files) { unlink $_ or Carp::croak("Can't unlink $_: $!"); }
Carp::croak("MISSING OUTPUTS! "
. join(', ', @missing_output_files)
. " "
. join(', ', @missing_output_directories));
}
return 1;
}
1;
__END__
methods => [
dbpath => {
takes => ['name','version'],
uses => [],
returns => 'FilesystemPath',
doc => 'returns the path to a data set',
},
swpath => {
takes => ['name','version'],
uses => [],
returns => 'FilesystemPath',
doc => 'returns the path to an application installation',
},
]
# until we get the above into ur...
=pod
=head1 NAME
Genome::Sys
=head1 VERSION
This document describes Genome::Sys version 0.05.
=head1 SYNOPSIS
use Genome;
my $dir = Genome::Sys->dbpath('cosmic', 'latest');
=head1 DESCRIPTION
Genome::Sys is a simple layer on top of OS-level concerns,
including those automatically handled by the analysis system,
like database cache locations.
=head1 METHODS
=head2 swpath($name,$version)
Return the path to a given executable, library, or package.
This is a wrapper for the OS-specific strategy for managing multiple versions of software packages,
(i.e. /etc/alternatives for Debian/Ubuntu)
The GENOME_SW environment variable contains a colon-separated lists of paths which this falls back to.
The default value is /var/lib/genome/sw/.
=head2 dbpath($name,$version)
Return the path to the preprocessed copy of the specified database.
(This is in lieu of a consistent API for the database in question.)
The GENOME_DB environment variable contains a colon-separated lists of paths which this falls back to.
The default value is /var/lib/genome/db/.
=cut
Genome-0.06/lib/Genome/Vocabulary.pm 000444 000765 000024 475 11535205621 17214 0 ustar 00ssmith staff 000000 000000 package Genome::Vocabulary;
use warnings;
use strict;
use Genome;
class Genome::Vocabulary {
is => 'UR::Vocabulary',
};
1;
=pod
=head1 NAME
Genome::Vocabulary
=head1 DESCRIPTION
This module is used by the Genome namespace to identify domain-specific terminology in the software reflection system.
=cut
Genome-0.06/lib/Genome/Env 000755 000765 000024 0 11535205621 15154 5 ustar 00ssmith staff 000000 000000 Genome-0.06/lib/Genome/Env/GENOME_DB.pm 000444 000765 000024 270 11535205621 17145 0 ustar 00ssmith staff 000000 000000 =pod
=head1 NAME
GENOME_DB
=head1 DESCRIPTION
The GENOME_DB environment variable is the root directory for data base storage.
=head1 DEFAULT VALUE
/var/lib/genome/db/
=cut
1;
Genome-0.06/lib/Genome/Env/GENOME_DEV_MODE.pm 000444 000765 000024 112 11535205621 20075 0 ustar 00ssmith staff 000000 000000 package Genome::Env::GENOME_DEV_MODE;
our $VERSION = $Genome::VERSION;
1;
Genome-0.06/lib/Genome/Env/GENOME_EXAMPLES.pm 000444 000765 000024 114 11535205621 20073 0 ustar 00ssmith staff 000000 000000 package Genome::Env::GENOME_MODEL_DATA;
our $VERSION = $Genome::VERSION;
1;
Genome-0.06/lib/Genome/Env/GENOME_MODEL_DATA.pm 000444 000765 000024 114 11535205621 20306 0 ustar 00ssmith staff 000000 000000 package Genome::Env::GENOME_MODEL_DATA;
our $VERSION = $Genome::VERSION;
1;
Genome-0.06/lib/Genome/Env/GENOME_MODEL_ROOT.pm 000444 000765 000024 114 11535205621 20360 0 ustar 00ssmith staff 000000 000000 package Genome::Env::GENOME_MODEL_ROOT;
our $VERSION = $Genome::VERSION;
1;
Genome-0.06/lib/Genome/Env/GENOME_MODEL_TESTDIR.pm 000444 000765 000024 117 11535205621 20716 0 ustar 00ssmith staff 000000 000000 package Genome::Env::GENOME_MODEL_TESTDIR;
our $VERSION = $Genome::VERSION;
1;
Genome-0.06/lib/Genome/Env/GENOME_NO_REQUIRE_USER_VERIFY.pm 000444 000765 000024 130 11535205621 22305 0 ustar 00ssmith staff 000000 000000 package Genome::Env::GENOME_NO_REQUIRE_USER_VERIFY;
our $VERSION = $Genome::VERSION;
1;
Genome-0.06/lib/Genome/Env/GENOME_SW.pm 000444 000765 000024 632 11535205621 17213 0 ustar 00ssmith staff 000000 000000 =pod
=head1 NAME
GENOME_SW
=head1 DESCRIPTION
The GENOME_SW environment variable is the root directory for data base storage.
=head1 DEFAULT VALUE
The Genome::Sys module typically leans on OS package management where advanced package management exists (Debian/Ubuntu, RedHat, etc.)
This path is a fallback for systems with locally produced software which is not packaged:
/var/lib/genome/sw
=cut
1;
Genome-0.06/lib/Genome/Env/GENOME_SYS_NO_CLEANUP.pm 000444 000765 000024 340 11535205621 21077 0 ustar 00ssmith staff 000000 000000 =pod
=head1 NAME
GENOME_TEST_DEV
=head1 DESCRIPTION
The GENOME_SYS_NO_CLEANUP environment variable, when set to true, will not clean up temporary files/directories on process exit
=head1 DEFAULT VALUE
unset
=cut
1;
Genome-0.06/lib/Genome/Env/GENOME_TEST_DEV.pm 000444 000765 000024 314 11535205621 20134 0 ustar 00ssmith staff 000000 000000 =pod
=head1 NAME
GENOME_TEST_DEV
=head1 DESCRIPTION
The GENOME_TEST_DEV environment variable, when set to true, runs tests
for incomplete/experiemental code.
=head1 DEFAULT VALUE
unset
=cut
1;
Genome-0.06/lib/Genome/Env/GENOME_VIEW_CACHE.pm 000444 000765 000024 115 11535205621 20313 0 ustar 00ssmith staff 000000 000000 package Genome::Env::GENOME_VIEW_CACHE;
our $VERSION = $Genome::VERSION;
1;
Genome-0.06/lib/Genome/Model 000755 000765 000024 0 11535205621 15464 5 ustar 00ssmith staff 000000 000000 Genome-0.06/lib/Genome/Model/Tools.pm 000444 000765 000024 3420 11535205621 17256 0 ustar 00ssmith staff 000000 000000 package Genome::Model::Tools;
use strict;
use warnings;
use Genome;
our $VERSION = $Genome::VERSION;
class Genome::Model::Tools {
is => 'Command::Tree',
doc => 'bioinformatics tools for genomics'
};
sub help_sub_commands {
my $self = shift;
my $txt = $self->SUPER::help_sub_commands(@_);
unless ($txt) {
$txt = "ERROR: *** no genome modeling tools installed yet! ***";
}
return $txt;
}
sub doc_copyright_license {
return < for details on how to write commands.
=item
See B for details on writing UR classes in general.
=back
=head1 AUTHORS
This software is developed by the analysis and engineering teams at
The Genome Center at Washington Univiersity in St. Louis, with funding from
the National Human Genome Research Institute.
=head1 LICENSE
This software is copyright Washington University in St. Louis. It is released under
the Lesser GNU Public License (LGPL) version 3. See the associated LICENSE file in
this distribution.
=head1 BUGS
For defects with any software in the genome namespace,
contact genome-dev@genome.wustl.edu.
=head1 SEE ALSO
B, B
=cut
Genome-0.06/lib/Genome/Model/Tools 000755 000765 000024 0 11535205621 16564 5 ustar 00ssmith staff 000000 000000 Genome-0.06/lib/Genome/Model/Tools/Example1.pm 000444 000765 000024 5766 11535205621 20751 0 ustar 00ssmith staff 000000 000000
package Genome::Model::Tools::Example1; # rename this when you give the module file a different name <--
use strict;
use warnings;
use Genome; # using the namespace authorizes Class::Autouse to lazy-load modules under it
class Genome::Model::Tools::Example1 {
is => 'Command',
has => [ # specify the command's single-value properties (parameters) <---
foo => { is => 'Text', doc => "some foozy thing" },
bar => { is => 'Boolean', doc => "a flag to turn on and off", is_optional => 1 },
baz => { is => 'My::Object', doc => "this won't appear as a command-line option since it's not a primative", is_optional => 1 },
],
has_many => [ # specify the command's multi-value properties (parameters) <---
infiles => { is => 'Text', doc => 'this is a list of values' },
outfiles => { is => 'Text', doc => 'also a list of values' },
bare_args => { is => 'Text', shell_args_position => 1, is_optional => 1, doc => 'list of bare arguments' },
],
};
sub _is_hidden_in_docs { $ENV{GENOME_EXAMPLES} ? () : 1 }
sub sub_command_sort_position { -2 }
sub help_brief { # keep this to just a few words <---
"WRITE A ONE-LINE DESCRIPTION HERE"
}
sub help_synopsis { # replace the text below with real examples <---
return <SUPER::create(%params);
# # ..do initialization here
# return $self;
#}
sub execute { # replace with real execution logic.
my $self = shift;
print "Running example command:\n"
. " foo is " . (defined $self->foo ? $self->foo : '')
. "\n"
. " bar is " . (defined $self->bar ? $self->bar : '')
. "\n"
. " baz is " . (defined $self->baz ? $self->bar : '')
. "\n"
. " infiles are :" . join(',',$self->infiles)
. "\n"
. " outfiles are :" . join(',',$self->outfiles)
. "\n"
. " bare args are: " . ($self->bare_args ? join(",",$self->bare_args) : '')
. "\n";
return 1; # exits 0 for true, exits 1 for false (retval/exit code mapping is overridable)
}
1;
Genome-0.06/lib/Genome/Model/Tools/Example2.pm 000444 000765 000024 2555 11535205621 20743 0 ustar 00ssmith staff 000000 000000
package Genome::Model::Tools::Example2;
use strict;
use warnings;
use Genome;
class Genome::Model::Tools::Example2 {
is => 'Command',
has => [
in => { shell_args_position => 1 },
out => { shell_args_position => 2 },
],
};
sub _is_hidden_in_docs { $ENV{GENOME_EXAMPLES} ? () : 1 }
sub sub_command_sort_position { -1 }
sub help_brief { # keep this to just a few words <---
"WRITE A ONE-LINE DESCRIPTION HERE"
}
sub help_synopsis { # replace the text below with real examples <---
return <in ? $self->in : '')
. "\n"
. " out is " . (defined $self->out ? $self->out : '')
. "\n";
return 1; # exits 0 for true, exits 1 for false (retval/exit code mapping is overridable)
}
1;
Genome-0.06/lib/Genome/Model/Tools/Install.pm 000444 000765 000024 3555 11535205621 20675 0 ustar 00ssmith staff 000000 000000 package Genome::Model::Tools::Install;
use strict;
use warnings;
use Genome;
use IPC::Cmd qw/can_run/;
class Genome::Model::Tools::Install {
is => 'Command',
has => [
name => { is => 'Text', is_optional => 1, shell_args_position => 1,
doc => 'tool name', },
],
doc => 'install more modules'
};
sub is_sub_command_delegator { 0 };
sub help_synopsis {
return <warning_message("$executable is installed on your system, but no $delegate module was found!");
$strategy = undef;
$delegate = undef;
next;
}
else {
$self->status_message("install via $strategy...");
last;
}
}
else {
# print "no $executable installed\n";
}
}
unless ($strategy) {
$self->error_message("No installation tools available! Failed to find any of these: @STRATEGIES. Your system is in need of help. :(");
return;
}
return $delegate->execute(name => $self->name);
}
sub sub_command_sort_position { 9999 }
1;
Genome-0.06/lib/Genome/Model/Tools/Install 000755 000765 000024 0 11535205621 20172 5 ustar 00ssmith staff 000000 000000 Genome-0.06/lib/Genome/Model/Tools/Install/AptGet.pm 000444 000765 000024 2323 11535205621 22051 0 ustar 00ssmith staff 000000 000000 package Genome::Model::Tools::Install::AptGet;
use strict;
use warnings;
use Genome;
use IPC::Cmd qw/can_run/;
class Genome::Model::Tools::Install::AptGet {
is => 'Command',
has => [
name => { is => 'Text', is_optional => 1, shell_args_position => 1, doc => 'tool name', },
],
doc => 'install modules via APT'
};
sub execute {
my $self = shift;
my $module = $self->name;
unless ($module) {
$self->error_message("Please specify the name of a tool to install.");
return;
}
my $path = can_run('apt-get');
chomp $path;
unless ($path) {
unless (can_run('apt-get')) {
$self->error_message("Your system does not have apt-get installed!");
return;
}
}
$self->status_message("searching for $module...");
my $cmd = "$path -q update && $path search \'^$module\$\'";
my $info = `$cmd`;
unless ($info) {
$self->status_message("Failed to find module $module!");
return;
}
my $rv = system "$path install $module";
$rv /= 256;
if ($rv) {
$self->error_message("Errors installing $module!");
return;
}
return 1;
}
sub sub_command_sort_position { 9999 }
1;
Genome-0.06/lib/Genome/Model/Tools/Install/Cpanm.pm 000444 000765 000024 4640 11535205621 21727 0 ustar 00ssmith staff 000000 000000 package Genome::Model::Tools::Install::Cpanm;
use strict;
use warnings;
use Genome;
class Genome::Model::Tools::Install::Cpanm {
is => 'Command',
has => [
name => { is => 'Text', is_optional => 1, shell_args_position => 1,
doc => 'tool name', },
],
doc => 'install modules from CPAN'
};
sub execute {
my $self = shift;
my $name = $self->name;
unless ($name) {
$self->error_message("Please specify the name of a tool to install.");
$self->status_message("Checking CPAN for genome modeling tools...");
my $cmd = "curl --progress-bar -L 'http://search.cpan.org/search?query=Genome::Model::Tools&mode=all' | grep class=sr";
my @rows = `$cmd`;
chomp @rows;
my @modules;
for my $row (@rows) {
if ( my ($module) = ($row =~ m{lib/(Genome/Model/Tools/.*\.pm)}) ) {
push @modules, $module;
}
}
if (@modules) {
$self->status_message(join("\n",@modules));
}
else {
$self->status_message("*** no uninstalled modules available ***");
}
return;
}
my @words = map { ucfirst(lc($_)) } split("-", $name);
my $module = 'Genome::Model::Tools::' . join('',@words);
my $path = `which cpanm`;
chomp $path;
unless ($path) {
unless (`which curl`) {
$self->error_message("Your system does not have cpanm or curl installed. Please install one of these to use the genome installer!");
return;
}
$self->status_message("Installing cpanm...");
my $cmd = "curl --progress-bar -L http://cpanmin.us | perl - --sudo App::cpanminus";
system $cmd;
$path = `which cpanm`;
unless ($path) {
$self->status_message("Failed to install cpanm! Attempting direct stream from the Internet...");
$path = "curl --progress-bar -L http://cpanmin.us | perl - --sudo ";
}
}
$self->status_message("searching for $module...");
my $cmd = "$path --info $module";
my $info = `$cmd`;
unless ($info) {
$self->status_message("Failed to find module $module!");
return;
}
my $rv = system "$path --progress-bar $module";
$rv /= 256;
if ($rv) {
$self->error_message("Errors installing $module!");
return;
}
return 1;
}
sub sub_command_sort_position { 9999 }
1;
Genome-0.06/pod 000755 000765 000024 0 11535205621 13226 5 ustar 00ssmith staff 000000 000000 Genome-0.06/pod/genome-example-1.pod 000444 000765 000024 1556 11535205621 17137 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
genome example-1 - WRITE A ONE-LINE DESCRIPTION HERE
=head1 SYNOPSIS
genome example-1 --foo=? --infiles=?[,?] --outfiles=?[,?] [--bar] [BARE-ARGS]
gmt example1 --bar
gmt example1 --foo=hello
gmt example1 --foo=goodbye --bar
gmt example1 --foo=hello barearg1 barearg2 barearg3
gmt example1 --infiles=a,b,c --outfiles=d,e,f
=head1 REQUIRED ARGUMENTS
=over
=item foo I
some foozy thing
=item infiles I
this is a list of values
=item outfiles I
also a list of values
=back
=head1 OPTIONAL ARGUMENTS
=over
=item bar I
a flag to turn on and off
=item nobar I
Make bar 'false'
=item BARE-ARGS I
list of bare arguments
=back
=head1 DESCRIPTION:
This is a dummy command. Copy, paste and modify the module!
CHANGE THIS BLOCK OF TEXT IN THE MODULE TO CHANGE THE HELP OUTPUT.
=cut
Genome-0.06/pod/genome-example-2.pod 000444 000765 000024 616 11535205621 17114 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
genome example-2 - WRITE A ONE-LINE DESCRIPTION HERE
=head1 SYNOPSIS
genome example-2 IN OUT
gmt example2 IN OUT
=head1 REQUIRED ARGUMENTS
=over
=item IN
(undocumented)
=item OUT
(undocumented)
=back
=head1 DESCRIPTION:
This is a dummy command. Copy, paste and modify the module!
CHANGE THIS BLOCK OF TEXT IN THE MODULE TO CHANGE THE HELP OUTPUT.
=cut
Genome-0.06/pod/genome-install-cpanm.pod 000444 000765 000024 406 11535205621 20061 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
genome install cpanm - install modules from CPAN
=head1 SYNOPSIS
genome install cpanm [NAME]
=head1 OPTIONAL ARGUMENTS
=over
=item NAME I
tool name
=back
=head1 DESCRIPTION:
!!! define help_detail() in module
=cut
Genome-0.06/pod/genome-install.pod 000444 000765 000024 624 11535205621 16767 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
genome install - install more modules
=head1 SYNOPSIS
genome install [NAME]
genome install music
genome music ...
genome install annotate
genome annotate ...
=head1 OPTIONAL ARGUMENTS
=over
=item NAME I
tool name
=back
=head1 DESCRIPTION:
Install new geomics software.
When run with no parameters, the available tools will be listed by name.
=cut
Genome-0.06/pod/genome.pod 000444 000765 000024 310 11535205621 15313 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
genome - bioinformatics tools for genomics
=head1 VERSION
This document describes genome version 0.05.
=head1 SUB-COMMANDS
install [NAME] install more modules
=cut
Genome-0.06/pod/gmt-example-1.pod 000444 000765 000024 1550 11535205621 16446 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
gmt example-1 - WRITE A ONE-LINE DESCRIPTION HERE
=head1 SYNOPSIS
gmt example-1 --foo=? --infiles=?[,?] --outfiles=?[,?] [--bar] [BARE-ARGS]
gmt example1 --bar
gmt example1 --foo=hello
gmt example1 --foo=goodbye --bar
gmt example1 --foo=hello barearg1 barearg2 barearg3
gmt example1 --infiles=a,b,c --outfiles=d,e,f
=head1 REQUIRED ARGUMENTS
=over
=item foo I
some foozy thing
=item infiles I
this is a list of values
=item outfiles I
also a list of values
=back
=head1 OPTIONAL ARGUMENTS
=over
=item bar I
a flag to turn on and off
=item nobar I
Make bar 'false'
=item BARE-ARGS I
list of bare arguments
=back
=head1 DESCRIPTION:
This is a dummy command. Copy, paste and modify the module!
CHANGE THIS BLOCK OF TEXT IN THE MODULE TO CHANGE THE HELP OUTPUT.
=cut
Genome-0.06/pod/gmt-example-2.pod 000444 000765 000024 610 11535205621 16423 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
gmt example-2 - WRITE A ONE-LINE DESCRIPTION HERE
=head1 SYNOPSIS
gmt example-2 IN OUT
gmt example2 IN OUT
=head1 REQUIRED ARGUMENTS
=over
=item IN
(undocumented)
=item OUT
(undocumented)
=back
=head1 DESCRIPTION:
This is a dummy command. Copy, paste and modify the module!
CHANGE THIS BLOCK OF TEXT IN THE MODULE TO CHANGE THE HELP OUTPUT.
=cut
Genome-0.06/pod/gmt-install-cpanm.pod 000444 000765 000024 400 11535205621 17370 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
gmt install cpanm - install modules from CPAN
=head1 SYNOPSIS
gmt install cpanm [NAME]
=head1 OPTIONAL ARGUMENTS
=over
=item NAME I
tool name
=back
=head1 DESCRIPTION:
!!! define help_detail() in module
=cut
Genome-0.06/pod/gmt-install.pod 000444 000765 000024 616 11535205621 16305 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
gmt install - install more modules
=head1 SYNOPSIS
gmt install [NAME]
genome install music
genome music ...
genome install annotate
genome annotate ...
=head1 OPTIONAL ARGUMENTS
=over
=item NAME I
tool name
=back
=head1 DESCRIPTION:
Install new geomics software.
When run with no parameters, the available tools will be listed by name.
=cut
Genome-0.06/pod/gmt.pod 000444 000765 000024 302 11535205621 14631 0 ustar 00ssmith staff 000000 000000
=pod
=head1 NAME
gmt - bioinformatics tools for genomics
=head1 VERSION
This document describes gmt version 0.05.
=head1 SUB-COMMANDS
install [NAME] install more modules
=cut
Genome-0.06/t 000755 000765 000024 0 11535205621 12707 5 ustar 00ssmith staff 000000 000000 Genome-0.06/t/Genome-Sys.t 000444 000765 000024 2277 11535205621 15227 0 ustar 00ssmith staff 000000 000000 #!/usr/bin/env perl
use strict;
use warnings;
use above 'Genome';
use Test::More tests => 14;
use Genome::Sys;
sub mdir($) {
system "mkdir -p $_[0]";
ok(-d $_[0], "created directory $_[0]") or die "cannot continue!";
}
my $tmp = Genome::Sys->create_temp_directory("foo");
ok($tmp, "made temp directory $tmp");
my $tmp1 = $tmp . '/set1';
mdir($tmp1);
ok($tmp1, "made temp directory $tmp1");
my $tmp2 = $tmp . '/set2';
mdir($tmp2);
ok($tmp2, "made temp directory $tmp2");
$ENV{GENOME_DB} = join(":",$tmp1,$tmp2);
mdir($tmp1 . '/db1/1.0');
mdir($tmp1 . '/db1/2.1'); # the others are noise
mdir($tmp1 . '/db2/123');
mdir($tmp1 . '/db2/4');
my $ret = Genome::Sys->dbpath('db1','2.1');
is($ret, $tmp1 . '/db1/2.1', "path returns correctly");
mdir($tmp2 . '/db1/2.1'); # hidden by set 1
$ret = Genome::Sys->dbpath('db1','2.1');
is($ret, $tmp1 . '/db1/2.1', "path for db1 2.1 is the same as the last time because the new db is 2nd in the path");
rmdir $tmp1 . '/db1/2.1';
ok(! -d $tmp1 . '/db1/2.1', "removed the first database dir $tmp1/db1/2.1") or diag $!;
$ret = Genome::Sys->dbpath('db1','2.1');
is($ret, $tmp2 . '/db1/2.1', "path is the second db because the new db was removed") or diag $ret;
Genome-0.06/t/Genome.t 000444 000765 000024 234 11535205621 14422 0 ustar 00ssmith staff 000000 000000 #!/usr/bin/env perl
use strict;
use warnings;
use Test::More tests => 1;
use above "Genome";
ok(1,"used Genome without crashing with the 'above' pragma'");