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
09ff91f0
Commit
09ff91f0
authored
15 years ago
by
Ian Longden
Browse files
Options
Downloads
Patches
Plain Diff
removed as never used and just confusing
parent
b94a0f50
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/XrefParser/HGNC_ENSGParser.pm
+0
-108
0 additions, 108 deletions
misc-scripts/xref_mapping/XrefParser/HGNC_ENSGParser.pm
with
0 additions
and
108 deletions
misc-scripts/xref_mapping/XrefParser/HGNC_ENSGParser.pm
deleted
100644 → 0
+
0
−
108
View file @
b94a0f50
package
XrefParser::
HGNC_ENSGParser
;
use
strict
;
use
DBI
;
use
base
qw( XrefParser::BaseParser )
;
# Parse file of HGNC records and assign direct xrefs
# All assumed to be linked to genes
sub
run
{
my
(
$self
,
$source_id
,
$species_id
,
$file
)
=
@_
;
my
$hugo_io
=
$self
->
get_filehandle
(
$file
);
if
(
!
defined
$hugo_io
)
{
print
"
Could not open
$file
\n
";
return
1
;
}
my
$line_count
=
0
;
my
$xref_count
=
0
;
# becouse the direct mapping have no descriptions etc
# we have to steal these fromt he previous HGNC parser.
# This is why the order states this is after the other one.
# maybe 1091,1092 is not right maybe should use name = HGNC and priority = 30r4 ??
my
%label
;
my
%version
;
my
%description
;
my
$dbi
=
$self
->
dbi
();
#get the source ids for HGNC refseq, entrezgene and unitprot
my
$sql
=
'
select source_id, priority_description from source where name like "HGNC"
';
my
$sth
=
$dbi
->
prepare
(
$sql
);
$sth
->
execute
();
my
(
$hgnc_source_id
,
$desc
);
$sth
->
bind_columns
(
\
$hgnc_source_id
,
\
$desc
);
my
@arr
;
while
(
$sth
->
fetch
()){
push
@arr
,
$hgnc_source_id
;
}
$sth
->
finish
;
$sql
=
"
select accession, label, version, description from xref where source_id in (
"
.
join
("
,
",
@arr
)
.
"
)
";
print
"
$sql
\n
";;
$sth
=
$dbi
->
prepare
(
$sql
);
$sth
->
execute
();
my
(
$acc
,
$lab
,
$ver
);
my
$hgnc_loaded_count
=
0
;
$sth
->
bind_columns
(
\
$acc
,
\
$lab
,
\
$ver
,
\
$desc
);
while
(
my
@row
=
$sth
->
fetchrow_array
())
{
$label
{
$acc
}
=
$lab
;
$version
{
$acc
}
=
$ver
;
$description
{
$acc
}
=
$desc
;
$hgnc_loaded_count
++
;
}
$sth
->
finish
;
if
(
$hgnc_loaded_count
==
0
){
die
"
No point continuing no hgncs there
\n
";
}
print
"
$hgnc_loaded_count
HGNC's to be used as labels
\n
";
my
$ignore_count
=
0
;
my
$ignore_examples
=
"";
my
%acc
;
while
(
$_
=
$hugo_io
->
getline
()
)
{
my
(
$hgnc
,
$stable_id
)
=
split
;
if
(
!
defined
(
$label
{
$hgnc
})){
$ignore_count
++
;
if
(
$ignore_count
<
10
){
$ignore_examples
.=
"
"
.
$hgnc
;
}
next
;
}
if
(
!
defined
(
$acc
{
$hgnc
})){
$acc
{
$hgnc
}
=
1
;
my
$version
=
"";
$line_count
++
;
my
$xref_id
=
$self
->
add_xref
(
$hgnc
,
$version
{
$hgnc
}
,
$label
{
$hgnc
}
||
$hgnc
,
$description
{
$hgnc
},
$source_id
,
$species_id
,
"
DIRECT
");
$xref_count
++
;
$self
->
add_direct_xref
(
$xref_id
,
$stable_id
,
"
gene
",
"");
}
}
print
"
Parsed
$line_count
HGNC identifiers from
$file
, added
$xref_count
xrefs and
$line_count
direct_xrefs
\n
";
if
(
$ignore_count
){
print
$ignore_count
.
"
ignoreed due to numbers no identifiers being no longer valid :-
$ignore_examples
\n
";
}
$hugo_io
->
close
();
return
0
;
}
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