Cell Browser scripts: Difference between revisions

From Genecats
Jump to navigationJump to search
(Adding some stubs of sections for other tools)
(Adding more details to a number of scripts)
Line 22: Line 22:
=cbBuildMulti=
=cbBuildMulti=


Build multiple cell browsers at once.  
Build multiple cell browsers at once. Input is a list of datasets (e.g. cortex-dev).
 
Examples:
 
cbBuildMulti my.datasets.txt
cbBuildMulti "adultPancreas aging-human-skin"
cbBuildMulti "adultPancreas"


=colorConverter=
=colorConverter=
Line 29: Line 35:


Example command:
Example command:
  colorConverter myCellTypeColors.tsv  
  colorConverter myCellTypeColors.hex.tsv > myCellTypeColors.rgb.tsv
 
It auto-detects hex vs rgb.


=colorExporter=
=colorExporter=


Export colors from an h5ad file. Takes an input h5ad file and an output file name. Sometimes the names of the color arrays in <code>uns</code> don't match the corresponding metadata field name, e.g. celltype_label vs celltype_colors, and so the <code>-c</code> option allows you to specify a file containing the associations (column 1 is the metadata field and column 2 is the color array name).  
Export colors from an h5ad file. Takes an input h5ad file and an output file name. Sometimes the names of the color arrays in <code>uns</code> don't match the corresponding metadata field name, e.g. celltype_label vs celltype_colors, and so the <code>-c</code> option allows you to specify a file containing the associations (column 1 is the metadata field and column 2 is the color array name).  
Example:
colorExporter -i TS_Liver.h5ad -o colors.tsv


=datasetDiffs=
=datasetDiffs=


Show diffs between cells-test/cells-beta/cells/
Show which datasets have differences between cells-test/cells-beta/cells. Can also show the number of datasets on each machine via <code>-s/--stats</code> as well as hidden datasets using <code>-d/--hidden</code>.
 
Example:
datasetDiffs -r
 
=updateNewsSec=
 
Will update the news section on the Cell Browser 'Overview' tab. Will also update rr.datasets.txt and sitemap.cells.txt. Automatically runs M-F at 5:10 am on a cronjob via the 'otto' user, but you can run it manually if you'd like. 
 
=makeCbHub=
 
Make a set of trackDb stanzas for a hub from a directory of bigWig and/or bigBed files. See [[Making_a_hub_for_a_cell_browser]] for more details and examples.


=generateColorHtml=
=generateColorHtml=
Line 43: Line 65:
Generate a list of html colors to put on your hub html page.  
Generate a list of html colors to put on your hub html page.  


=makeCbHub=
Example:
generateColorHtml colors.tsv


Make a set of trackDb stanzas for a hub from a directory of bigWig and/or bigBed files. See [] for more details and examples.  
You can then take the resulting html and put it into the 'Display Conventions and Configuration' section of your track description page. See [[Making_a_hub_for_a_cell_browser]] for more details and examples.


=rowsToCols=
=rowsToCols=


Can transpose a matrix. The <code>-tab</code> indicates the matrix is tap-separated, but for a comma-separated matrix use <code>-fs=,</code>.
Use this tool to transpose a matrix. The Cell Browser wants genes as the rows and cells as the columns. If you get a matrix that is opposite of that (cells on rows and genes on columns), you can use this tool to transpose that to the format the Cell Browser accepts. The <code>-tab</code> indicates the matrix is tap-separated, but for a comma-separated matrix use <code>-fs=,</code>.


Example:
Example:
  rowsToCols -tab exprMatrix.tsv exprMatrix.transposed.tsv
  rowsToCols -tab exprMatrix.tsv exprMatrix.transposed.tsv


=updateNewsSec=
 


[[Category:Cell Browser]]
[[Category:Cell Browser]]

Revision as of 18:05, 25 August 2022

h5adMetaInfo

This script prints out a summary of the metadata in an h5ad file. Specifically, it prints out the unique values for each metadata column header field and the total number of unique values for each column of the metadata file.

To use this tool, you will need to be in your Scanpy environment:

h5adMetaInfo -f [number of fields to display] h5ad

rdsMetaInfo

This script is similar to the one above however it prints out a summary of the metadata for an rds file.

To use this tool, you will need to be in your Seurat environment:

rdsMetaInfo -f [number of fields to display] rds

Both scripts were developed in order to get a glance at the information stored in metadata files. These scripts save time in loading the files into either Python or R depending on the file type and extracting the data using a series of commands. Ultimately, this reduces typing the same commands over again. These scripts were inspired by Jim’s useful tool “tabInfo” which prints out a summary of the metadata in a tsv file.

columnCorrection

addTags

getTagVals

cbBuildMulti

Build multiple cell browsers at once. Input is a list of datasets (e.g. cortex-dev).

Examples:

cbBuildMulti my.datasets.txt
cbBuildMulti "adultPancreas aging-human-skin"
cbBuildMulti "adultPancreas" 

colorConverter

Covert between rgb colors to hex and hex colors to rgb. Input file should be csv or tsv. Input file is a two-column file, where column 2 contains the color values you want to convert and column 1 is typically something like cluster labels. You will need to be in an environment where you have 'webcolors' installed.

Example command:

colorConverter myCellTypeColors.hex.tsv > myCellTypeColors.rgb.tsv

It auto-detects hex vs rgb.

colorExporter

Export colors from an h5ad file. Takes an input h5ad file and an output file name. Sometimes the names of the color arrays in uns don't match the corresponding metadata field name, e.g. celltype_label vs celltype_colors, and so the -c option allows you to specify a file containing the associations (column 1 is the metadata field and column 2 is the color array name).

Example:

colorExporter -i TS_Liver.h5ad -o colors.tsv

datasetDiffs

Show which datasets have differences between cells-test/cells-beta/cells. Can also show the number of datasets on each machine via -s/--stats as well as hidden datasets using -d/--hidden.

Example:

datasetDiffs -r

updateNewsSec

Will update the news section on the Cell Browser 'Overview' tab. Will also update rr.datasets.txt and sitemap.cells.txt. Automatically runs M-F at 5:10 am on a cronjob via the 'otto' user, but you can run it manually if you'd like.

makeCbHub

Make a set of trackDb stanzas for a hub from a directory of bigWig and/or bigBed files. See Making_a_hub_for_a_cell_browser for more details and examples.

generateColorHtml

Generate a list of html colors to put on your hub html page.

Example:

generateColorHtml colors.tsv

You can then take the resulting html and put it into the 'Display Conventions and Configuration' section of your track description page. See Making_a_hub_for_a_cell_browser for more details and examples.

rowsToCols

Use this tool to transpose a matrix. The Cell Browser wants genes as the rows and cells as the columns. If you get a matrix that is opposite of that (cells on rows and genes on columns), you can use this tool to transpose that to the format the Cell Browser accepts. The -tab indicates the matrix is tap-separated, but for a comma-separated matrix use -fs=,.

Example:

rowsToCols -tab exprMatrix.tsv exprMatrix.transposed.tsv