Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
BIGSdb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Emmanuel QUEVILLON
BIGSdb
Commits
5e0541b6
Commit
5e0541b6
authored
May 23, 2016
by
Keith Jolley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add classification groups to the config check page.
parent
7b8a0ce4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
5 deletions
+65
-5
lib/BIGSdb/ConfigCheckPage.pm
lib/BIGSdb/ConfigCheckPage.pm
+56
-0
lib/BIGSdb/IsolateInfoPage.pm
lib/BIGSdb/IsolateInfoPage.pm
+9
-5
No files found.
lib/BIGSdb/ConfigCheckPage.pm
View file @
5e0541b6
...
...
@@ -38,6 +38,7 @@ sub print_content {
if
(
$self
->
{'
system
'}
->
{'
dbtype
'}
eq
'
isolates
'
)
{
$self
->
_check_locus_databases
;
$self
->
_check_scheme_databases
;
$self
->
_check_classification_scheme_databases
;
}
else
{
$self
->
_check_client_databases
;
}
...
...
@@ -222,6 +223,61 @@ sub _check_scheme_databases {
return
;
}
sub
_check_classification_scheme_databases
{
my
(
$self
)
=
@_
;
say
q(<div class="box resultstable">)
;
say
q(<h2>Classification scheme databases</h2>)
;
my
$cschemes
=
$self
->
{'
datastore
'}
->
run_query
(
'
SELECT id FROM classification_schemes ORDER BY id
',
undef
,
{
fetch
=>
'
col_arrayref
'
}
);
my
$td
=
1
;
if
(
@$cschemes
)
{
say
q(<div class="scrollable"><table class="resultstable"><tr><th>Classification scheme</th>)
.
q(<th>Scheme</th><th>Database</th><th>Host</th><th>Port</th><th>Table</th><th>Database accessible</th>)
.
q(<th>Seqdef classification scheme id</th><th>Classification data</th></tr>)
;
foreach
my
$cscheme_id
(
@$cschemes
)
{
my
$cscheme_info
=
$self
->
{'
datastore
'}
->
get_classification_scheme_info
(
$cscheme_id
);
my
$scheme_info
=
$self
->
{'
datastore
'}
->
get_scheme_info
(
$cscheme_info
->
{'
scheme_id
'}
);
$cscheme_info
->
{'
name
'}
=~
s/&/&/gx
;
$scheme_info
->
{'
description
'}
=~
s/&/&/gx
;
print
qq(<tr class="td$td"><td>$cscheme_info->{'id'}: $cscheme_info->{'name'}</td><td>)
.
("
$scheme_info
->{'id'}:
$scheme_info
->{'description'}
")
.
q(</td><td>)
.
(
$scheme_info
->
{'
dbase_name
'}
//
q()
)
.
q(</td><td>)
.
(
$scheme_info
->
{'
dbase_host
'}
//
$self
->
{'
system
'}
->
{'
host
'}
)
.
q(</td><td>)
.
(
$scheme_info
->
{'
dbase_port
'}
//
$self
->
{'
system
'}
->
{'
port
'}
)
.
q(</td><td>)
.
(
$scheme_info
->
{'
dbase_table
'}
//
q()
)
.
q(</td><td>)
;
if
(
$self
->
{'
datastore
'}
->
get_classification_scheme
(
$cscheme_id
)
->
get_db
)
{
print
q(<span class="statusgood fa fa-check"></span>)
;
}
else
{
print
q(<span class="statusbad fa fa-times"></span>)
;
}
print
qq(</td><td>$cscheme_info->{'seqdef_cscheme_id'}</td><td>)
;
my
$seqdef_db
=
$self
->
{'
datastore
'}
->
get_scheme
(
$cscheme_info
->
{'
scheme_id
'}
)
->
get_db
;
my
$exists
=
$self
->
{'
datastore
'}
->
run_query
(
'
SELECT EXISTS(SELECT * FROM classification_group_profiles WHERE cg_scheme_id=?)
',
$cscheme_info
->
{'
seqdef_cscheme_id
'},
{
db
=>
$seqdef_db
}
);
if
(
$exists
)
{
print
q(<span class="statusgood fa fa-check"></span>)
;
}
else
{
print
q(<span class="statusbad fa fa-times"></span>)
;
}
my
$classification_data
=
say
q(</td></tr>)
;
$td
=
$td
==
1
?
2
:
1
;
}
say
q(</table></div></div>)
;
}
else
{
say
q(<p>No schemes with databases defined.</p>)
;
}
return
;
}
sub
_check_client_databases
{
my
(
$self
)
=
@_
;
my
$client_dbs
=
...
...
lib/BIGSdb/IsolateInfoPage.pm
View file @
5e0541b6
...
...
@@ -504,21 +504,25 @@ sub _get_classification_group_data {
foreach
my
$group_id
(
@$groups
)
{
my
$isolate_count
=
$self
->
{'
datastore
'}
->
run_query
(
"
SELECT COUNT(*) FROM
$view
WHERE
$view
.id IN (SELECT id FROM
$scheme_table
WHERE
$pk
IN
"
.
"
(SELECT profile_id FROM
$cscheme_table
WHERE group_id=?)) AND new_version IS NULL
",
.
"
(SELECT profile_id FROM
$cscheme_table
WHERE group_id=?)) AND new_version IS NULL
"
,
$group_id
);
if
(
$isolate_count
>
1
)
{
my
$url
=
"
$self
->{'system'}->{'script_name'}?db=
$self
->{'instance'}&page=query&
"
.
"
designation_field1=cg_
$cscheme
->{'id'}_group&designation_value1=
$group_id
&submit=1
";
$cg_buffer
.=
qq(<dt>group</dt><dd><a href="$url">$group_id</a> ($isolate_count isolates)</dd>\n)
;
$cg_buffer
.=
qq(group: <a href="$url">$group_id ($isolate_count isolates)</a><br />\n)
;
}
}
}
}
if
(
$cg_buffer
)
{
$cg_buffer
=
qq(<div style="float:left"><h3>Scheme: $cscheme->{'name'}</h3>\n)
.
qq(<dl class="data">$cg_buffer</dl></div>\n)
;
my
$plural
=
$cscheme
->
{'
inclusion_threshold
'}
==
1
?
q()
:
q(es)
;
$cg_buffer
=
qq(<div style="float:left;margin-right:2em"><h3>Scheme: $cscheme->{'name'}</h3>\n)
.
qq(<p>$scheme_info->{'description'}<br />$cscheme->{'inclusion_threshold'} mismatch$plural.)
.
q(<br />Single-linkage cluster.<br />)
.
qq($cg_buffer</div>\n)
;
$buffer
.=
$cg_buffer
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment