annotate VelvetOptimiser-2.1.7_modified/VelvetOpt/hwrap.pm @ 0:7363fee7f20c default tip

Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author konradpaszkiewicz
date Tue, 07 Jun 2011 17:42:26 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
1 # VelvetOpt::hwrap.pm
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
2 #
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
3 # Copyright 2008 Simon Gladman <simon.gladman@csiro.au>
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
4 #
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
5 # This program is free software; you can redistribute it and/or modify
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
6 # it under the terms of the GNU General Public License as published by
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
7 # the Free Software Foundation; either version 2 of the License, or
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
8 # (at your option) any later version.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
9 #
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
10 # This program is distributed in the hope that it will be useful,
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
13 # GNU General Public License for more details.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
14 #
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
16 # along with this program; if not, write to the Free Software
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
18 # MA 02110-1301, USA.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
19 #
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
20 # Version 1.1 - 14/07/2010 - Added support for changing input file types
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
21 # Version 1.2 - 11/08/2010 - Changed velveth help parser for new velvet help format
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
22 # Thanks to Alexie Papanicolaou - CSIRO for the patch.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
23
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
24 package VelvetOpt::hwrap;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
25
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
26 =head1 NAME
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
27
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
28 VelvetOpt::hwrap.pm - Velvet hashing program wrapper module.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
29
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
30 =head1 AUTHOR
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
31
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
32 Simon Gladman, CSIRO, 2007, 2008.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
33
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
34 =head1 LICENSE
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
35
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
36 Copyright 2008 Simon Gladman <simon.gladman@csiro.au>
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
37
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
38 This program is free software; you can redistribute it and/or modify
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
39 it under the terms of the GNU General Public License as published by
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
40 the Free Software Foundation; either version 2 of the License, or
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
41 (at your option) any later version.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
42
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
43 This program is distributed in the hope that it will be useful,
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
44 but WITHOUT ANY WARRANTY; without even the implied warranty of
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
45 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
46 GNU General Public License for more details.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
47
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
48 You should have received a copy of the GNU General Public License
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
49 along with this program; if not, write to the Free Software
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
50 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
51 MA 02110-1301, USA.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
52
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
53 =head1 SYNOPSIS
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
54
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
55 use VelvetOpt::hwrap;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
56 use VelvetOpt::Assembly;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
57 my $object = VelvetOpt::Assembly->new(
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
58 timestamph => "23 November 2008 15:00:00",
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
59 ass_id => "1",
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
60 versionh => "0.7.04",
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
61 pstringh => "test 21 -fasta test_reads.fna",
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
62 ass_dir => "/home/gla048/Desktop/newVelvetOptimiser/data_1"
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
63 );
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
64 my $worked = VelvetOpt::hwrap::objectVelveth($object);
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
65 if($worked){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
66 print $object->toString();
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
67 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
68 else {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
69 die "Error in velveth..\n" . $object->toString();
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
70 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
71
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
72 =head1 DESCRIPTION
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
73
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
74 A wrapper module to run velveth on VelvetAssembly objects or on velveth
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
75 parameter strings. Also contains private methods to check velveth
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
76 parameter strings, run velveth and return results.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
77
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
78 =head2 Uses
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
79
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
80 =over 8
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
81
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
82 =item strict
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
83
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
84 =item warnings
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
85
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
86 =item Carp
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
87
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
88 =item VelvetOpt::Assembly
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
89
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
90 =item POSIX qw(strftime)
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
91
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
92 =back
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
93
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
94 =head2 Private Fields
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
95
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
96 =over 8
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
97
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
98 =item interested
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
99
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
100 STDERR printing debug message toggle. 1 for on, 0 for off.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
101
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
102 =back
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
103
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
104 =head2 Methods
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
105
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
106 =over 8
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
107
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
108 =item _runVelveth
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
109
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
110 Private method which runs velveth with the supplied velveth parameter string and returns velveth output messages as a string.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
111
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
112 =item _checkVHString
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
113
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
114 Private method which checks for a correctly formatted velveth string. Returns 1 or 0.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
115
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
116 =item objectVelveth
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
117
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
118 Accepts a VelvetAssembly object and the number of categories velvet was compiled with, looks for the velveth parameter string it contains, checks it, sends it to _runVelveth, collects the results and stores them in the VelvetAssembly object.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
119
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
120 =item stringVelveth
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
121
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
122 Accepts a velveth parameter string and the number of categories velvet was compiled with, checks it, sends it to _runVelveth and then collects and returns the velveth output messages.
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
123
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
124 =back
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
125
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
126 =cut
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
127
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
128 use warnings;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
129 use strict;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
130 use Carp;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
131 use VelvetOpt::Assembly;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
132 use POSIX qw(strftime);
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
133
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
134 my $interested = 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
135
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
136 my @Fileformats;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
137 my @Readtypes;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
138 my $usage;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
139 my $inited = 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
140
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
141 sub init {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
142 #run a velveth to get its help lines..
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
143 my $response = &_runVelveth(" ");
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
144
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
145 $response =~ m/CATEGORIES = (\d+)/;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
146 my $cats = $1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
147 unless($cats){$cats = 2;}
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
148
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
149 $response =~ m/(File format options:(.*)Read type options)/s;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
150 my @t = split /\n/, $1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
151 foreach(@t){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
152 #if(/\s+(-\S+)/){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
153 while(/\s+(-\S+)/g){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
154 push @Fileformats, $1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
155 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
156 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
157
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
158 $response =~ m/(Read type options:(.*)Options:)/s;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
159
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
160 @t = ();
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
161 @t = split /\n/, $1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
162 foreach(@t){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
163 #if(/\s+(-\S+)/){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
164 while(/\s+(-\S+)/g){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
165 push @Readtypes, $1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
166 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
167 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
168
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
169 for(my $i = 3; $i <= $cats; $i++){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
170 push @Readtypes, "-short$i";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
171 push @Readtypes, "-shortPaired$i";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
172 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
173
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
174 $usage = "Incorrect velveth parameter string: Needs to be of the form\n{[-file_format][-read_type] filename}\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
175 $usage .= "Where:\n\tFile format options:\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
176 foreach(@Fileformats){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
177 $usage .= "\t$_\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
178 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
179 $usage .= "Read type options:\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
180 foreach(@Readtypes){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
181 $usage .= "\t$_\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
182 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
183 $usage .= "\nThere can be more than one filename specified as long as its a different type.\nStopping run\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
184
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
185 $inited = 1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
186 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
187
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
188 sub _runVelveth {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
189 #unless($inited){ &init(); }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
190 my $cmdline = shift;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
191 my $output = "";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
192 print STDERR "About to run velveth!\n" if $interested;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
193 $output = `velveth $cmdline`;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
194 $output .= "\nTimestamp: " . strftime("%b %e %Y %H:%M:%S", localtime) . "\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
195 return $output;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
196 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
197
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
198 sub _checkVHString {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
199 unless($inited){ &init(); }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
200 my $line = shift;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
201 my $cats = shift;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
202
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
203
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
204
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
205 my %fileform = ();
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
206 my %readform = ();
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
207
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
208 foreach(@Fileformats){ $fileform{$_} = 1;}
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
209 foreach(@Readtypes){ $readform{$_} = 1;}
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
210
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
211 my @l = split /\s+/, $line;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
212
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
213 #first check for a directory name as the first parameter...
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
214 my $dir = shift @l;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
215 if(!($dir =~ /\w+/) || ($dir =~ /^\-/)){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
216 carp "**** $line\n\tNo directory name specified as first parameter in velveth string. Internal error!\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
217 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
218 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
219 #print "VH Check passed directory..\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
220 my $hash = shift @l;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
221 unless($hash =~ /^\d+$/){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
222 carp "**** $line\n\tHash value in velveth string not a number. Internal error!\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
223 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
224 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
225
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
226 #print "VH check passed hash value..\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
227
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
228 my $i = 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
229 my $ok = 1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
230 foreach(@l){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
231 if(/^-/){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
232 #s/-//;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
233 if(!$fileform{$_} && !$readform{$_}){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
234 carp "**** $line\n\tIncorrect fileformat or readformat specified.\n\t$_ is an invalid velveth switch.\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
235 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
236 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
237 elsif($fileform{$_}){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
238 if(($i + 1) > $#l){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
239 carp "$line\n\tNo filename supplied after file format type $l[$i].\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
240 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
241 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
242 if($readform{$l[$i+1]}){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
243 if(($i+2) > $#l){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
244 carp "$line\n\tNo filename supplied after read format type $l[$i+1].\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
245 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
246 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
247 if(-e $l[$i+2]){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
248 $ok = 1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
249 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
250 else{
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
251 carp "**** $line\n\tVelveth filename " . $l[$i+2] . " doesn't exist.\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
252 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
253 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
254 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
255 elsif (-e $l[$i+1]){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
256 $ok = 1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
257 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
258 else {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
259 carp "**** $line\n\tVelveth filename " . $l[$i+1] . " doesn't exist.$usage\n";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
260 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
261 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
262 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
263 elsif($readform{$_}){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
264 if(($i + 1) > $#l){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
265 carp "$line\n\tNo filename supplied after read format type $l[$i].\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
266 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
267 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
268 if($fileform{$l[$i+1]}){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
269 if(($i+2) > $#l){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
270 carp "$line\n\tNo filename supplied after file format type $l[$i+1].\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
271 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
272 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
273 if(-e $l[$i+2]){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
274 $ok = 1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
275 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
276 else{
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
277 carp "**** $line\n\tVelveth filename " . $l[$i+2] . " doesn't exist.\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
278 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
279 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
280 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
281 elsif (-e $l[$i+1]){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
282 $ok = 1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
283 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
284 else {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
285 carp "**** $line\n\tVelveth filename " . $l[$i+1] ." doesn't exist.\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
286 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
287 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
288 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
289 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
290 elsif(!-e $_){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
291 carp "**** $line\n\tVelveth filename $_ doesn't exist.\n$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
292 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
293 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
294 $i ++;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
295 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
296 if($ok){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
297 return 1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
298 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
299 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
300
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
301 sub objectVelveth {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
302 unless($inited){ &init(); }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
303 my $va = shift;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
304 my $cats = shift;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
305 my $cmdline = $va->{pstringh};
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
306 if(_checkVHString($cmdline, $cats)){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
307 $va->{velvethout} = _runVelveth($cmdline);
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
308 my @t = split /\n/, $va->{velvethout};
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
309 $t[$#t] =~ s/Timestamp:\s+//;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
310 $va->{timestamph} = $t[$#t];
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
311 return 1;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
312 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
313 else {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
314 $va->{velvethout} = "Formatting errors in velveth parameter string.$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
315 return 0;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
316 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
317 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
318
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
319 sub stringVelveth {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
320 unless($inited){ &init(); }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
321 my $cmdline = shift;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
322 my $cats = shift;
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
323 if(_checkVHString($cmdline,$cats)){
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
324 return _runVelveth($cmdline);
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
325 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
326 else {
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
327 return "Formatting errors in velveth parameter string.$usage";
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
328 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
329 }
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
330
7363fee7f20c Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
331 1;