Skip to content

Commit

Permalink
Try new md5 API endpoint
Browse files Browse the repository at this point in the history
Hopefully this is more stable. It seems that too many queries to the
normal RNA endpoint cause issues. Hopefully using this end point
alleviates them.
  • Loading branch information
blakesweeney committed Jul 12, 2024
1 parent 5b35adb commit c4c268a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Rfam/Lib/Bio/Rfam/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2939,7 +2939,7 @@ sub ncbi_taxonomy_fetch_taxinfo {
sub rnacentral_md5_lookup {
my ( $in_md5 ) = @_;

my $rnacentral_url = "https://rnacentral.org/api/v1/rna?md5=" . $in_md5;
my $rnacentral_url = "https://rnacentral.org/api/v1/md5/" . $in_md5;
#printf("rnacentral_url: $rnacentral_url\n");
my $json = get($rnacentral_url);
if(! defined $json) { croak "ERROR trying to fetch from rnacentral using md5: " . $in_md5; }
Expand All @@ -2952,13 +2952,11 @@ sub rnacentral_md5_lookup {
my $id = undef;
my $desc = undef;

if((defined $decoded_json->{'results'}) &&
(defined $decoded_json->{'results'}[0]{'md5'}) &&
(defined $decoded_json->{'results'}[0]{'rnacentral_id'})) {
if((defined $decoded_json->{'rnacentral_id'})) {
$have_seq = 1;
$md5 = $decoded_json->{'results'}[0]{'md5'};
$id = $decoded_json->{'results'}[0]{'rnacentral_id'};
$desc = $decoded_json->{'results'}[0]{'description'};
$md5 = $in_md5;
$id = $decoded_json->{'rnacentral_id'};
$desc = $decoded_json->{'description'};
}

return ($have_seq, $md5, $id, $desc);
Expand Down

0 comments on commit c4c268a

Please sign in to comment.