X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=acro_gene;h=083dd0ef47eb3ec704b6d7648a2f677f1705ae90;hb=cc72aef100329d6f16efb453b618c0f6dee43210;hp=46c9621efcba528407f3ed41226b3bc8a0f827aa;hpb=1bcc23e58e26c3e071a7168748072572eb52004a;p=bin.git diff --git a/acro_gene b/acro_gene index 46c9621..083dd0e 100755 --- a/acro_gene +++ b/acro_gene @@ -87,6 +87,7 @@ open($fh,'<',$options{gene_db}) or my @header; my %genes; +my %aliases; while (<$fh>) { chomp; my @r = split /\t/; @@ -97,11 +98,20 @@ while (<$fh>) { my %r; @r{@header} = @r; $genes{$r{symbol}} = $r{name}; + my $alias = $r{alias_symbol}; + $alias =~ s/"//g; + my @aliases = split /\|/,$alias; + $aliases{@aliases} = ($r{name}) x @aliases; } for (@ARGV) { my $gene = $_; my $name = $genes{$gene}; + if (not defined $name) { + $gene = $aliases{$gene}; + next unless defined $gene; + $name = $genes{$gene}; + } print '\DeclareAcronym{'. $gene.'}{short=\href{http://www.genenames.org/cgi-bin/gene_symbol_report?match='. $gene.'}{'.$gene.'},long={'.$name.