This repository has been archived by the owner on Oct 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpgxdb.pm
64 lines (49 loc) · 1.53 KB
/
pgxdb.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package PGXDB;
use Data::Dumper;
use File::Basename;
use YAML::XS 'LoadFile';
use PGXDB::Databases;
use PGXDB::Filesystem;
use PGXDB::GEOmetaData;
use PGXDB::GEOrawData;
use PGXDB::Utilities;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(
new
pgxdb_month_to_number
);
################################################################################
################################################################################
################################################################################
sub new {
my $class = shift;
my $args = shift;
my $path_of_this_module = File::Basename::dirname( eval { ( caller() )[1] } );
my $self = {
config => LoadFile($path_of_this_module.'/rsrc/config/config.yaml'),
platformconfig => LoadFile($path_of_this_module.'/rsrc/config/platforms.yaml'),
logfiles => {},
parameters => {},
platforms => {},
samples => {},
series => {},
};
bless $self, $class;
$self->{parameters} = { map{ $_ => $self->{config}->{parameters}->{$_} } keys %{ $self->{config}->{parameters} } };
$self->{dataset_names} = [ keys %{ $self->{config}->{databases} } ];
if (! grep{ /\-./ } keys %$args) {
$self->{parameters}->{help} = 1;
return $self;
}
foreach (grep{ /^\-\w/ } keys %$args) {
my $key = $_;
$key =~ s/^\-//;
if ($args->{$_} =~ /./) {
$self->{parameters}->{$key} = $args->{$_} }
if (grep{ /^$key$/ } qw(help h ?)) {
$self->{parameters}->{help} = 1 }
}
return $self;
}
1;