Skip to content

The Genes panel

The Genes panel is where you find a gene, color cells by it, look up what it is, and decide which genes the rest of Skopia treats as visible. It also holds your gene sets, which have their own page: Gene sets.

Where to find it

The Genes panel on the right of the window. Its header holds Library, Import, Browse and a ⋯ menu; below the search box are two tabs, Sets and Color.

Search and browse

  1. Type in Search genes... to list matching gene names. Browse in the header lists every gene alphabetically, page by page.
  2. Click a gene name to color the embedding by its expression. The bar under the header reads Coloring by: <gene>; Clear removes the coloring.
  3. To add several genes to a set at once, tick their checkboxes in the results and drag any ticked gene onto a gene set. The panel says how many will move (Drag 3 selected genes to a gene set).

How expression is drawn (transform, color scale, clipping) is set in Display; see Color cells and Display settings.

Each gene row also has:

Control What it does
⧉ Copies the bare symbol to the clipboard and flashes ✓. It is muted until you hover the row but always present. The click never colors by the gene or starts a drag. Where the browser's clipboard API is unavailable (plain http on a LAN address) it falls back to the older copy method.
ⓘ Opens the gene info card (below).
⋯ → Select cells… Thresholds cells on this gene's expression; see Select, mask and delete.

The same ⧉ and ⓘ appear on the members of an expanded gene set and on a directional set's down genes.

Gene info card (ⓘ)

The ⓘ opens a card from MyGene.info (Xin et al. 2016; Wu et al. 2013) with:

  • the full name and aliases
  • the RefSeq summary
  • GO terms, strongest evidence first (experimental codes before inferred ones), with the evidence code shown
  • InterPro domains and pathway membership
  • the human or mouse ortholog
  • links to NCBI, Ensembl, MGI or HGNC, and UniProt

Mouse genes rarely have a RefSeq summary of their own. When a human ortholog is known, the card shows the human summary and labels it as borrowed (Sox9 shows SOX9's).

Annotations are cached on your machine in ~/.cache/skopia/gene_annotations.sqlite, per species and in the dataset's own spelling; a dataset indexed by Ensembl IDs is looked up by ID. Each gene is fetched once. Genes MyGene.info does not know are cached as not found, so they are not queried again. The card's re-fetch button asks MyGene.info again for that gene.

To warm the cache for a whole dataset, choose ⋯ → Fetch gene annotations for all genes…. It runs as a background task; on a 12,236-gene E11.5 hindlimb dataset it took about 90 s, after which cards opened in a few milliseconds.

Note

The card needs network access the first time a gene is looked up. Nothing from the card is written to the dataset.

Gene IDs dropdown

When .var holds more than one column that can serve as a gene identifier (for example Ensembl IDs as the index plus a gene_symbol column), a Gene IDs: dropdown appears under the header. Pick a column to make it the gene names everywhere in the session. (current index) is the index the file was loaded with. Gene sets and the current gene selection are remapped to the new names.

Add gene symbols (Ensembl-only datasets)

A dataset whose .var holds ENSMUSG00000051951 rather than Xkr4 cannot be searched by symbol, and imported gene sets match nothing in it. ⋯ → Add gene symbols… maps the IDs to official symbols offline.

  1. Open ⋯ → Add gene symbols…. The dialog checks the dataset first and reports the species (detected from the ID prefix, by majority, so a few spike-ins do not change it), how many genes get a symbol, how many are not in the tables, how many symbols are shared by more than one ID, and five examples.
  2. Leave Use symbols as gene names ticked to make the symbols the gene names right away, or untick it to write them to .var only and switch later with the Gene IDs dropdown.
  3. Click Add symbols.

The mapping tables ship with Skopia (built from GENCODE (Frankish et al. 2023), merging releases v32 with v50 for human and M23 with M39 for mouse), so the step needs no network and maps the same way every time. The older release is there because many datasets were aligned to it: 10x's refdata-gex-2020-A reference is GENCODE v32/M23. On a Visium HD mouse embryo dataset, 32,285 of 32,285 IDs mapped.

Where What
var['gene_symbol'] The symbol for each gene. An ID that is not in the tables keeps its ID, so every gene stays addressable.
var['ensembl_id'] The previous index, when Use symbols as gene names is ticked.
var_names The symbols, when Use symbols as gene names is ticked.

Warning

Only human and mouse Ensembl IDs are supported. A dataset of another species is refused by name ("these look like zebrafish Ensembl ids") rather than producing a column of unmapped IDs that looks like it worked. A dataset whose names are already symbols, or that already has a symbol column, is told so and pointed at the Gene IDs dropdown.

Gene mask

The gene mask sets which genes count as visible in this session. Use it to restrict the panel, and the analyses that report genes, to a relevant universe such as highly variable or spatially variable genes.

Where to find it

Genes panel → ⋯ → Gene mask…

Set a mask

  1. Open ⋯ → Gene mask…. The dialog lists every boolean .var column with its count of True genes (for example highly_variable after Highly Variable Genes, spatially_variable after Spatial Autocorrelation, or a column from Add boolean column).
  2. For each column choose Off (ignore it), Keep (include genes where it is True) or Hide (exclude genes where it is True).
  3. With more than one Keep column, set Combine Keep columns: to Match ANY (union, the default) or Match ALL (intersection). Hide columns always combine as a union.
  4. Check the preview (Preview: 2,000 of 18,000 visible) and click Apply. A mask that would leave no visible genes is refused.

While a mask is active the header shows a badge with the visible and total counts, and an expanded gene set shows how many of its genes are hidden ((12 hidden)).

What the mask scopes

The mask is the visible gene universe for anything that reports or displays genes:

  • gene search and browse, and the members shown in expanded gene sets
  • gene-set scores used for coloring (a set whose genes are all masked scores zero, and Skopia says so)
  • the expression heatmap, which reads · 3 hidden by gene mask in its toolbar
  • Diff Exp and Marker Genes
  • single- and multi-line gene association
  • NMF programs and meta-programs, the gene map, Gene PCA and Gene Neighbors
  • Cluster genes on a gene set (its Restrict to active gene mask checkbox)
  • Spatial Autocorrelation and Ligand-Receptor
  • the universe of the Enrichment tool

Where an operation has its own gene-subset picker, the two intersect. If the mask hides the whole subset, the run stops with a message instead of testing nothing. If you color by a gene and then mask it, the coloring is cleared.

What it deliberately does not scope

Three operations read the whole .var axis whatever the mask says, because a session-only view should not silently change what gets written into the file:

  • The scanpy chain (Filter Genes, Highly Variable Genes, PCA, Neighbors, UMAP, Leiden). These build the cell-space structure stored in the dataset. highly_variable is also a common mask column, so masking by it and then re-running HVG would be circular. To restrict the chain to some genes, use each step's own Gene Subset field; see Preprocess.
  • Merge Spots, which rebuilds cells from raw counts; see Merge spots.
  • The Localize reference bundle, whose genes become the space shared with the query dataset, which has its own mask or none; see Localize.

Note

The mask is per dataset and lasts only for the session. Reloading the page clears it, and nothing is written to the file. If a filtering step removes a column the mask referenced, the mask is cleared and Skopia tells you.

Sort a set's genes

A gene set's ⋯ → Sort genes A→Z reorders its members case-insensitively and numerically, so Hoxd2 comes before Hoxd10 (plain string order would put Hoxd10 first). Membership does not change, and a directional set's down list is sorted along with its up list.

Rename genes and add boolean columns

Two gene-level edits live in the Analyze menu rather than the panel. Both change .var and are recorded in the analysis record.

Where to find it

Analyze → Genes → Rename genes and Analyze → Genes → Add boolean column

Rename genes finds and replaces across gene names. Leave Replace with blank to strip the match, which is the usual way to drop a genome prefix such as mm10___ from a multi-genome dataset (see Multi-genome data).

Parameter Default What it does
Find ^(GRCh38|mm10)_+ A regular expression, or plain text in literal mode.
Replace with empty Blank strips the match. Regex mode supports backreferences (\1).
Match mode regex literal treats the pattern as plain text.
Make duplicates unique false Only used if the rename would give two genes one name. Otherwise such a rename is refused, because two genes sharing a name are merged in every later lookup.

The original names are kept in var['gene_symbol_original'] the first time a rename happens. A pattern that matches nothing is an error, so a typo does not pass silently.

Add boolean column flags genes whose names match a prefix or regex, for example mitochondrial genes for QC or one species in a multi-genome dataset. The column can then be used as a QC variable, a gene mask column or a gene subset.

Parameter Default What it does
Column name mt Name of the new boolean .var column. A name already used by a non-boolean column is refused.
Gene-name pattern ^mt- A prefix (for example GRCh38_) or a regex.
Match mode regex prefix or regex.

A gene set can also become a boolean column: see Save a set as a .var column.