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
bcee550a
Commit
bcee550a
authored
17 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
Added creation of new 'analysis' if one does not already exist AND if
$do_upload is true. TODO: testing
parent
b2d8f330
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/xref_mapping/XrefMapper/CoordinateMapper.pm
+41
-17
41 additions, 17 deletions
misc-scripts/xref_mapping/XrefMapper/CoordinateMapper.pm
with
41 additions
and
17 deletions
misc-scripts/xref_mapping/XrefMapper/CoordinateMapper.pm
+
41
−
17
View file @
bcee550a
...
...
@@ -115,8 +115,33 @@ sub run_coordinatemapping {
log_progress
("
Can not find analysis ID for this analysis:
\n
");
log_progress
("
logic_name = 'XrefCoordinateMapping'
\n
");
log_progress
(
"
parameters = '%s'
\n
",
$analysis_params
);
log_progress
("
A new analysis will be added
\n
");
}
else
{
if
(
$do_upload
)
{
##################################################################
# Store a new analysis. #
##################################################################
log_progress
("
A new analysis will be added
\n
");
$analysis_id
=
$core_dbh
->
selectall_arrayref
(
'
SELECT MAX(analysis_id) FROM analysis
')
->
[
0
][
0
];
log_progress
(
"
Last used analysis_id is %d
\n
",
$analysis_id
);
my
$sql
=
'
INSERT INTO analysis
'
.
'
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
';
my
$sth
=
$core_dbh
->
prepare
(
$sql
);
$sth
->
execute
(
++
$analysis_id
,
'
now()
',
'
XrefCoordinateMapping
',
'
\N
',
'
\N
',
'
\N
',
'
xref_mapper.pl
',
'
\N
',
'
\N
',
$analysis_params
,
'
CoordinateMapper.pm
',
'
\N
',
'
\N
',
'
\N
'
);
}
}
## end if ( !defined($analysis_id...
if
(
defined
(
$analysis_id
)
)
{
log_progress
(
"
Analysis ID is %d
\n
",
$analysis_id
);
}
...
...
@@ -476,15 +501,17 @@ sub dump_xref {
# Assign 'xref_id' to this Xref.
$xref
->
{'
xref_id
'}
=
++
$xref_id
;
$fh
->
printf
("
%d
\t
%d
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
\n
",
$xref
->
{'
xref_id
'},
$xref
->
{'
external_db_id
'},
$xref
->
{'
accession
'},
$xref
->
{'
accession
'},
'
0
',
'
\N
',
'
MISC
',
# FIXME
'
\N
'
# FIXME (possibly)
$fh
->
printf
(
"
%d
\t
%d
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
\n
",
$xref
->
{'
xref_id
'},
$xref
->
{'
external_db_id
'},
$xref
->
{'
accession
'},
$xref
->
{'
accession
'},
'
0
',
'
\N
',
'
MISC
',
# FIXME (add new 'info_type' enum 'COORDINATEOVERLAP'
# in release v49)
'
\N
'
# FIXME (possibly)
);
}
$fh
->
close
();
...
...
@@ -677,11 +704,11 @@ sub dump_unmapped_object {
$xref
->
{'
unmapped_object_id
'}
=
++
$unmapped_object_id
;
$fh
->
printf
(
"
%d
\t
%s
\t
%
d
\t
%d
\t
%s
\t
%d
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
\n
",
"
%d
\t
%s
\t
%
s
\t
%d
\t
%s
\t
%d
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
\n
",
$xref
->
{'
unmapped_object_id
'},
'
xref
',
$analysis_id
||
-
1
,
#
-1
means
create
analysis
for
# this when uploading
$analysis_id
||
'
\N
'
,
#
'\N' (NULL)
means
no
analysis
exists
# and uploading this table will fail.
$xref
->
{'
external_db_id
'},
$xref
->
{'
accession
'},
$xref
->
{'
reason
'}
->
{'
unmapped_reason_id
'},
(
...
...
@@ -722,9 +749,6 @@ sub upload_unmapped_reason {
while
(
my
$line
=
$fh
->
getline
()
)
{
chomp
(
$line
);
my
@fields
=
split
(
/\t/
,
$line
);
# FIXME (when 'analysis_id' is -1)
$sth
->
execute
(
@fields
);
}
$fh
->
close
();
...
...
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