2 package SGN
::Controller
::VigsTool
;
7 BEGIN { extends
'Catalyst::Controller'; }
9 # this function read the database files (Bowtie2) and
10 # send the list of databases to the view input.mas
11 sub input
:Path
('/tools/vigs/') :Args
(0) {
14 # get databases path from the configuration file
15 my $db_path = $c->config->{vigs_db_path
};
16 my $default_db = $c->config->{vigs_default_db
};
18 # get database names from the files in the path
20 my @tpm_dbs = glob("$db_path/*.rev.1.ebwt");
21 # my @tpm_dbs = glob("$db_path/*.rev.1.bt2");
22 foreach my $full_name (@tpm_dbs) {
23 push(@databases, basename
($full_name, ".rev.1.ebwt"));
24 # push(@databases, basename($full_name, ".rev.1.bt2"));
26 # print STDERR "DATABASE ID: ".join(", ", @databases)."\n";
28 # send the database names to the view file input.mas
29 $c->stash->{template
} = '/tools/vigs/input.mas';
30 $c->stash->{databases
} = \
@databases;
31 $c->stash->{default_db
} = $default_db;