.. _noise2read-documentation:

.. image:: ./logo/logo.svg
   :align: center
   :target: https://noise2read.readthedocs.io/en/latest/

.. image:: https://readthedocs.org/projects/noise2read/badge/?version=latest
    :target: https://noise2read.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

Turn 'noise' to signal: accurately rectify millions of erroneous short reads through graph learning on edit distances
=====================================================================================================================

`noise2read <https://noise2read.readthedocs.io/en/latest/>`_, originated in a computable rule translated from PCR erring mechanism that: a rare read is erroneous if it has a neighboring read of high abundance, turns erroneous reads into their original state without bringing up any non-existing sequences into the short read set(<300bp) including DNA and RNA sequencing (DNA/RNA-seq), small RNA, unique molecular identifiers (UMI) and amplicon sequencing data.

Click `noise2read <https://noise2read.readthedocs.io/en/latest/>`_ to jump to its documentation
===============================================================================================

Quick-run example
=================

Quick-run example for testing `noise2read <https://noise2read.readthedocs.io/en/latest/>`__ by setting only 1 trial for Optuna and 10 estimators for xGboost which are not the parameters used in our paper.

* `noise2read <https://noise2read.readthedocs.io/en/latest/>`_ installation
   
Please refer to `QuickStart <https://noise2read.readthedocs.io/en/latest/QuickStart.html>`_ or `Installation <https://noise2read.readthedocs.io/en/latest/Usage/Installation.html>`_.

* Clone the codes with datasets in github

.. code-block:: console

    git clone https://github.com/Jappy0/noise2read
    cd noise2read/Examples/simulated_miRNAs

* Quick-run testing `noise2read <https://noise2read.readthedocs.io/en/latest/>`_ on D14

  * with high ambiguous errors correction and using GPU for training (running about 4 mins with 26 cores and GPU)

  .. code-block:: console

      noise2read -m correction -c ../../config/Quick_test.ini -a True -g gpu_hist

Examples for correcting simulated miRNAs data with mimic UMIs by `noise2read <https://noise2read.readthedocs.io/en/latest/>`_
=============================================================================================================================

Take data sets `D14 and D16 <https://studentutsedu-my.sharepoint.com/:f:/g/personal/pengyao_ping_student_uts_edu_au/EjBTpjExiShHg0kO72fVpzABn_Krd0K61xdLlK5_03JB5A?e=5GXsg8>`_ as examples.

* `noise2read <https://noise2read.readthedocs.io/en/latest/>`__ installation
   
Please refer to `QuickStart <https://noise2read.readthedocs.io/en/latest/QuickStart.html>`_ or `Installation <https://noise2read.readthedocs.io/en/latest/Usage/Installation.html>`_.

* Clone the codes with datasets in github

.. code-block:: console

    git clone https://github.com/Jappy0/noise2read
    cd noise2read/Examples/simulated_miRNAs

* Reproduce the evaluation results for D14 and D16 from raw, true and corrected datasets

.. code-block:: console

    noise2read -m evaluation -i ./simulated_miRNAs/raw/D14_umi_miRNA_mix.fa -t ./simulated_miRNAs/true/D14_umi_miRNA_mix.fa -r ./simulated_miRNAs/correct/D14_umi_miRNA_mix.fasta -d ./result
    noise2read -m evaluation -i ./simulated_miRNAs/raw/D16_umi_miRNA_subs.fa -t ./simulated_miRNAs/true/D16_umi_miRNA_subs.fa -r ./simulated_miRNAs/correct/D16_umi_miRNA_subs.fasta -d ./result

* correcting D14

  * with high ambiguous errors correction and using GPU for training 

  .. code-block:: console

      noise2read -m correction -c ../../config/D14.ini -a True -g gpu_hist

  * without high ambiguous errors correction and using CPU (default) for training 
  
  .. code-block:: console

      noise2read -m correction -c ../../config/D14.ini -a False

  .. note:: 
      Noise2read may produce slightly different corrected result from these under Examples/simulated_miRNAs/correct

* correcting D16

  * with high ambiguous errors correction and using GPU for training 

  .. code-block:: console

      noise2read -m correction -c ../../config/D16.ini -a True -g gpu_hist

  * without high ambiguous errors correction and using CPU (default) for training 

  .. code-block:: console

      noise2read -m correction -c ../../config/D16.ini -a False

  .. note:: 

      Noise2read may produce slightly different corrected result from these under Examples/simulated_miRNAs/correct

Examples for correcting outcome sequence of ABEs and CBEs by `noise2read <https://noise2read.readthedocs.io/en/latest/>`_
=========================================================================================================================

* Clone the codes

.. code-block:: console

    git clone https://github.com/Jappy0/noise2read
    cd noise2read/CaseStudies
    mkdir ABEs_CBEs
    cd ABEs_CBEs

* Download datasets `D32_D33 <https://studentutsedu-my.sharepoint.com/:f:/g/personal/pengyao_ping_student_uts_edu_au/EmjKFVI9QklJrR8Xe0YJP1kBEq8F_SPeUa-Xwx98JQZRNw>`_.

* Using `noise2read <https://noise2read.readthedocs.io/en/latest/>`_ to correct the datasets. The running time of each experiment is about 13 minutes using 26 cores and GPU for training.

.. code-block:: console

    noise2read -m correction -i ./D32_D33/raw/D32_ABE_outcome_seqs.fasta -a False -d ./ABE/
    noise2read -m correction -i ./D32_D33/raw/D33_CBE_outcome_seqs.fasta -a False -d ./CBE/