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
6d5c51d6
Commit
6d5c51d6
authored
23 years ago
by
Philip Lijnzaad
Browse files
Options
Downloads
Patches
Plain Diff
added disease
parent
db14fadd
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/utilities/satellite_dbdump_bychr.pl
+54
-4
54 additions, 4 deletions
misc-scripts/utilities/satellite_dbdump_bychr.pl
with
54 additions
and
4 deletions
misc-scripts/utilities/satellite_dbdump_bychr.pl
+
54
−
4
View file @
6d5c51d6
...
...
@@ -62,6 +62,7 @@ my $mysqldump = 'mysqldump'; # in $PATH we trust
# satellites:
my
$famdb
;
my
$diseaseb
;
# end of satellites
&GetOptions
(
...
...
@@ -74,6 +75,7 @@ my $famdb;
'
workdir:s
'
=>
\
$workdir
,
'
limit:n
'
=>
\
$lim
,
'
family:s
'
=>
\
$famdb
,
'
disease:s
'
=>
\
$diseasedb
,
);
die
"
need a litedb; use -litedb something
"
unless
$litedb
;
...
...
@@ -85,10 +87,6 @@ if ($lim) {
$limit
=
"
limit
$lim
";
}
my
$locator
=
"
$module
/host=
$host
;port=;dbname=
$litedb
;user=
$dbuser
;pass=
$dbpass
";
# $liteh = Bio::EnsEMBL::DBLoader->new($locator);
# $liteh->{RaiseError}++;
if
(
$famdb
)
{
my
$dumpdir
=
"
$workdir
/
$famdb
";
dump_schema
(
$famdb
,
$dumpdir
,
'
family.sql
');
...
...
@@ -114,6 +112,57 @@ WHERE g.chr_name = '$chr'
dump_data
(
$litedb
,
$sql
,
$dumpdir
,
'
family_members.dat
'
);
}
if
(
$diseasedb
)
{
my
$dumpdir
=
"
$workdir
/
$diseasedb
";
dump_schema
(
$diseasedb
,
$dumpdir
,
'
disease.sql
');
# may need an ALTER TABLE gene ADD KEY(gene_symbol);
my
$sql
;
$sql
=
"
SELECT dg.*
FROM
$diseasedb
.gene dg,
$litedb
.gene lg,
$litedb
.gene_xref lgx
WHERE lg.chr_name = '
$chr
'
AND lg.gene = lgx.gene
AND lgx.display_id = dg.gene_symbol
";
dump_data
(
$litedb
,
$sql
,
$dumpdir
,
'
gene.dat
'
);
$sql
=
"
SELECT dd.*
FROM
$diseasedb
.gene dg,
$diseasedb
.disease dd,
$litedb
.gene lg,
$litedb
.gene_xref lgx
WHERE lg.chr_name = '
$chr
'
AND lg.gene = lgx.gene
AND lgx.display_id = dg.gene_symbol
AND dd.id = dg.id;
";
dump_data
(
$litedb
,
$sql
,
$dumpdir
,
'
disease.dat
'
);
# here's the sql to restrict the disease_index_*list, but they're so small
# it's really not worth the trouble. Left here in case anyone is interested
# $sql = "
# SELECT ddl.*
# FROM $diseasedb.gene dg,
# $diseasedb.disease_index_doclist ddl,
# $litedb.gene lg,
# $litedb.gene_xref lgx
# WHERE lg.chr_name = '$chr'
# AND lg.gene = lgx.gene
# AND lgx.display_id = dg.gene_symbol
# AND ddl.id = dg.id
# ";
foreach
my
$w
(
qw(doc stop vector word)
)
{
my
$table
=
"
disease_index_
${w}
list
";
$sql
=
"
select * from
$diseasedb
.
$table
";
dump_data
(
$litedb
,
$sql
,
$dumpdir
,
"
$table
.dat
"
);
}
}
sub
dump_schema
{
my
(
$dbinstance
,
$destdir
,
$destfile
)
=
@_
;
...
...
@@ -148,6 +197,7 @@ sub dump_data {
}
}
## stuff below is not used (yet), since everything is done by plain SQL
## This comes from family-input.pl, and should at one point be put somewhere
## more central (the ones in EnsEMBL load modules etc. that are not relevant)
...
...
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