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
35475000
Commit
35475000
authored
May 23, 2016
by
Keith Jolley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format classification schemes as a table in isolate info page.
parent
5e0541b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
lib/BIGSdb/IsolateInfoPage.pm
lib/BIGSdb/IsolateInfoPage.pm
+22
-13
No files found.
lib/BIGSdb/IsolateInfoPage.pm
View file @
35475000
...
...
@@ -475,6 +475,7 @@ sub _get_classification_group_data {
my
$classification_schemes
=
$self
->
{'
datastore
'}
->
run_query
(
'
SELECT * FROM classification_schemes ORDER BY display_order,name
',
undef
,
{
fetch
=>
'
all_arrayref
',
slice
=>
{}
}
);
my
$td
=
1
;
foreach
my
$cscheme
(
@$classification_schemes
)
{
my
$cg_buffer
;
my
$scheme_id
=
$cscheme
->
{'
seqdef_cscheme_id
'}
//
$cscheme
->
{'
scheme_id
'};
...
...
@@ -486,7 +487,7 @@ sub _get_classification_group_data {
$logger
->
warn
(
"
Scheme
$scheme_id
is not cached for this database. Display of similar isolates
"
.
'
is disabled. You need to run the update_scheme_caches.pl script regularly against this
'
.
'
database to create these caches.
'
);
return
$buffer
;
return
q()
;
}
my
$scheme_info
=
$self
->
{'
datastore
'}
->
get_scheme_info
(
$scheme_id
,
{
get_pk
=>
1
}
);
my
$scheme_table
=
$self
->
{'
datastore
'}
->
create_temp_isolate_scheme_fields_view
(
$scheme_id
);
...
...
@@ -504,31 +505,39 @@ 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
";
my
$url
=
qq($self->{'system'}->{'script_name'}?db=$self->{'instance'}&page=query&)
.
qq(designation_field1=cg_$cscheme->{'id'}_group&designation_value1=$group_id&)
.
q(submit=1)
;
$cg_buffer
.=
qq(group: <a href="$url">$group_id ($isolate_count isolates)</a><br />\n)
;
}
}
}
}
if
(
$cg_buffer
)
{
my
$desc
=
$cscheme
->
{'
description
'};
my
$tooltip
=
$desc
?
qq( <a class="tooltip" title="$cscheme->{'name'} - $desc"> )
.
q(<span class="fa fa-info-circle"></span></a>)
:
q()
;
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
;
$buffer
.=
qq(<tr class="td$td"><td>$cscheme->{'name'}$tooltip</td><td>$scheme_info->{'description'}</td>)
.
qq(<td>Single-linkage</td><td>$cscheme->{'inclusion_threshold'}</td><td>$cg_buffer</td></tr>)
;
$td
=
$td
==
1
?
2
:
1
;
}
}
if
(
$buffer
)
{
$buffer
=
qq(<div><h2>Similar isolates (determined by classification schemes)</h2>\n$buffer</div>)
.
q(<div style="clear:both"></div>)
;
$buffer
=
q(<h2>Similar isolates (determined by classification schemes)</h2>)
.
q(<div class="scrollable">)
.
q(<div class="resultstable" style="float:left"><table class="resultstable"><tr>)
.
q(<th>Classification scheme</th><th>Underlying scheme</th><th>Clustering method</th>)
.
qq(<th>Mismatch threshold</th><th>Group</th></tr>$buffer</table></div></div>)
;
}
return
$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