Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
0561890c
Commit
0561890c
authored
20 years ago
by
Arne Stabenau
Browse files
Options
Downloads
Patches
Plain Diff
changed to use variation database for snps
parent
644c1e14
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc-scripts/density_feature/seq_region_stats.pl
+15
-10
15 additions, 10 deletions
misc-scripts/density_feature/seq_region_stats.pl
with
15 additions
and
10 deletions
misc-scripts/density_feature/seq_region_stats.pl
+
15
−
10
View file @
0561890c
use
strict
;
use
Bio::EnsEMBL::DBSQL::
DBAdaptor
;
use
Bio::EnsEMBL::
Lite
::
DBAdaptor
;
use
Bio::EnsEMBL::
Variation::DBSQL
::
DBAdaptor
;
use
Getopt::
Long
;
my
(
$host
,
$user
,
$pass
,
$port
,
$dbname
,
$genestats
,
$snpstats
);
...
...
@@ -54,7 +54,7 @@ if( ! $seq_region_count ) {
exit
();
}
my
$snps_present
=
$snpstats
&&
lite
_attach
(
$db
);
my
$snps_present
=
$snpstats
&&
variation
_attach
(
$db
);
my
$slice_adaptor
=
$db
->
get_SliceAdaptor
();
...
...
@@ -105,7 +105,7 @@ foreach my $slice (@$top_slices) {
}
if
(
$snps_present
)
{
my
$snps
=
$slice
->
get_all_
SNP
s
();
my
$snps
=
$slice
->
get_all_
VariationFeature
s
();
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
SNP Count
',
-
CODE
=>
'
SNPCount
',
...
...
@@ -132,10 +132,10 @@ sub print_chromo_stats {
#
# tries to attach
lit
e.
# tries to attach
variation databas
e.
#
sub
lite
_attach
{
sub
variation
_attach
{
my
$db
=
shift
;
my
$core_db_name
;
...
...
@@ -146,27 +146,32 @@ sub lite_attach {
#
# get a lost of all databases on that server
#
my
$sth
=
$db
->
dbc
()
->
prepare
(
"
show databases
"
);
my
$sth
=
$db
->
dbc
->
prepare
(
"
show databases
"
);
$sth
->
execute
();
my
$all_db_names
=
$sth
->
fetchall_arrayref
();
my
%all_db_names
=
map
{(
$_
->
[
0
]
,
1
)}
@$all_db_names
;
my
$snp_db_name
=
$core_db_name
;
$snp_db_name
=~
s/_core_/_
lite
_/
;
$snp_db_name
=~
s/_core_/_
variation
_/
;
if
(
!
exists
$all_db_names
{
$snp_db_name
}
)
{
return
0
;
}
my
$snp_db
=
Bio::EnsEMBL::Lite::
DBAdaptor
->
new
# this should register the dbadaptor with the Registry
my
$snp_db
=
Bio::EnsEMBL::Variation::DBSQL::
DBAdaptor
->
new
(
-
host
=>
$db
->
host
(),
-
user
=>
$db
->
username
(),
-
pass
=>
$db
->
password
(),
-
port
=>
$db
->
port
(),
-
dbname
=>
$snp_db_name
);
$db
->
add_db_adaptor
(
"
lite
",
$snp_db
);
-
dbname
=>
$snp_db_name
,
-
group
=>
"
variation
",
-
species
=>
"
DEFAULT
"
);
return
1
;
}
1
;
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment