scirpy.get.obs_context
- scirpy.get.obs_context(data, temp_cols)
Contextmanager that temporarily adds columns to obs.
Example
with ir.get.obs_context(mdata, { "new_col_with_constant_value": "foo", "new_col_with_sequence": range(len(mdata)), "v_gene_primary_vj_chain": ir.get.airr(mdata, "v_call", "VJ_1") }) as m: ir.pl.group_abundance(m, groupby="v_gene_primary_vj_chain", target_col="new_col_with_constant_value")
- Parameters
- data :
AnnData|MuDataUnion[AnnData,MuData] AnnData or MuData object
- temp_cols :
DataFrame|MappingUnion[DataFrame,Mapping[str,Any]] Dictionary where keys are column names and values are columns. Columns will be added to obs using
pandas.DataFrame.assign(). It is also possible to pass aDataFramein which case the columns of the DataFrame will be added toobsand matched based on the index.
- data :