Skip to content

Commit

Permalink
Merge branch 'feature/docs'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rongtingting committed Jun 19, 2024
2 parents 600196e + b32d91b commit 07c7056
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 46 deletions.
2 changes: 2 additions & 0 deletions docs/API.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _api:

===
API
===
Expand Down
12 changes: 0 additions & 12 deletions docs/FAQ.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@ FAQ
:depth: 2
:local:

Top Questions
-------------

Input and Output
----------------

CNA Modules
-----------

Parameters
----------


Python Environment
------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ XClone
======

XClone is implementated on Python 3.
XClone integrates expression levels and allelic balance to detect haplotype-aware CNVs and reconstruct tumour clonal substructure from scRNA-seq data.
XClone integrates expression levels and allelic balance to detect haplotype-aware CNAs and reconstruct tumour clonal substructure from scRNA-seq data.

XClone algorithm
================
Expand All @@ -14,13 +14,13 @@ XClone algorithm


XClone has two modules of information: the read depth ratio (RDR) module and the B-allele frequency (BAF) module,
where each of the modules has its own CNV states and noise models for likelihood function.
where each of the modules has its own CNA states and noise models for likelihood function.


XClone RDR module
-----------------

In the RDR module, XClone considers three CNV states about the absolute copy numbers: copy loss, copy neutral and copy gain.
In the RDR module, XClone considers three CNA states about the absolute copy numbers: copy loss, copy neutral and copy gain.
It takes the raw read or UMI counts as input and models the noise via a negative-binomial distribution.

XClone BAF module
Expand All @@ -32,7 +32,7 @@ In the BAF module, we introduce a three-step phasing strategy to aggregate allel
- from a single gene to a mega gene
- from a mega gene to a whole chromosome arm

XClone takes the phased mega gene as the feature and defines three allele-based CNV states: allele A drop, allele balance
XClone takes the phased mega gene as the feature and defines three allele-based CNA states: allele A drop, allele balance
and allele B drop.
By taking the allelic count matrices of both alleles, it models the read or UMI counts of the B allele for each feature
in each cell via a beta-binomial distribution.
59 changes: 35 additions & 24 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
.. _getting started:

===============
Getting Started
===============
XClone is a software tool designed for analyzing single-cell RNA sequencing data to identify copy number variations within individual cells.
CNVs are important in a variety of biological processes, especially in cancer development.
XClone is a software tool designed for analyzing single-cell RNA sequencing data to identify somatic copy number alterations (CNAs) within individual cells.
Somatic CNAs play a crucial role in various biological processes, particularly in cancer development.

XClone employs probabilistic modeling to estimate the copy number alterations status of each gene within each cell in a cancer sample.
By analyzing gene expression levels and the B allele frequency of gene bins, XClone can determine which cells are likely to have copy number variations and which genes are affected.

XClone uses probabilistic modelling to estimate the copy number variation status of each gene within each cell in a sample.
By analyzing the expression levels of genes and B allele frequency of gene_bins,
XClone can determine which cells are likely to have copy number variations and which genes are affected.
In XClone tutorials, we'll guide you through the steps of using XClone to analyze single-cell RNA sequencing data for CNA analysis.
We'll cover everything **from preparing the input data to interpreting the analysis results**.
Whether you're new to single-cell RNA sequencing or an experienced user, this tutorial will provide a comprehensive introduction to using XClone for CNA analysis.

In this tutorial, we'll walk through the steps of using XClone to analyze single-cell RNA sequencing data for CNV analysis.
We'll cover everything from preparing the input data to interpreting the output of the analysis.
Whether you're new to single-cell RNA sequencing or an experienced user, this tutorial will provide a comprehensive introduction to using XClone for CNV analysis.

Public Datasets
===============
Expand All @@ -37,15 +38,25 @@ For start, please refer to tutorials analyzing `TNBC1`_ and `BCH869`_ datasets,
.. _Gao et al. (2021): https://www.nature.com/articles/s41587-020-00795-2
.. _Filbin et al. (2018): DOI: 10.1126/science.aao4750


XClone on new datasets
======================
- import package

::
Preparing XClone input
----------------------

For detailed preprocessing tool from bam files to `anndata.AnnData` format input for XClone, refer to preprocessing page, :ref:`XClone preprocessing <XClone preprocessing>`.


Import package
--------------

.. code-block:: python
import xclone
XClone provides integrated functions (RDR BAF and Combination) for CNV analysis by default
XClone provides integrated functions (RDR, BAF and Combination) for CNV analysis by default
whilst specific configurations might need to be adjusted accordingly. For each XClone module, we provide
independent Class for configuration. You can specify which module to use by set `module = "RDR"`, `module = "BAF"`
or `module = "Combine"` in `xclone.XCloneConfig(dataset_name = dataset_name, module = "RDR")`.
Expand All @@ -56,9 +67,14 @@ If you want to change params setting, Please Sub-class and override base configu
please refer config.py for detailed arguments. After overriding, you can print `xconfig.display()` to show the updated configurations
before you run the module, e.g., `RDR_Xdata = xclone.model.run_RDR(RDR_adata, config_file = xconfig)`.

- RDR module

::
**For detailed description of the functions in XClone, refer to API page, :ref:`XClone API <api>`.**


RDR module
----------

.. code-block:: python
xconfig = xclone.XCloneConfig(dataset_name = dataset_name, module = "RDR", set_smartseq = True)
xconfig.set_figure_params(xclone= True, fontsize = 18)
Expand All @@ -79,9 +95,10 @@ before you run the module, e.g., `RDR_Xdata = xclone.model.run_RDR(RDR_adata, co
config_file = xconfig)
- BAF module
BAF module
----------

::
.. code-block:: python
xconfig = xclone.XCloneConfig(dataset_name = dataset_name, module = "BAF", set_smartseq = True)
xconfig.set_figure_params(xclone= True, fontsize = 18)
Expand All @@ -107,17 +124,17 @@ before you run the module, e.g., `RDR_Xdata = xclone.model.run_RDR(RDR_adata, co
xconfig.trans_prob = np.array([[1-4*t, t, t, t,t],[t, 1-4*t, t, t,t],[t, t, 1-4*t, t,t], [t, t, t, 1-4*t, t], [t, t, t, t, 1-4*t]])
xconfig.CNV_N_components = 5
## update
xconfig.BAF_denoise = True
xconfig.display()
BAF_merge_Xdata = xclone.model.run_BAF(BAF_adata,
config_file = xconfig)
- Combine module
Combine module
--------------

::
.. code-block:: python
xconfig = xclone.XCloneConfig(dataset_name = dataset_name, module = "Combine")
xconfig.set_figure_params(xclone= True, fontsize = 18)
Expand All @@ -142,9 +159,3 @@ before you run the module, e.g., `RDR_Xdata = xclone.model.run_RDR(RDR_adata, co
verbose = True,
run_verbose = True,
config_file = xconfig)



XClone on GX109-T1c
===================

4 changes: 4 additions & 0 deletions docs/preprocessing.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _XClone preprocessing:

====================
XClone preprocessing
====================
Expand Down Expand Up @@ -202,6 +204,8 @@ See `xcltk_preprocess`_ for details of how to prepare BAF and RDR data.


.. _xcltk: https://pypi.org/project/xcltk/
.. _xcltk RDR: https://github.com/hxj5/xcltk/tree/master/preprocess#rdr-part-2
.. _xcltk BAF: https://github.com/hxj5/xcltk/tree/master/preprocess#baf-part-2
.. _preprocessing pipeline: https://github.com/hxj5/xcltk/tree/master/preprocess
.. _xcltk_preprocess: https://github.com/hxj5/xcltk/tree/master/preprocess

1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ sphinxcontrib-bibtex
# converting notebooks to html
ipykernel
sphinx
# nbsphinx<=0.8.6
nbsphinx>=0.8.7
15 changes: 10 additions & 5 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
==========
=========
Tutorials
==========
=========

XClone base
============
Expand All @@ -15,6 +15,14 @@ Examples of XClone and steps for reproducible results are provided in **Jupyter

Please refer to **Tutorials** analyzing `TNBC1`_ and `BCH869`_ datasets.


.. _examples: https://github.com/Rongtingting/xclone-data/tree/main/examples
.. _TNBC1: ./TNBC1_XClone_tutorials.html
.. _BCH869: ./BCH869_XClone_tutorials.html




CNV Visualization
==================

Expand All @@ -24,6 +32,3 @@ This tutorial shows how to visually explore CNVs results using XClone.



.. _examples: https://github.com/Rongtingting/xclone-data/tree/main/examples
.. _TNBC1: ./TNBC1_XClone_tutorials.html
.. _BCH869: ./BCH869_XClone_tutorials.html

0 comments on commit 07c7056

Please sign in to comment.