/usr/share/perl5/VelvetOpt/gwrap.pm is in velvetoptimiser 2.2.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | # VelvetOpt::gwrap.pm
#
# Copyright 2008- Simon Gladman & Torsten Seemann
#
# 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 2 of the License, 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.
#
package VelvetOpt::gwrap;
=head1 NAME
VelvetOpt::gwrap.pm - Velvet graphing and assembly program wrapper module.
=head1 AUTHORS
Simon Gladman
Torsten Seemann
=head1 LICENSE
Copyright 2008- Simon Gladman & Torsten Seemann
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 2 of the License, 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.
=head1 SYNOPSIS
use VelvetOpt::gwrap;
use VelvetOpt::Assembly;
my $object = VelvetOpt::Assembly->new(
timestamph => "23 November 2008 15:00:00",
ass_id => "1",
versiong => "0.7.19",
pstringg => "test",
ass_dir => "/home/gla048/Desktop/newVelvetOptimiser/test"
);
my $worked = VelvetOpt::gwrap::objectVelvetg($object);
if($worked){
print $object->toString();
}
else {
die "Error in velvetg..\n" . $object->toString();
}
=head1 DESCRIPTION
A wrapper module to run velvetg on VelvetAssembly objects or on velvetg
parameter strings. Also contains private methods to check velvetg
parameter strings, run velvetg and return results.
=head2 Uses
=over 8
=item strict
=item warnings
=item Carp
=item VelvetOpt::Assembly
=item POSIX qw(strftime)
=back
=head2 Private Fields
=over 8
=item interested
STDERR printing debug message toggle. 1 for on, 0 for off.
=back
=head2 Methods
=over 8
=item _runVelvetg
Private method which runs velvetg with the supplied velvetg parameter string and returns velvetg output messages as a string.
=item _checkVGString
Private method which checks for a correctly formatted velvetg parameter string. Returns 1 or 0.
=item objectVelvetg
Accepts a VelvetAssembly object, looks for the velvetg parameter string it contains, checks it, sends it to _runVelvetg, collects the results and stores them in the VelvetAssembly object.
=item stringVelvetg
Accepts a velvetg parameter string, checks it, sends it to _runVelvetg and then collects and returns the velvetg output messages.
=back
=cut
use warnings;
use strict;
use Carp;
use VelvetOpt::Assembly;
use POSIX qw(strftime);
my $interested = 0;
sub _runVelvetg {
my $cmdline = shift;
my $output = "";
print STDERR "About to run velvetg!\n" if $interested;
$output = `velvetg $cmdline`;
$output .= "\nTimestamp: " . strftime("%b %e %Y %H:%M:%S", localtime) . "\n";
return $output;
}
sub _checkVGString {
return 1;
}
sub objectVelvetg {
my $va = shift;
my $cmdline = $va->{pstringg};
if(_checkVGString($cmdline)){
$va->{velvetgout} = _runVelvetg($cmdline);
my @t = split /\n/, $va->{velvetgout};
$t[$#t] =~ s/Timestamp:\s+//;
$va->{timestampg} = $t[$#t];
return 1;
}
else {
$va->{velvetgout} = "Formatting errors in velvetg parameter string.";
return 0;
}
}
sub stringVelvetg {
my $cmdline = shift;
if(_checkVGString($cmdline)){
return _runVelvetg($cmdline);
}
else {
return "Formatting errors in velvetg parameter string.";
}
}
1;
|