Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Peach API with BioStudies in export_atlas_ebeye_xml.pl #28

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

anilthanki
Copy link
Contributor

The goal here is to fix export_atlas_ebeye_xml.pl

As the Peach API is deprecated, the function that returns 'public' or 'private' status will fail:

sub get_privacy{
    ...
     my $url = "http://peach.ebi.ac.uk:8480/api/privacy.txt?acc=$expId";
     my $ua = LWP::UserAgent->new;
     my $response = $ua->get($url)->content;
    ...
}

In this PR https://github.com/ebi-gene-expression-group/atlas-prod/pull/255 we solve it by using an internal file and when not available querying the BioStudies API.

The difference now is that the data resulting from the query comes in JSON format , e.g the following will return true:

curl -sS "https://www.ebi.ac.uk/biostudies/api/v1/search?type=study&accession=E-MTAB-10293" | jq .hits[0] | jq .isPublic

@anilthanki anilthanki changed the title Replace Peach API call in Update export_atlas_ebeye_xml.pl Replace Peach API with BioStudies in export_atlas_ebeye_xml.pl Feb 27, 2023
Copy link
Member

@pmb59 pmb59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @anilthanki I 've tested the code locally and it works.

However, I see a fundamental flaw in the logic. Because this is not run with login permissions in AE/Biostudies, all private accessions will report error as "not found"

Take for example this accession E-MTAB-7839 that I know it's private. It's going to log the error "Accession not found".
Possible solutions:

  1. We search in first instance in the file provided by BioStudies, and then if necessary into the API, and assume not found equals to private.
  2. We directly assume that if it's not found by the API it's private. But that could also bring errors, for instance E-MTAB-100000000000 (not existing) will be reported as Private.

Option 1 will minimise problems. Maybe you can use the same login here using the env variable $ENV{'BIOSTUDIES_AE_PRIVACY_STATUS_FILE'})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants