AlexsLemonade / AlexsLemonade/refinebio

Experiments not found in dataset

Open
#2,301 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
135
Forks
21
PR merge metrics
No merged PRs in 30d

Description

### Context

I am working to integrate metasra.biostat.wisc.edu with the refine.bio dataset download (https://api.refine.bio/v1/dataset/{id}). First, our refine.bio integration is working. This is a refine.bio feature change request. The issue we are having is when transferring a user to refine.bio for the dataset download. If the refine.bio dataset has no results for our experiment query, then the refine.bio download page displays, "Couldn't get any files to smash for Smash job!!”

### Problem or idea

The "smash" error gives our user the impression that an error occurred. Actually, our metasra application requested a refine.bio dataset containing only experiments not found in refine.bio (for example, http://metasra.biostat.wisc.edu/?and=CL:0000905,UBERON:0001155&species=human&assay=RNA-seq). In this example, the metasra result set only has one experiment/study: ERP104512. The refine.bio dataset download "smash" error is encountered when transferring the dataset request contains only the ERP104512 experiment to refine.bio (for example, https://www.refine.bio/dataset/731088f9-295d-4dc2-b59d-0816a18258ba). Searching to verify refine.bio does not contain ERP104512 (https://www.refine.bio/search?q=ERP104512) does indeed return no results.

To avoid transferring a request to refine.bio that would produce the "smash" error, I added a check to verify each metasra experiment is present in refine.bio. The thought process: during the refine.bio url generation, search refine.bio for each metasra experiment id. If the metasra experiment id is not found in refine.bio, then drop the experiment from the dataset payload sent to refine.bio. If there are no experiments in the refine.bio payload, then do not display the "Download from refine.bio" button. Instead, display a "no results found at refine.bio" message.

I added the refine.bio experiment check before adding the metasra study to the refine.bio dataset payload. This works, but the refine.bio api returns 404 if the record is not found (example browser error message, "GET https://api.refine.bio/v1/experiments/ERP104512/ 404 (Not Found)"). The issue with 404 is that the browser will always send the 404 message to the browser console log as an error, which in this case the 404 is not an error. The 404 in this case means there was no records found in refine.bio for the given study ID. There is no way around the browser logging a 404 as an error (see the following reference, https://stackoverflow.com/questions/41509169/angular2-404-exception-handling).

### Solution or next step

Add a check to the refine.bio dataset download (https://www.refine.bio/dataset/{id}) for no experiment records found and display a message that reflects, "no records found." This change would effectively remove the "smash" message from the dataset download page for the use case where no records are found.

Change the refine.bio API /experiments/{accession_code}/ search to not return 404 when the record is not found. Instead return 200 with a json response containing a status state (success: false) and reason message such as, "no records found."

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the refine.bio dataset download flow at /dataset/{id} and the /experiments/{accession_code}/ API search described in the issue. Verify how an empty experiment result reaches the download page and how a missing record is represented. Done means the page shows a no-records message instead of the “smash” error, and the API behavior matches the agreed response.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, python
Domain
api, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.