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
f88c96ae
Commit
f88c96ae
authored
21 years ago
by
Graham McVicker
Browse files
Options
Downloads
Patches
Plain Diff
out of date
parent
92b62a28
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
scripts/make_db_flatfiles
+0
-177
0 additions, 177 deletions
scripts/make_db_flatfiles
with
0 additions
and
177 deletions
scripts/make_db_flatfiles
deleted
100755 → 0
+
0
−
177
View file @
92b62a28
#!/usr/local/bin/perl
BEGIN
{
unshift
(
@INC
,"
../ensembl/modules
");
unshift
(
@INC
,"
../bioperl-live
");
}
use
Bio::EnsEMBL::
DBLoader
;
use
Bio::EnsEMBL::DBSQL::
Obj
;
use
Bio::EnsEMBL::
EMBL_Dump
;
use
strict
;
use
Bio::EnsEMBL::Utils::
Eprof
qw( eprof_start eprof_end eprof_dump)
;
my
$dbuser
=
'
ensro
';
my
$dbname
=
'
ensembl080
';
#my $host = 'obi-wan';
#my $host = 'cgisrv4';
my
$host
=
'
ensrv1
';
my
$dbpass
=
undef
;
sub
get_locator
{
return
"
Bio::EnsEMBL::DBSQL::Obj/host=
$host
;dbname=
$dbname
;user=
$dbuser
;pass=
$dbpass
";
}
$|
=
1
;
my
$outpath
=
'
/mysql/dumps/
';
my
@clones
=
();
my
@contigs
;
my
$db
;
my
$count
=
0
;
eval
{
my
$locator
=
get_locator
();
$db
=
Bio::EnsEMBL::
DBLoader
->
new
(
$locator
);
};
if
(
$@
)
{
print
STDERR
"
Apologies. An exception occured: $@
\n
";
exit
;
}
@clones
=
&find_clones
(
$db
);
if
(
$ARGV
[
1
]
=~
/start=(.*)/
){
while
(
$clones
[
0
]
ne
$
1
){
shift
(
@clones
);
}
}
for
(
0
..
7
){
shift
@clones
;}
my
$num
=
scalar
@clones
;
print
STDERR
"
Writing flat files for
$num
clones...
\n
";
die
"
No clones!
\n
"
unless
(
@clones
);
my
$emblout
;
my
(
$clone
,
$as
);
HOP:
foreach
my
$c
(
@clones
){
$count
++
;
#&eprof_dump(\*STDERR);
eval
{
$clone
=
$db
->
get_Clone
(
$c
);
$as
=
$clone
->
virtualcontig
;
};
if
(
$@
){
print
STDERR
"
Exception in embldump for
$c
!: $@
\n
";
next
;
}
eval
{
&eprof_start
('
make_db_flatfiles - genbank
');
my
$filename
=
"
$outpath
/genbank/
$c
.genbank
";
print
STDERR
"
Creating genbank dump file
$count
:
$filename
...
\n
";
open
(
FLAT
,
"
>
$filename
")
or
die
"
Cannot create flat file (
$filename
): $!
\n
";
&eprof_start
('
make_db_flatfiles - add_comments
');
&
Bio::EnsEMBL::EMBL_Dump::
add_ensembl_comments
(
$as
);
&eprof_end
('
make_db_flatfiles - add_comments
');
&eprof_start
('
make_db_flatfiles - bio_seq
');
my
$gbout
=
Bio::
SeqIO
->
new
(
'
-format
'
=>
'
GenBank
',
-
fh
=>
\
*FLAT
);
&eprof_end
('
make_db_flatfiles - bio_seq
');
&eprof_start
('
make_db_flatfiles - ensembl_dump
');
&
Bio::EnsEMBL::EMBL_Dump::
ensembl_annseq_output
(
$gbout
);
&eprof_end
('
make_db_flatfiles - ensembl_dump
');
# genbank format - the ID line is wrong. Fall back to locus
#$gbout->_id_generation_func(undef);
#$gbout->_ac_generation_func(undef);
#$as->accession($clone->id());
#$as->division("PRI");
&eprof_start
('
make_db_flatfiles - write_seq
');
$gbout
->
write_seq
(
$as
);
&eprof_end
('
make_db_flatfiles - write_seq
');
close
(
FLAT
);
&eprof_end
('
make_db_flatfiles - genbank
');
my
$filename
=
"
$outpath
/embl/
$c
.embl
";
print
STDERR
"
Creating embldump file
$count
:
$filename
...
\n
";
open
(
FLAT
,
"
>
$filename
")
or
die
"
Cannot create flat file (
$filename
): $!
\n
";
my
$emblout
=
Bio::
SeqIO
->
new
(
'
-format
'
=>
'
EMBL
',
-
fh
=>
\
*FLAT
);
&
Bio::EnsEMBL::EMBL_Dump::
ensembl_annseq_output
(
$emblout
);
$emblout
->
write_seq
(
$as
);
close
(
FLAT
);
};
if
(
$@
){
print
STDERR
"
Exception in embldump for
$c
!: $@
\n
";
next
;
}
}
1
;
############################################################################
sub
find_clones
{
my
(
$db
)
=
@_
;
my
@clones
;
my
$sql
=
"";
if
(
$ARGV
[
0
]
eq
'
all
'){
$sql
=
"
select id from clone
";
}
elsif
(
$ARGV
[
0
]
=~
/clone=(.*)/
){
$sql
=
"
select id from clone where id= '$1'
";
}
else
{
$sql
=
"
select id from clone where stored>'2000-05-04 17:22:05'
";
}
my
$sth
=
$db
->
prepare
("
$sql
");
my
$rv
=
$sth
->
execute
();
while
(
my
$row
=
$sth
->
fetchrow
)
{
push
(
@clones
,
$row
);
}
return
@clones
;
}
############################################################################
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