genepattern / single_cell_clustering_notebook

BSD 3-Clause "New" or "Revised" License
8 stars 10 forks source link

Option to upload 10X files or a single matrix file #10

Closed alex-wenzel closed 5 years ago

alex-wenzel commented 5 years ago

This pull request addresses the ticket "Enable mtx/barcode/gene upload". I rewrote the file input UIBuilder to have four input fields. The first one should be used if the user has a single file with gene and cell labels in the first column and row respectively. The last three should be used if the user has a matrix.mtx, genes.tsv, and barcodes.tsv file from the 10X pipeline. These fields should be used in a mutually exclusive manner, and I added an HTML alert if the user populates all four fields or otherwise doesn't use them correctly.

Also included are updated notebook documentation to reflect these changes, a new wrapper for displaying "alert-danger" style errors, and modifications to the some setup functions to make them return boolean flags to enable the previously-mentioned error checking without printing tracebacks.

For testing I used the example in this repo as well as this single-matrix file from one of Seurat's vignettes.

alex-wenzel commented 5 years ago

Minor addition - found a bug where _download_text_file() sets its chunk_size to 0 if the file is too small while trying to use that function for my GSEA notebook. Unlikely to ever be a problem for this code but I figured I'd fix it for completeness.

edjuaro commented 5 years ago

Tested and it all works well. When providing a file with no information about mitochondrial genes (e.g. this single-matrix file) we still show that empty plot -- not something we should change right away but something for the future.

Also, the first time I run the Setup Analysis { }, the plots are often not configured. I am unsure as to what's the cause of this bug.