Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-otter
Commits
a3e98bef
Commit
a3e98bef
authored
Jan 31, 2019
by
Mira Prosovetskaia
Browse files
UserSpecies changes rever.
parent
423921a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
modules/Bio/Otter/Server/UserSpecies.pm
modules/Bio/Otter/Server/UserSpecies.pm
+17
-17
No files found.
modules/Bio/Otter/Server/UserSpecies.pm
View file @
a3e98bef
...
...
@@ -31,25 +31,25 @@ sub species_group{
# Connect to MySQL database
my
$dbh
=
DBI
->
connect
(
$dsn
,
$username
,
$password
,
\
%attr
);
# Set up hash of species for each user
my
%final_species_groups
=
query_links
(
$dbh
);
# Setting up 'dev','main', 'restricted' and 'mouse_strain' species groups
$final_species_groups
{'
species_groups
'}{'
dev
'}
=
[
'
human_test
'];
$final_species_groups
{'
species_groups
'}{'
main
'}
=
['
c_elegans
',
'
cat
',
'
chicken
',
'
chimp
',
'
cow
',
'
dog
',
'
drosophila
',
'
gibbon
',
'
gorilla
',
'
human
',
'
lemur
',
'
marmoset
',
'
medicago
',
'
mouse
',
'
mus_spretus
',
'
opossum
',
'
pig
',
'
platypus
',
'
rat
',
'
sheep
',
'
sordaria
',
'
tas_devil
',
'
tomato
',
'
tropicalis
',
'
wallaby
',
'
wheat
',
'
zebrafish
'];
$final_species_groups
{'
species_groups
'}{'
main
'}
=
['
c_elegans
',
'
cat
',
'
chicken
',
'
chimp
',
'
cow
',
'
dog
',
'
drosophila
',
'
gibbon
',
'
gorilla
',
'
human
',
'
lemur
',
'
marmoset
',
'
medicago
',
'
mouse
',
'
mus_spretus
',
'
opossum
',
'
pig
',
'
platypus
',
'
rat
',
'
sheep
',
'
sordaria
',
'
tas_devil
',
'
tomato
',
'
tropicalis
',
'
wallaby
',
'
wheat
',
'
zebrafish
'];
$final_species_groups
{'
species_groups
'}{'
mouse_strains
'}
=
['
mouse-SPRET-EiJ
',
'
mouse-PWK-PhJ
',
'
mouse-CAST-EiJ
',
'
mouse-WSB-EiJ
',
'
mouse-NZO-HlLtJ
',
'
mouse-C57BL-6NJ
',
'
mouse-NOD-ShiLtJ
',
'
mouse-FVB-NJ
',
'
mouse-DBA-2J
',
'
mouse-CBA-J
',
'
mouse-C3H-HeJ
',
'
mouse-AKR-J
',
'
mouse-BALB-cJ
',
'
mouse-A-J
',
'
mouse-LP-J
',
'
mouse-129S1-SvImJ
',
'
mouse-C57BL-6NJ_v1_test
'];
$final_species_groups
{'
species_groups
'}{'
restricted
'}
=
['
human_test
','
mouse_test
'];
# Disconnect from the MySQL database
$dbh
->
disconnect
();
return
\
%final_species_groups
;
}
sub
query_links
{
sub
query_links
{
my
(
$dbh
)
=
@_
;
my
%data_group
;
# Query the database
my
$sql_user_group
=
"
SELECT username, species_write, species_read FROM otter_species_access
";
my
$sth_user_group
=
$dbh
->
prepare
(
$sql_user_group
)
...
...
@@ -62,32 +62,32 @@ sub query_links{
# Setting up read and write species for each user
my
$username
=
$array_ref
->
[
0
];
$data_group
{'
user_groups
'}{
$username
.
'
.data
'}{'
users
'}
=
$username
;
my
$species_write_string
=
$array_ref
->
[
1
];
my
$species_write_string
=
$array_ref
->
[
1
];
if
(
$species_write_string
){
@species_write_array
=
split
'
,
',
$species_write_string
;
}
else
{
@species_write_array
=
();
}
$data_group
{'
user_groups
'}{
$username
.
'
.data
'}{'
write
'}
=
[
@species_write_array
];
}
$data_group
{'
user_groups
'}{
$username
.
'
.data
'}{'
write
'}
=
[
@species_write_array
];
my
$species_read_string
=
$array_ref
->
[
2
];
my
$species_read_string
=
$array_ref
->
[
2
];
if
(
$species_read_string
){
@species_read_array
=
split
'
,
',
$species_read_string
;
@species_read_array
=
split
'
,
',
$species_read_string
;
}
else
{
@species_read_array
=
();
}
@species_read_array
=
();
}
# $data_group{'user_groups'}{$username.'.data'}{'read'} = [@species_read_array]; #Uncomment this line when READONLY datasets are available
}
die
"
Error in fetchrow_array():
",
$sth_user_group
->
errstr
(),
"
\n
"
if
$sth_user_group
->
err
();
$sth_user_group
->
finish
();
return
%data_group
;
$sth_user_group
->
finish
();
return
%data_group
;
}
1
;
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