seedlot upload with accession synonyms. seedlot upload works to update existing seedlots
[sgn.git] / lib / SGN / Controller / VigsTool.pm
blob3133415a352f03d27937acbcd2e0a1c2368e3d00
2 package SGN::Controller::VigsTool;
4 use Moose;
5 use File::Basename;
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) {
12 my ($self, $c) = @_;
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
19 my @databases;
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;