annotate VelvetOptimiser-2.1.7_modified/VelvetOpt/hwrap.pm @ 0:50ae1360fbbe 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 18:07:56 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
1 # VelvetOpt::hwrap.pm
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
2 #
50ae1360fbbe 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>
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
4 #
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
9 #
50ae1360fbbe 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,
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
14 #
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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,
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
19 #
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
23
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
24 package VelvetOpt::hwrap;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
25
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
26 =head1 NAME
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
27
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
29
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
30 =head1 AUTHOR
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
31
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
33
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
34 =head1 LICENSE
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
35
50ae1360fbbe 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>
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
37
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
42
50ae1360fbbe 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,
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
47
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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,
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
52
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
53 =head1 SYNOPSIS
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
54
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
55 use VelvetOpt::hwrap;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
56 use VelvetOpt::Assembly;
50ae1360fbbe 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(
50ae1360fbbe 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",
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
59 ass_id => "1",
50ae1360fbbe 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",
50ae1360fbbe 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",
50ae1360fbbe 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"
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
63 );
50ae1360fbbe 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);
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
65 if($worked){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
66 print $object->toString();
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
67 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
68 else {
50ae1360fbbe 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();
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
70 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
71
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
72 =head1 DESCRIPTION
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
73
50ae1360fbbe 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
50ae1360fbbe 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
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
77
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
78 =head2 Uses
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
79
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
80 =over 8
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
81
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
82 =item strict
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
83
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
84 =item warnings
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
85
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
86 =item Carp
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
87
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
88 =item VelvetOpt::Assembly
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
89
50ae1360fbbe 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)
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
91
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
92 =back
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
93
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
94 =head2 Private Fields
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
95
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
96 =over 8
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
97
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
98 =item interested
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
99
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
101
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
102 =back
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
103
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
104 =head2 Methods
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
105
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
106 =over 8
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
107
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
108 =item _runVelveth
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
109
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
111
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
112 =item _checkVHString
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
113
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
115
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
116 =item objectVelveth
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
117
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
119
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
120 =item stringVelveth
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
121
50ae1360fbbe 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.
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
123
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
124 =back
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
125
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
126 =cut
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
127
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
128 use warnings;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
129 use strict;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
130 use Carp;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
131 use VelvetOpt::Assembly;
50ae1360fbbe 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);
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
133
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
134 my $interested = 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
135
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
136 my @Fileformats;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
137 my @Readtypes;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
138 my $usage;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
139 my $inited = 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
140
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
141 sub init {
50ae1360fbbe 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..
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
143 my $response = &_runVelveth(" ");
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
144
50ae1360fbbe 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+)/;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
146 my $cats = $1;
50ae1360fbbe 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;}
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
148
50ae1360fbbe 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;
50ae1360fbbe 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;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
151 foreach(@t){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
152 #if(/\s+(-\S+)/){
50ae1360fbbe 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){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
154 push @Fileformats, $1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
155 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
156 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
157
50ae1360fbbe 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;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
159
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
160 @t = ();
50ae1360fbbe 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;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
162 foreach(@t){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
163 #if(/\s+(-\S+)/){
50ae1360fbbe 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){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
165 push @Readtypes, $1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
166 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
167 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
168
50ae1360fbbe 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++){
50ae1360fbbe 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";
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
172 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
173
50ae1360fbbe 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";
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
176 foreach(@Fileformats){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
177 $usage .= "\t$_\n";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
178 }
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
180 foreach(@Readtypes){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
181 $usage .= "\t$_\n";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
182 }
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
184
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
185 $inited = 1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
186 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
187
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
188 sub _runVelveth {
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
189 #unless($inited){ &init(); }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
190 my $cmdline = shift;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
191 my $output = "";
50ae1360fbbe 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;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
193 $output = `velveth $cmdline`;
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
195 return $output;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
196 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
197
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
198 sub _checkVHString {
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
199 unless($inited){ &init(); }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
200 my $line = shift;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
201 my $cats = shift;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
202
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
203
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
204
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
205 my %fileform = ();
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
206 my %readform = ();
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
207
50ae1360fbbe 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;}
50ae1360fbbe 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;}
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
210
50ae1360fbbe 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;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
212
50ae1360fbbe 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...
50ae1360fbbe 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;
50ae1360fbbe 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 =~ /^\-/)){
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
217 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
218 }
50ae1360fbbe 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";
50ae1360fbbe 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;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
221 unless($hash =~ /^\d+$/){
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
223 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
224 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
225
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
227
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
228 my $i = 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
229 my $ok = 1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
230 foreach(@l){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
231 if(/^-/){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
232 #s/-//;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
233 if(!$fileform{$_} && !$readform{$_}){
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
235 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
236 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
237 elsif($fileform{$_}){
50ae1360fbbe 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){
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
240 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
241 }
50ae1360fbbe 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]}){
50ae1360fbbe 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){
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
245 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
246 }
50ae1360fbbe 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]){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
248 $ok = 1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
249 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
250 else{
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
252 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
253 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
254 }
50ae1360fbbe 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]){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
256 $ok = 1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
257 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
258 else {
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
260 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
261 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
262 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
263 elsif($readform{$_}){
50ae1360fbbe 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){
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
266 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
267 }
50ae1360fbbe 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]}){
50ae1360fbbe 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){
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
271 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
272 }
50ae1360fbbe 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]){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
274 $ok = 1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
275 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
276 else{
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
278 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
279 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
280 }
50ae1360fbbe 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]){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
282 $ok = 1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
283 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
284 else {
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
286 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
287 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
288 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
289 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
290 elsif(!-e $_){
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
292 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
293 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
294 $i ++;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
295 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
296 if($ok){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
297 return 1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
298 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
299 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
300
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
301 sub objectVelveth {
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
302 unless($inited){ &init(); }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
303 my $va = shift;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
304 my $cats = shift;
50ae1360fbbe 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};
50ae1360fbbe 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)){
50ae1360fbbe 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);
50ae1360fbbe 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};
50ae1360fbbe 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+//;
50ae1360fbbe 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];
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
311 return 1;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
312 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
313 else {
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
315 return 0;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
316 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
317 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
318
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
319 sub stringVelveth {
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
320 unless($inited){ &init(); }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
321 my $cmdline = shift;
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
322 my $cats = shift;
50ae1360fbbe 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)){
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
324 return _runVelveth($cmdline);
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
325 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
326 else {
50ae1360fbbe 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";
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
328 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
329 }
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
330
50ae1360fbbe Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
331 1;