Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Emmanuel QUEVILLON
BIGSdb
Commits
0d917663
Commit
0d917663
authored
Dec 23, 2014
by
Keith Jolley
Browse files
Merge branch 'develop' into submitter_accounts
parents
c53f0b42
047ce504
Changes
8
Hide whitespace changes
Inline
Side-by-side
lib/BIGSdb/CurateIsolateUpdatePage.pm
View file @
0d917663
...
...
@@ -306,8 +306,8 @@ sub _print_interface {
sub
_print_allele_designations
{
my
(
$self
,
$data
)
=
@_
;
my
$q
=
$self
->
{'
cgi
'};
say
"
<div class=
\
"
box
\
"
id=
\
"
alleles
\
"
style=
\
"
overflow:auto
\
"
>
"
;
say
"
<fieldset style=
\
"
float:left
\
"
><legend>Loci</legend>
"
;
say
q(
<div class="box" id="alleles" style="overflow:auto">
)
;
say
q(
<fieldset style="float:left"><legend>Loci</legend>
)
;
my
$isolate_record
=
BIGSdb::
IsolateInfoPage
->
new
(
(
system
=>
$self
->
{'
system
'},
...
...
@@ -328,11 +328,11 @@ sub _print_allele_designations {
say
$q
->
start_form
;
my
$set_id
=
$self
->
get_set_id
;
my
(
$loci
,
$labels
)
=
$self
->
{'
datastore
'}
->
get_locus_list
(
{
set_id
=>
$set_id
}
);
say
"
<label for=
\
"
locus
\
"
>Locus: </label>
"
;
say
q(
<label for="locus">Locus: </label>
)
;
say
$q
->
popup_menu
(
-
name
=>
'
locus
',
-
id
=>
'
locus
',
-
values
=>
$loci
,
-
labels
=>
$labels
);
say
$q
->
submit
(
-
label
=>
'
Add/update
',
-
class
=>
'
submit
'
);
$q
->
param
(
'
page
',
'
alleleUpdate
'
);
$q
->
param
(
'
isolate_id
',
$q
->
param
('
id
')
);
$q
->
param
(
page
=>
'
alleleUpdate
'
);
$q
->
param
(
isolate_id
=>
$q
->
param
('
id
')
);
say
$q
->
hidden
(
$_
)
foreach
qw(db page isolate_id)
;
say
$q
->
end_form
;
say
"
</fieldset></div>
";
...
...
lib/BIGSdb/CuratePage.pm
View file @
0d917663
...
...
@@ -308,7 +308,7 @@ sub _get_form_fields {
-
name
=>
$name
,
-
id
=>
$name
,
-
values
=>
[
@optlist
],
-
default
=>
$newdata
{
$att
->
{'
name
'}
},
-
default
=>
$options
->
{'
update
'}
?
$newdata
{
$att
->
{'
name
'}
}
:
$att
->
{'
default
'}
,
-
labels
=>
$labels
,
%html5_args
);
...
...
lib/BIGSdb/CurateTableHeaderPage.pm
View file @
0d917663
...
...
@@ -138,9 +138,11 @@ sub get_isolate_loci {
}
}
}
else
{
#Just list MLST loci
my
$scheme_id_ref
=
$self
->
{'
datastore
'}
->
run_simple_query
("
SELECT id FROM schemes WHERE description = 'MLST'
");
if
(
ref
$scheme_id_ref
eq
'
ARRAY
'
)
{
my
$scheme_loci
=
$self
->
{'
datastore
'}
->
get_scheme_loci
(
$scheme_id_ref
->
[
0
]
);
my
$scheme_ids
=
$self
->
{'
datastore
'}
->
run_query
(
"
SELECT id FROM schemes WHERE description LIKE 'MLST%' ORDER BY display_order
",
undef
,
{
fetch
=>
'
col_arrayref
'
}
);
foreach
my
$scheme_id
(
@$scheme_ids
)
{
my
$scheme_loci
=
$self
->
{'
datastore
'}
->
get_scheme_loci
(
$scheme_id
);
foreach
my
$locus
(
@$scheme_loci
)
{
my
$cleaned_name
=
$self
->
clean_locus
(
$locus
,
{
no_common_name
=>
1
,
text_output
=>
1
}
);
push
@headers
,
$cleaned_name
;
...
...
lib/BIGSdb/IsolateInfoPage.pm
View file @
0d917663
...
...
@@ -519,7 +519,7 @@ sub _get_provenance_fields {
&&
!
$self
->
{'
system
'}
->
{'
privacy
'}
)
)
{
if
(
$value
>
0
&&
$userdata
->
{'
email
'}
ne
''
&&
$userdata
->
{'
email
'}
ne
'
-
'
)
{
if
(
$value
>
0
&&
$userdata
->
{'
email
'}
=~
/@/
)
{
$person
.=
"
(E-mail: <a href=
\"
mailto:
$userdata
->{'email'}
\"
>
$userdata
->{'email'}</a>)
";
}
}
...
...
@@ -576,27 +576,26 @@ sub _get_provenance_fields {
my
%attributes
=
map
{
$_
->
{'
attribute
'}
=>
$_
->
{'
value
'}
}
@$attribute_list
;
if
(
keys
%attributes
)
{
my
$rows
=
keys
%attributes
||
1
;
foreach
(
sort
{
$order
{
$a
}
<=>
$order
{
$b
}
}
keys
(
%attributes
)
)
{
my
$url
_ref
=
$self
->
{'
datastore
'}
->
run_simple_query
(
"
SELECT url FROM isolate_field_extended_attributes WHERE isolate_field=? AND attribute=?
",
$field
,
$_
);
foreach
my
$attribute
(
sort
{
$order
{
$a
}
<=>
$order
{
$b
}
}
keys
(
%attributes
)
)
{
my
$url
=
$self
->
{'
datastore
'}
->
run_query
(
"
SELECT url FROM isolate_field_extended_attributes WHERE isolate_field=? AND attribute=?
",
[
$field
,
$attribute
]
);
my
$att_web
;
if
(
ref
$url_ref
eq
'
ARRAY
'
)
{
my
$url
=
$url_ref
->
[
0
]
||
'';
$url
=~
s/\[\?\]/$attributes{$_}/
;
if
(
$url
)
{
$url
=~
s/\[\?\]/$attributes{$attribute}/
;
$url
=~
s/\&/\&/g
;
my
$domain
;
if
(
(
lc
(
$url
)
=~
/http:\/\/(.*?)\/+/
)
)
{
$domain
=
$
1
;
}
$att_web
=
"
<a href=
\
"
$url
\
"
>
$attributes
{
$
_
}</a>
"
if
$url
;
$att_web
=
qq(
<a href="$url">$attributes{$
attribute
}</a>
)
if
$url
;
if
(
$domain
&&
$domain
ne
$q
->
virtual_host
)
{
$att_web
.=
"
<span class=
\
"
link
\
"
><span style=
\
"
font-size:1.2em
\
"
>→</span>
$domain
</span>
"
;
$att_web
.=
qq(
<span class="link"><span style="font-size:1.2em">→</span> $domain</span>
)
;
}
}
$buffer
.=
"
<dt class=
\"
dontend
\"
>
$
_
</dt>
\n
";
$buffer
.=
"
<dd>
"
.
(
$att_web
||
$attributes
{
$
_
}
)
.
"
</dd>
\n
";
$buffer
.=
"
<dt class=
\"
dontend
\"
>
$
attribute
</dt>
\n
";
$buffer
.=
"
<dd>
"
.
(
$att_web
||
$attributes
{
$
attribute
}
)
.
"
</dd>
\n
";
}
}
}
...
...
lib/BIGSdb/Offline/Script.pm
View file @
0d917663
...
...
@@ -93,9 +93,19 @@ sub initiate {
}
}
$self
->
set_system_overrides
;
$self
->
{'
dataConnector
'}
->
initiate
(
$self
->
{'
system
'},
$self
->
{'
config
'}
);
$self
->
db_connect
;
$self
->
setup_datastore
if
$self
->
{'
db
'};
if
(
$self
->
{'
db
'}){
$self
->
setup_datastore
;
if
(
defined
$self
->
{'
options
'}
->
{'
v
'}
)
{
my
$view_exists
=
$self
->
{'
datastore
'}
->
run_query
(
"
SELECT EXISTS(SELECT * FROM information_schema.tables WHERE table_name=?)
",
$self
->
{'
options
'}
->
{'
v
'}
);
die
"
Invalid view selected.
\n
"
if
!
$view_exists
;
$self
->
{'
system
'}
->
{'
view
'}
=
$self
->
{'
options
'}
->
{'
v
'};
}
}
return
;
}
...
...
lib/BIGSdb/Plugins/DatabaseFields.pm
View file @
0d917663
#DatabaseFields.pm - Database field description plugin for BIGSdb
#Written by Keith Jolley
#Copyright (c) 2010-201
3
, University of Oxford
#Copyright (c) 2010-201
4
, University of Oxford
#E-mail: keith.jolley@zoo.ox.ac.uk
#
#This file is part of Bacterial Isolate Genome Sequence Database (BIGSdb).
...
...
@@ -34,7 +34,7 @@ sub get_attributes {
description
=>
'
Display description of fields defined for the current database
',
menutext
=>
'
Description of database fields
',
module
=>
'
DatabaseFields
',
version
=>
'
1.0.
2
',
version
=>
'
1.0.
3
',
section
=>
'
miscellaneous
',
order
=>
10
,
dbtype
=>
'
isolates
'
...
...
@@ -50,15 +50,15 @@ sub set_pref_requirements {
sub
run
{
my
(
$self
)
=
@_
;
say
"
<h1>Description of database fields</h1>
"
;
say
"
<div class=
\
"
box
\
"
id=
\
"
resultstable
\
"
>
"
;
say
"
<p>Order columns by clicking their headings. <a href=
\
"
$self
->{'system'}->{'script_name'}?
"
.
"
db=
$self
->{'instance'}&
page=plugin&name=DatabaseFields
\
"
>Reset default order</a>.</p>
"
;
say
"
<table class=
\
"
tablesorter
\
"
id=
\
"
sortTable
\
"
>
\n
<thead>
"
;
say
"
<tr><th>field name</th><th>comments</th><th>data type</th><th class=
\
"
{sorter: false}
\
"
>allowed values</th>
"
.
"
<th>required</th></tr>
</thead>
\n
<tbody>
"
;
say
q(
<h1>Description of database fields</h1>
)
;
say
q(
<div class="box" id="resultstable">
<div class="scrollable">)
;
say
qq(
<p>Order columns by clicking their headings. <a href="$self->{'system'}->{'script_name'}?
db=$self->{'instance'}&)
.
qq(
page=plugin&name=DatabaseFields">Reset default order</a>.</p>
)
;
say
qq(
<table class="tablesorter" id="sortTable">\n<thead>
)
;
say
qq(
<tr><th>field name</th><th>comments</th><th>data type</th><th class="{sorter: false}">allowed values</th>
<th>required</th></tr>)
.
qq(
</thead>\n<tbody>
)
;
$self
->
_print_fields
;
say
"
</tbody></table>
\n
</div>
"
;
say
qq(
</tbody></table>\n</div>
</div>)
;
return
;
}
...
...
@@ -78,11 +78,15 @@ sub _print_fields {
.
"
</td><td>
$thisfield
->{'comments'}</td><td>
$thisfield
->{'type'}</td><td>
";
if
(
$thisfield
->
{'
optlist
'}
)
{
my
$option_list
=
$self
->
{'
xmlHandler
'}
->
get_field_option_list
(
$field
);
say
"
$_
<br />
"
foreach
@$option_list
;
}
elsif
(
defined
$thisfield
->
{'
min
'}
||
defined
$thisfield
->
{'
max
'}
){
foreach
my
$option
(
@$option_list
)
{
$option
=~
s/</</g
;
$option
=~
s/>/>/g
;
say
"
$option
<br />
";
}
}
elsif
(
defined
$thisfield
->
{'
min
'}
||
defined
$thisfield
->
{'
max
'}
)
{
print
"
min:
$thisfield
->{'min'}
"
if
defined
$thisfield
->
{'
min
'};
print
"
;
"
if
defined
$thisfield
->
{'
min
'}
&&
defined
$thisfield
->
{'
max
'};
say
"
max:
$thisfield
->{'max'}
"
if
defined
$thisfield
->
{'
max
'};
print
"
;
"
if
defined
$thisfield
->
{'
min
'}
&&
defined
$thisfield
->
{'
max
'};
say
"
max:
$thisfield
->{'max'}
"
if
defined
$thisfield
->
{'
max
'};
}
elsif
(
$field
eq
'
sender
'
||
$field
eq
'
sequenced_by
'
||
(
$thisfield
->
{'
userfield
'}
//
''
)
eq
'
yes
'
)
{
say
"
<a href=
\"
$self
->{'system'}->{'script_name'}?db=
$self
->{'instance'}&page=fieldValues&field=f_sender
\"
"
.
"
target=
\"
_blank
\"
>Click for list of sender ids</a>
";
...
...
scripts/automation/autotag.pl
View file @
0d917663
...
...
@@ -62,7 +62,8 @@ GetOptions(
'
o|order
'
=>
\
$opts
{'
o
'},
'
q|quiet
'
=>
\
$opts
{'
q
'},
'
r|random
'
=>
\
$opts
{'
r
'},
'
T|already_tagged
'
=>
\
$opts
{'
T
'}
'
T|already_tagged
'
=>
\
$opts
{'
T
'},
'
v|view=s
'
=>
\
$opts
{'
v
'}
)
or
die
("
Error in command line arguments
\n
");
if
(
$opts
{'
h
'}
)
{
...
...
@@ -235,6 +236,9 @@ ${bold}--threads$norm ${under}THREADS$norm
${bold}-T,
--
already_tagged$norm
Scan
even
when
sequence
tagged
(
no
designation
)
.
$
{
bold
}
-
v
,
--
view$norm
$
{
under
}
VIEW$norm
Isolate
database
view
(
overrides
value
set
in
config
.
xml
)
.
$
{
bold
}
-
w
,
--
word_size$norm
$
{
under
}
SIZE$norm
BLASTN
word
size
.
...
...
scripts/automation/scannew.pl
View file @
0d917663
...
...
@@ -63,7 +63,8 @@ GetOptions(
'
n|new_only
'
=>
\
$opts
{'
n
'},
'
o|order
'
=>
\
$opts
{'
o
'},
'
r|random
'
=>
\
$opts
{'
r
'},
'
T|already_tagged
'
=>
\
$opts
{'
T
'}
'
T|already_tagged
'
=>
\
$opts
{'
T
'},
'
v|view=s
'
=>
\
$opts
{'
v
'}
)
or
die
("
Error in command line arguments
\n
");
if
(
$opts
{'
h
'}
)
{
...
...
@@ -235,6 +236,9 @@ ${bold}--threads$norm ${under}THREADS$norm
${bold}-T,
--
already_tagged$norm
Scan
even
when
sequence
tagged
(
no
designation
)
.
$
{
bold
}
-
v
,
--
view$norm
$
{
under
}
VIEW$norm
Isolate
database
view
(
overrides
value
set
in
config
.
xml
)
.
$
{
bold
}
-
w
,
--
word_size$norm
$
{
under
}
SIZE$norm
BLASTN
word
size
.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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