AlexsLemonade / AlexsLemonade/refinebio

RNA-Seq experiments are being shown which haven't had tximport run at the experiment-level

Open
#965 3 comments 0 reactions 0 assignees View on GitHub
backlog bug frontend SCIENCE! (A.K.A. research question) smasher
Dominant language
Python
Stars
135
Forks
21
PR merge metrics
No merged PRs in 30d

Description

### Context

In #963 I said:

> After discussing with @cansav09 we've identified that for experiment-level smash jobs we should be making sure to use files that came from the same tximport run.

### Problem or idea

I noticed today that the number of Result objects in the database is fewer than the number shown in the frontend:

![image](https://user-images.githubusercontent.com/4026833/50648579-9e0a1180-0f49-11e9-906d-a5a922618a4a.png)

(Note the 422 total results)

```
data_refinery=> select count(*) from computed_files where filename='txi_out.RDS';
count
-------
353
(1 row
```
(Yes I know that's an odd query to get this count, but I'm currently working on a branch to make this a more explicit relationship.)

The fact that these numbers don't match doesn't worry me, in fact I checked because I kinda expected it. In the front end we display experiments that have at least 1 sample with `is_processed=True`. Therefore any experiment which has a sample belonging to more than one experiment can end up being displayed once one of those other experiments get processed.

The problem comes in when someone adds these experiments to their dataset and then decides to smash at experiment level when tximport hasn't yet been run for that experiment. To make this clearer, here's an example:

Experiment A has Samples 1 and 2 and has had tximport run on it.
Experiment B has Samples 3 and 4 and has had tximport run on it.
Experiment C has Samples 1, 2, 3, 4, and 5 but Sample 5 hasn't been processed yet, so tximport has not yet been run for the full experiment.

The user decides he wants to download what data is available for Experiment C and chooses to smash at the experiment level.

Experiment C has samples 1, 2, 3, and 4 available, but they were produced in two different runs of tximport (two of them for Experiment A, two of them for Experiment B) and therefore it is probably not a good idea to combine them.

### Solution or next step

I'm not 100% sure if this is the optimal way to handle or prevent this, but I have A solution. I am currently working on a PR to add ExperimentResultAssociations between experiments and the ComputationResult objects created for tximport. For experiments that are ONLY RNA-Seq, we could only show them on the frontend if they have one of these associations.

### New Issue Checklist

- [x] The title is short and descriptive.
- [x] You have explained the context that led you to write this issue.
- [x] You have reported a problem or idea.
- [x] You have proposed a solution or next step.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the frontend experiment display behavior and the proposed ExperimentResultAssociations between experiments and ComputationResult objects. Use the Experiments A, B, and C example to verify that mixed tximport runs are not presented as experiment-level results. No files or tests are named, and the issue notes that a PR is already in progress.

Written by the indexing model from the issue text.

Assessment

Domain
data, database, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.