cellbrowser
Advanced tools
+1
-1
| Metadata-Version: 2.1 | ||
| Name: cellbrowser | ||
| Version: 1.2.15.post0.dev8 | ||
| Version: 1.2.16 | ||
| Summary: UCSC Cellbrowser, an interactive browser for single cell data. Includes converters and basic pipelines for text files, Seurat, Scanpy and Cellranger. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/maximilianh/cellBrowser |
+11
-1
@@ -15,4 +15,14 @@ .. image:: https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat | ||
| To look at a list of selected single cell datasets, see http://cells.ucsc.edu | ||
| Here are a few datasets that demonstrate these features: | ||
| - A simple gene expression dataset: https://cells.ucsc.edu/?ds=cortex-dev | ||
| - Spatial transcriptomics support https://ms-subcortical-lesions.cells.ucsc.edu | ||
| - Split screen mode to display both the spatial and snRNA-seq data side by side https://cells.ucsc.edu/?ds=dup15q-cortex-organoids+spatial+control | ||
| - Cell trajectories from monocle https://cells-test.gi.ucsc.edu/?ds=pre-postnatal-cortex+ex-neu+rna | ||
| - Cell trajectories from URD https://cells.ucsc.edu/?ds=cardiac-differentiation+trajectory+cm-combined-trajectory | ||
| - Clone lineage tracing support: color by the field CellTag, select tags in the legend, then click "recolor checked": https://cells.ucsc.edu/?ds=gbm-nvp+nvp-celltag | ||
| - Brain lipidomics https://cells.ucsc.edu/?ds=brain-lipids | ||
| To show all our > 200 single cell datasets, see http://cells.ucsc.edu | ||
| To setup your own cell browser, from Cellranger, Seurat, Scanpy or text files | ||
@@ -19,0 +29,0 @@ (tsv/csv), or just a single cell expression matrix, read the documentation |
| Metadata-Version: 2.1 | ||
| Name: cellbrowser | ||
| Version: 1.2.15.post0.dev8 | ||
| Version: 1.2.16 | ||
| Summary: UCSC Cellbrowser, an interactive browser for single cell data. Includes converters and basic pipelines for text files, Seurat, Scanpy and Cellranger. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/maximilianh/cellBrowser |
@@ -11,7 +11,7 @@ | ||
| { | ||
| "date": "2025-05-22T14:10:47-0700", | ||
| "date": "2025-11-12T13:17:35-0800", | ||
| "dirty": false, | ||
| "error": null, | ||
| "full-revisionid": "ebe2e27cb09c7f85bdbfee91093a58c64c8ed1b9", | ||
| "version": "1.2.15.post0.dev8" | ||
| "full-revisionid": "9d80bedf1b39a0e74cf2e6f9f1481d6b6a66c9cc", | ||
| "version": "1.2.16" | ||
| } | ||
@@ -18,0 +18,0 @@ ''' # END VERSION_JSON |
@@ -72,12 +72,2 @@ /* tsneViewer.js class definitions */ | ||
| #tpLegendColorChecked, | ||
| #tpLegendAll, | ||
| #tpLegendNone, | ||
| #tpLegendInvert, | ||
| #tpLegendNotNull { | ||
| font-size: 13px; | ||
| margin-right: 2px; | ||
| margin-bottom: 2px; | ||
| } | ||
| .tpDatasetPane { | ||
@@ -121,8 +111,8 @@ padding: 5px !important; | ||
| .tpLegendHl { background-color: #ccc; color: black; } | ||
| .tpHint { font-weight:normal; line-height:1.4; font-size: 80%} | ||
| #tpLegendHeader { background-color:#eee; color: #777 } | ||
| .tpHint { font-weight:normal; line-height:1.4; font-size: 80%; margin-top:4px} | ||
| #tpLegendHeader { background-color:#eee; color: #777; margin-top: 2px} | ||
| #tpLegendTitle { font-weight: bold } | ||
| #tpLegendSubTitle { font-size: 80%; font-style: italic } | ||
| #tpLegendCol1 { padding-left: 1px} | ||
| #tpLegendCol2 { float: right; padding-right: 2px} | ||
| #tpLegendCol1 { padding-left: 1px; vertical-align: middle} | ||
| #tpLegendCol2 { float: right; padding-right: 2px; padding-top:2px} | ||
| .tpLegendSelect { outline: 2px solid black } | ||
@@ -135,2 +125,10 @@ .tpLegendLabel { display:inline; user-select: none; } | ||
| #tpLegendColorChecked, | ||
| #tpLegendAll, | ||
| #tpLegendNone, | ||
| #tpLegendInvert, | ||
| #tpLegendNotNull { | ||
| font-size: 14px; | ||
| margin: 1px 1px; | ||
| } | ||
@@ -137,0 +135,0 @@ .ui-helper-reset { font-size: 12px} |
@@ -12,2 +12,3 @@ # various format converters for single cell data: | ||
| from .cellbrowser import copyFileIfDiffSize | ||
| from .cellbrowser import generateQuickGenes | ||
@@ -33,2 +34,3 @@ from os.path import join, basename, dirname, isfile, isdir, relpath, abspath, getsize, getmtime, expanduser | ||
| reorder - reorder the meta fields | ||
| quickgenes - make quickgenes.tsv from markers.tsv in current directory | ||
@@ -69,3 +71,3 @@ Examples: | ||
| if len(args)<=1: | ||
| if len(args)<=1 and not (len(args)!=0 and args[0]=="quickgenes"): | ||
| cbToolCli_parseArgs(showHelp=True) | ||
@@ -76,3 +78,3 @@ sys.exit(1) | ||
| cmds = ["mtx2tsv", "matCatCells", "matCatGenes" "metaCat", "reorder", "cxg"] | ||
| cmds = ["mtx2tsv", "matCatCells", "matCatGenes" "metaCat", "reorder", "cxg", "quickgenes"] | ||
@@ -130,2 +132,6 @@ if cmd=="mtx2tsv": | ||
| metaCat(inFnames, outFname, options) | ||
| elif cmd=="quickgenes": | ||
| generateQuickGenes(".") | ||
| else: | ||
@@ -132,0 +138,0 @@ errAbort("Command %s is not a valid command. Valid commands are: %s" % (cmd, ", ".join(cmds))) |
@@ -235,4 +235,16 @@ # annotate a list of gene IDs with links to various external databases | ||
| headers.append("_geneLists") | ||
| # lineFileNextRow makes some changes to seurat headers that we need to undo | ||
| if headers[0] == "rowName": | ||
| headers[0] = '' | ||
| if headers[3] == "pct_1": | ||
| headers[3] = "pct.1" | ||
| if headers[4] == "pct_2": | ||
| headers[4] = "pct.2" | ||
| yield headers | ||
| sym = row[1] | ||
| isSeurat = False | ||
| if sym.isnumeric(): # if column 2 is only a number, it's probably a seurat file | ||
| sym = row[0] # gene symbol is in column 1 | ||
| isSeurat = True | ||
| if "|" in sym: # marker gene lists can carry geneId|symbol, strip the symbol in this case and re-convert below | ||
@@ -306,3 +318,6 @@ sym = sym.split("|")[0] | ||
| row = list(row) | ||
| row[1] = sym # in case the original ID was a geneID, not a symbol | ||
| if isSeurat: | ||
| row[0] = sym # for seurat files, column 1 is the gene | ||
| else: | ||
| row[1] = sym # in case the original ID was a geneID, not a symbol | ||
@@ -309,0 +324,0 @@ row.append(hprdClass) |
@@ -49,2 +49,3 @@ # functions to guess the gene model release given a list of gene IDs | ||
| %prog allSyms human # build big geneId -> symbol table from all | ||
| %prog json ce11 wormbase235 # build JSON file from a .bed.gz file - only needed for model organisms | ||
| """) | ||
@@ -220,3 +221,3 @@ | ||
| db = "hg19" | ||
| url = "https://hgdownload.cse.ucsc.edu/goldenPath/%s/database/wgEncodeGencodeAttrsV%s.txt.gz" % (db, release) | ||
| url = "https://hgdownload.gi.ucsc.edu/goldenPath/%s/database/wgEncodeGencodeAttrsV%s.txt.gz" % (db, release) | ||
| logging.info("Downloading %s" % url) | ||
@@ -248,3 +249,3 @@ doneIds = set() | ||
| url = "http://hgdownload.cse.ucsc.edu/goldenPath/%s/database/wgEncodeGencodeCompV%s.txt.gz" % (db, release) | ||
| url = "http://hgdownload.gi.ucsc.edu/goldenPath/%s/database/wgEncodeGencodeCompV%s.txt.gz" % (db, release) | ||
| logging.info("Downloading %s" % url) | ||
@@ -380,6 +381,6 @@ geneToTransList = defaultdict(list) | ||
| sep = "\n" | ||
| urls = [("hg38", "https://hgdownload.cse.ucsc.edu/goldenPath/hg38/database/"), | ||
| ("mm10", "https://hgdownload.cse.ucsc.edu/goldenPath/mm10/database/"), | ||
| ("mm39", "https://hgdownload.cse.ucsc.edu/goldenPath/mm39/database/"), | ||
| ("hg19", "https://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/") | ||
| urls = [("hg38", "https://hgdownload.gi.ucsc.edu/goldenPath/hg38/database/"), | ||
| ("mm10", "https://hgdownload.gi.ucsc.edu/goldenPath/mm10/database/"), | ||
| ("mm39", "https://hgdownload.gi.ucsc.edu/goldenPath/mm39/database/"), | ||
| ("hg19", "https://hgdownload.gi.ucsc.edu/goldenPath/hg19/database/") | ||
| ] | ||
@@ -514,3 +515,3 @@ | ||
| " convert BED file to more compact json file: chrom -> list of (start, end, strand, gene) " | ||
| geneToSym = readGeneSymbols(geneIdType) | ||
| transToSym = readGeneSymbols(geneIdType) | ||
@@ -520,17 +521,24 @@ # index transcripts by gene | ||
| for row in iterBedRows(db, geneIdType): | ||
| chrom, start, end, geneId, score, strand = row[:6] | ||
| sym = geneToSym[geneId] | ||
| chrom, start, end, transId, score, strand = row[:6] | ||
| if not transId in transToSym: | ||
| logging.warn("%s does not have a gene symbol" % transId) | ||
| sym = transId | ||
| else: | ||
| sym = transToSym[transId] | ||
| logging.debug("Mapping %s to symbol %s" % (transId, sym)) | ||
| start = int(start) | ||
| end = int(end) | ||
| transLen = end-start | ||
| rawGeneId = geneId.split(".")[0] # for lookups, we hopefully will never need the version ID... | ||
| fullGeneId = rawGeneId+"|"+sym | ||
| bySym[fullGeneId].setdefault(chrom, []).append( (transLen, start, end, strand, geneId) ) | ||
| rawTransId = transId | ||
| if rawTransId.startswith("EN") or rawTransId.startswith("NM_"): | ||
| rawTransId = transId.split(".")[0] # for lookups, we hopefully will never need the version ID... | ||
| fullTransId = rawTransId+"|"+sym | ||
| bySym[sym].setdefault(chrom, []).append( (transLen, start, end, strand, fullTransId) ) | ||
| symLocs = defaultdict(list) | ||
| for geneId, chromDict in bySym.items(): | ||
| for sym, chromDict in bySym.items(): | ||
| for chrom, transList in chromDict.items(): | ||
| transList.sort(reverse=True) # take longest transcript per chrom | ||
| _, start, end, strand, transId = transList[0] | ||
| symLocs[chrom].append( (start, end, strand, geneId) ) | ||
| symLocs[chrom].append( (start, end, strand, transId) ) | ||
@@ -624,7 +632,8 @@ sortedLocs = {} | ||
| elif command=="json": # undocumented | ||
| db, geneType, outFname = args[1:] | ||
| bedToJson(db, geneType, outFname) | ||
| elif command=="json": | ||
| db, geneType = args[1:] | ||
| jsonFname = getStaticPath(getGeneJsonPath(db, geneType)) | ||
| bedToJson(db, geneType, jsonFname) | ||
| else: | ||
| errAbort("Unrecognized command: %s" % command) | ||
@@ -674,8 +674,6 @@ # create a track hub from an expression matrix | ||
| " write the barChart tdb stanza " | ||
| stepSize = 1.0 / len(clusterNames) | ||
| colorCodes = [] | ||
| x = 0 | ||
| while x < 1.0: | ||
| for i in range(len(clusterNames)): | ||
| x = i / len(clusterNames) | ||
| colorCodes.append(colorsys.hsv_to_rgb(x, 1.0, 1.0)) | ||
| x+=stepSize | ||
@@ -682,0 +680,0 @@ hexCodes = [toHex(x) for x in colorCodes] |
@@ -90,2 +90,24 @@ # Build a UCSC cell browser website from a \code{Seurat} object | ||
| message(name); | ||
| # SlideSeq-class SpatialImage objects do not contain a bitmap image | ||
| # They only contain a coordinates df, so test if this image is a SlideSeq | ||
| # And process using this code block (instead of usual steps further below) | ||
| if ("SlideSeq" %in% class(obj@images$image)[1]) { | ||
| coordsPath <- file.path(outDir, paste0(name, ".coords.tsv")) | ||
| message("Writing coords for image to ", coordsPath) | ||
| coords <- GetTissueCoordinates(object = obj[[name]]) | ||
| # One of the columns I want to delete is currently named 'NA' for | ||
| # a missing value | ||
| colnames(coords)[3] <- "missing" | ||
| # Delete columns 3 and 4 by name, keeping columns 1 and 2 for printing out | ||
| coords = subset(coords, select = -c(missing, cells)) | ||
| write.table(coords, coordsPath, sep="\t", row.names=T, quote=F, col.names=NA) | ||
| conf <- sprintf( | ||
| ' {\n "file": "%s",\n "shortLabel": "Spatial %s",\n }', | ||
| coordsPath, | ||
| name | ||
| ) | ||
| embeddings.conf <- c(conf, embeddings.conf) | ||
| return(embeddings.conf) | ||
| } | ||
| img = GetImage(obj, mode="raw", image=name); | ||
@@ -104,8 +126,15 @@ if (is.null(img)) { | ||
| message("Writing coords for image to ", coordsPath) | ||
| #coords <- GetTissueCoordinates(object = obj[[img]]) | ||
| coords <- GetTissueCoordinates(object = obj[[name]]) | ||
| coordsRev <- coords[, c("imagecol", "imagerow")] # Grrrr... Seurat stores coordinates as (y,x) in this particular case. reverse the order now. | ||
| colnames(coordsRev) <- c("x", "y") | ||
| if (all(c("imagecol", "imagerow") %in% colnames(coords))) { | ||
| # Seurat-style naming: reverse order | ||
| coordsRev <- coords[, c("imagecol", "imagerow")] | ||
| colnames(coordsRev) <- c("x", "y") | ||
| } else if (all(c("x", "y") %in% colnames(coords))) { | ||
| # Already in standard x/y format | ||
| coordsRev <- coords[, c("y", "x")] | ||
| } else { | ||
| stop("Error: coordinates must have either (imagecol, imagerow) or (x, y) columns.") | ||
| } | ||
| write.table(coordsRev, coordsPath, sep="\t", row.names=T, quote=F, col.names=NA) | ||
@@ -420,5 +449,8 @@ conf <- sprintf( | ||
| message("Running FindAllMarkers(), using wilcox test, min logfc diff 0.25") | ||
| if ("SCT" %in% names(object@assays)) { | ||
| # Only run this block if the Active assay is SCT | ||
| if ("SCT" %in% DefaultAssay(object = object)) { | ||
| message("Looks like an SCT object, so running PrepSCTFindMarkers()") | ||
| PrepSCTFindMarkers(object = object) | ||
| # The results from this command need to be written back to the object prior to | ||
| # running FindAllMarkers | ||
| object <- PrepSCTFindMarkers(object = object) | ||
| } | ||
@@ -425,0 +457,0 @@ markers <- FindAllMarkers( |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
21260779
0.07%66232
0.38%