Process mutation data into standard formats originally developed for the ExploSig family of tools
Project description
ExploSig Data
Helpers for processing mutation data into standard formats originally developed for the ExploSig family of tools.
Installation
pip install explosig-data
Example
With raw SSM/MAF file from ICGC or TCGA:
>>> import explosig_data as ed
>>> # Step 1: Process into the ExploSig "standard format":
>>> data_container = ed.standardize_ICGC_ssm_file('path/to/ssm.tsv') # if ICGC
>>> data_container = ed.standardize_TCGA_maf_file('path/to/ssm.tsv') # if TCGA
>>> # Step 2: Process further
>>> data_container.extend_df().to_counts_df('SBS_96', ed.categories.SBS_96_category_list()))
>>> # Step 3: Use the processed dataframe of interest.
>>> counts_df = data_container.counts_dfs['SBS_96']
>>> # Alternatively, use without the chaining API:
>>> ssm_df = ed.standardize_ICGC_ssm_file('path/to/ssm.tsv', wrap=False) # if ICGC
>>> ssm_df = ed.standardize_TCGA_maf_file('path/to/maf.tsv', wrap=False) # if TCGA
>>> extended_df = ed.extend_ssm_df(ssm_df)
>>> counts_df = ed.counts_from_extended_ssm_df(
extended_df,
category_colname='SBS_96',
category_values=ed.categories.SBS_96_category_list()
)
With data already in the ExploSig "standard format":
>>> import explosig_data as ed
>>> import pandas as pd
>>> # Step 0: Load the data into a dataframe, for example by reading from a TSV file.
>>> ssm_df = pd.read_csv('path/to/standard.tsv', sep='\t')
>>> # Step 1: Wrap the dataframe using the container class to allow use of the chainable functions.
>>> data_container = ed.SimpleSomaticMutationContainer(ssm_df)
>>> # Now see step 2 above (or the alternative steps above).
Development
Build and install from the current directory.
python setup.py sdist bdist_wheel && pip install .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
explosig-data-0.0.2.tar.gz
(14.5 kB
view hashes)
Built Distribution
Close
Hashes for explosig_data-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfcc82c05c4830755678f979b124761073302fb538d67e6329e90720adf16aee |
|
MD5 | b7544a3761675f00aedcb51860f77161 |
|
BLAKE2b-256 | a90b58026f5bd46f5fdf62d0b7434232ab0760f4a6d7a411da0c22e713c07187 |