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
7ab71455
Commit
7ab71455
authored
21 years ago
by
Graham McVicker
Browse files
Options
Downloads
Patches
Plain Diff
no longer relevant
parent
27cb9af0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/denormalize
+0
-173
0 additions, 173 deletions
scripts/denormalize
with
0 additions
and
173 deletions
scripts/denormalize
deleted
100755 → 0
+
0
−
173
View file @
27cb9af0
#!/usr/local/bin/perl
use
strict
;
use
Bio::EnsEMBL::DBSQL::
DBAdaptor
;
use
Bio::EnsEMBL::
Clone
;
use
Bio::EnsEMBL::
RawContig
;
use
Getopt::
Long
;
my
$host
=
'
ecs1a
';
my
$dbname
=
'
mouse_sc011015_alistair
';
my
$newhost
=
'
ecs1f
';
my
$newdbname
=
'
mouse_denormalize_test2
';
my
$newpath
=
'
CHR
';
my
$dbuser
=
'
ensadmin
';
my
$pass
=
'
ensembl
';
my
$path
=
'
sanger_20011015_2
';
my
$genes
=
0
;
my
$feature
=
0
;
my
$genewise
=
0
;
my
$repeat
=
0
;
my
$chunk
=
5000000
;
my
$threshold
=
0
;
my
$chr_name
;
$|
=
1
;
&GetOptions
(
'
host:s
'
=>
\
$host
,
'
dbuser:s
'
=>
\
$dbuser
,
'
dbname:s
'
=>
\
$dbname
,
'
genes
'
=>
\
$genes
,
'
feature
'
=>
\
$feature
,
'
repeat
'
=>
\
$repeat
,
'
path=s
'
=>
\
$path
,
'
pass:s
'
=>
\
$pass
,
'
chunk:n
'
=>
\
$chunk
,
'
threshold:n
'
=>
\
$threshold
,
'
chrname:s
'
=>
\
$chr_name
,
);
print
STDERR
"
Time in dumpgff
"
.
time
.
"
\n
";
my
$db
=
new
Bio::EnsEMBL::DBSQL::
DBAdaptor
(
-
host
=>
$host
,
-
user
=>
$dbuser
,
-
dbname
=>
$dbname
,
-
pass
=>
$pass
);
my
$newdb
=
new
Bio::EnsEMBL::DBSQL::
DBAdaptor
(
-
host
=>
$newhost
,
-
user
=>
$dbuser
,
-
dbname
=>
$newdbname
,
-
pass
=>
$pass
);
print
STDERR
"
Time after db
"
.
time
.
"
\n
";
print
STDERR
"
Connected to database
\n
";
$db
->
assembly_type
(
$path
);
my
$slice_adp
=
$db
->
get_SliceAdaptor
();
my
$chr_adp
=
$db
->
get_ChromosomeAdaptor
();
my
@chrs
=
@
{
$chr_adp
->
fetch_all
};
my
%analysis
;
CHR:
foreach
my
$chr
(
@chrs
)
{
next
CHR
unless
$chr
->
name
eq
$chr_name
;
my
$length
=
$chr
->
length
;
print
STDERR
"
Chromosome
$chr
length
$length
\n
";
my
$current
=
1
;
while
(
$current
<=
$length
)
{
print
STDERR
"
Time before chunk
"
.
time
.
"
\n
";
my
$end
=
$current
+
$chunk
-
1
;
if
(
$end
>
$length
)
{
$end
=
$length
;
}
my
$slice
=
$slice_adp
->
fetch_by_chr_start_end
(
$chr
,
$current
,
$end
);
my
$repeats
=
$slice
->
get_all_RepeatFeatures
if
(
$repeat
);
my
$feat
=
$slice
->
get_all_SimilarityFeatures
if
(
$feature
);
my
$seq
=
$slice
->
seq
;
my
$cloneid
=
$chr
.
"
.
$current
-
$end
";
my
$clone
=
new
Bio::EnsEMBL::
Clone
;
$clone
->
htg_phase
(
3
);
$clone
->
id
(
$cloneid
);
my
$contigid
=
$cloneid
;
my
$contig
=
new
Bio::EnsEMBL::
RawContig
;
$contig
->
name
(
$contigid
);
$contig
->
seq
(
$seq
);
print
STDERR
"
Contig id
"
.
$contigid
.
"
\n
";
print
STDERR
"
Repeats are
"
.
scalar
(
@$repeats
)
.
"
\n
";
foreach
my
$f
(
@$repeats
)
{
$f
->
contig
(
$contig
);
}
foreach
my
$f
(
@$feat
)
{
if
(
$f
->
analysis
->
db
ne
"")
{
if
(
$f
->
score
>
$threshold
)
{
$f
->
contig
(
$contig
);
$f
->
analysis
->
program_version
(
1
);
}
}
else
{
$f
->
analysis
->
program_version
(
1
);
$f
->
contig
(
$contig
);
}
}
$clone
->
add_Contig
(
$contig
);
eval
{
$newdb
->
get_CloneAdaptor
->
store
(
$clone
);
print
STDERR
"
Written
"
.
$clone
->
id
.
"
scaffold into db
\n
";
};
if
(
$@
)
{
print
STDERR
"
Could not write clone into database, error was $@
\n
";
}
else
{
my
$contig
=
$newdb
->
get_RawContigContigAdaptor
->
fetch_by_name
(
$contigid
);
# put into the golden path
my
$len
=
(
$end
-
$current
+
1
);
my
$query
=
"
insert into assembly values('
$chr
','
$chr
',
"
.
$contig
->
dbID
.
"
,
$current
,
$end
,1,
$len
,1,
$len
,1,'
$newpath
')
";
my
$sth
=
$newdb
->
prepare
(
$query
);
my
$res
=
$sth
->
execute
;
}
$current
+=
$chunk
;
}
}
sub
print_analysis
{
my
(
$analysis
)
=
@_
;
print
STDERR
"
Analysis
\n
";
print
STDERR
"
Id
"
.
$analysis
->
id
.
"
\n
";
print
STDERR
"
Db
"
.
$analysis
->
db
.
"
\n
";
print
STDERR
"
Db_file
"
.
$analysis
->
db_file
.
"
\n
";
print
STDERR
"
Db_version
"
.
$analysis
->
db_version
.
"
\n
";
print
STDERR
"
Program
"
.
$analysis
->
program
.
"
\n
";
print
STDERR
"
Program_version
"
.
$analysis
->
program_version
.
"
\n
";
print
STDERR
"
Program_file
"
.
$analysis
->
program_file
.
"
\n
";
print
STDERR
"
Gff_source
"
.
$analysis
->
gff_source
.
"
\n
";
print
STDERR
"
Gff_feature
"
.
$analysis
->
gff_feature
.
"
\n
";
print
STDERR
"
Module
"
.
$analysis
->
module
.
"
\n
";
print
STDERR
"
Module_version
"
.
$analysis
->
module_version
.
"
\n
";
print
STDERR
"
Parameters
"
.
$analysis
->
parameters
.
"
\n
";
print
STDERR
"
Created
"
.
$analysis
->
created
.
"
\n
";
print
STDERR
"
Logic_name
"
.
$analysis
->
logic_name
.
"
\n
";
}
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