Skip to content
Snippets Groups Projects
Commit fb8c0639 authored by Ian Longden's avatar Ian Longden
Browse files

use EntrezGene as a valid source too

parent 87639501
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ sub run {
my %description;
my $dbi = $self->dbi();
my $sql = "select accession, label, version, description from xref where source_id in (1091, 1092)";
my $sql = "select accession, label, version, description from xref where source_id in (1091, 1092, 1094)";
my $sth = $dbi->prepare($sql);
$sth->execute();
my ($acc, $lab, $ver, $desc);
......@@ -66,11 +66,20 @@ sub run {
my $line_count = 0;
my $xref_count = 0;
my %seen;
my $ignore_count = 0;
my $ignore_examples ="";
while(<HUGO>){
chomp;
my ($ccds,$hgnc) = split;
$line_count++;
if(!defined($label{$hgnc})){
$ignore_count++;
if($ignore_count < 10){
$ignore_examples .= " ".$hgnc;
}
next;
}
if(!defined($seen{$hgnc})){
$seen{$hgnc} = 1;
my $key = "CCDS".$ccds;
......@@ -83,6 +92,9 @@ sub run {
}
}
print "Parsed $line_count HGNC identifiers from $file, added $xref_count xrefs and $xref_count direct_xrefs from $line_count lines.\n";
if($ignore_count){
print $ignore_count." ignoreed due to numbers no identifiers being no longer valid :- $ignore_examples\n";
}
close(HUGO);
return 0;
......
......@@ -35,7 +35,7 @@ sub run {
my %description;
my $dbi = $self->dbi();
my $sql = "select accession, label, version, description from xref where source_id in (1091, 1092)";
my $sql = "select accession, label, version, description from xref where source_id in (1091, 1092, 1094)";
my $sth = $dbi->prepare($sql);
$sth->execute();
my ($acc, $lab, $ver, $desc);
......@@ -48,12 +48,20 @@ sub run {
$sth->finish;
my $ignore_count = 0;
my $ignore_examples ="";
my %acc;
while (<HUGO>) {
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 ="";
......@@ -68,7 +76,9 @@ sub run {
}
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";
}
close(HUGO);
return 0;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment