Skip to content

Commit

Permalink
making cbscanpy output the raw and full expression matrix, not the fi…
Browse files Browse the repository at this point in the history
…ltered one.
  • Loading branch information
maximilianh committed Dec 7, 2018
1 parent 0c85a79 commit bba1be0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion sampleData/pbmc_small/scanpy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ louvainRes = 1.0
# Tilford tree layout).
# You can also set doLayouts="all" to generate all possible layouts mentioned above.
#doLayouts = ["fa", "umap"]
doLayouts = "all"
#doLayouts = "all"
doLayouts = ["umap", "pagaFa", "fa", "fr", "kk", "lgl", "drl", "rt"]

# find top marker genes per cluster?
doMarkers = True
Expand Down
9 changes: 6 additions & 3 deletions src/cbPyLib/cellbrowser/cellbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2637,7 +2637,11 @@ def anndataToTsv(ad, matFname, usePandas=False):
ofh.write("\n")

ofh.close()
os.rename(tmpFname, matFname)

if matFname.endswith(".gz"):
runGzip(tmpFname, matFname)
else:
os.rename(tmpFname, matFname)

def makeDictDefaults(inVar, defaults):
" convert inVar to dict if necessary, defaulting to our default labels "
Expand Down Expand Up @@ -2683,9 +2687,8 @@ def scanpyToCellbrowser(adata, path, datasetName, metaFields=["louvain", "percen
import anndata

if not skipMatrix:
matFname = join(path, 'exprMatrix.tsv')
matFname = join(path, 'exprMatrix.tsv.gz')
anndataToTsv(adata, matFname)
matFname = runGzip(matFname)

if coordFields=="all" or coordFields is None:
coordFields = coordLabels
Expand Down

0 comments on commit bba1be0

Please sign in to comment.