# nf-core/scrnaseq: Output

## Introduction

This document describes the output produced by the pipeline. Most of the plots are taken from the MultiQC report, which summarises results at the end of the pipeline.

## Pipeline overview

The pipeline is built using [Nextflow](https://www.nextflow.io/)
and processes data using the following steps:

* [nf-core/scrnaseq: Output](#nf-corescrnaseq-output)
  * [:warning: Please read this documentation on the nf-core website: https://nf-co.re/scrnaseq/output](#warning-please-read-this-documentation-on-the-nf-core-website-httpsnf-corescrnaseqoutput)
  * [Introduction](#introduction)
  * [Pipeline overview](#pipeline-overview)
  * [Kallisto & Bustools Results](#kallisto--bustools-results)
  * [STARsolo](#starsolo)
  * [Salmon Alevin & AlevinQC](#salmon-alevin--alevinqc)
  * [Other output data](#other-output-data)
  * [MultiQC](#multiqc)
  * [Pipeline information](#pipeline-information)

## Kallisto & Bustools Results

See [Kallisto](https://pachterlab.github.io/kallisto/about) for details about Kallisto and [Bustools](https://bustools.github.io/) for more information on BusTools.

The pipeline can analyze data from single cell rnaseq experiments and generates a set of folders with respective outputs from various steps of the analysis. For a detailed summary what the pipeline does specifically, please follow the [excellent tutorial](https://www.kallistobus.tools/getting_started.html) that also describes specific steps for downstream analysis of the generated matrices.

**Output directory: `results/kallisto`**

* `raw_bus`
  * Contains the unconverted BUS formatted pseudo aligned data
* `sort_bus`
  * Contains the same BUS formatted data, sorted and corrected with the supplied barcode whitelist
* `kallisto_gene_map`
  * Contains the converted GTF gene map that is used by BUSTools for downstream analysis
* `bustools_counts`
  * Contains two subdirectories
    * `eqcount`: Containing the Transcript Compatibility Count (TCC) Matrix (`tcc.mtx`)
    * `genecount`: Containing the Gene Count Matrix (`gene.mtx`)
* `bustools_metrics`
  * Contains the JSON metrics generated by BUStools

For details on how to load these into R and perform further downstream analysis, please refer to the [BusTools HowTo](https://github.com/BUStools/getting_started/blob/master/getting_started.ipynb).

**Output directory: `results/reference_genome`**

* `kallisto_index`
  * Contains the index of the supplied (genome/transcriptome) fasta file

## STARsolo

**Output directory: `results/STAR`**

* Contains the mapped BAM files and output metrics created by STARsolo

**Output directory: `results/reference_genome`**

* `star_index`
  * Contains the index of the supplied genome fasta file

## Salmon Alevin & AlevinQC

**Output directory: `results/alevin`**

* `alevin`
  * Contains the created Salmon Alevin pseudo-aligned output
* `alevinqc`
  * Contains the QC report for the aforementioned Salmon Alevin output data

**Output directory: `results/reference_genome`**

* `salmon_index`
  * Contains the indexed reference transcriptome for Salmon Alevin
* `alevin/txp2gene.tsv`
  * The transcriptome to gene mapping TSV file utilized by Salmon Alevin

## Other output data

**Output directory: `results/reference_genome`**

* `barcodes`
  * Contains the utilized cell barcode whitelists (if applicable)
* `extract_transcriptome`
  * When supplied with a `--fasta` genome fasta, this contains the extracted transcriptome
  * The GTF file supplied with `--gtf` is used to extract the transcriptome positions appropriately
  
## MultiQC

[MultiQC](http://multiqc.info) is a visualization tool that generates a single HTML report summarizing all samples in your project. Most of the pipeline QC results are visualised in the report and further statistics are available in the report data directory.

The pipeline has special steps which also allow the software versions to be reported in the MultiQC output for future traceability.

For more information about how to use MultiQC reports, see [https://multiqc.info](https://multiqc.info).

**Output files:**

* `multiqc/`
  * `multiqc_report.html`: a standalone HTML file that can be viewed in your web browser.
  * `multiqc_data/`: directory containing parsed statistics from the different tools used in the pipeline.
  * `multiqc_plots/`: directory containing static images from the report in various formats.

## Pipeline information

[Nextflow](https://www.nextflow.io/docs/latest/tracing.html) provides excellent functionality for generating various reports relevant to the running and execution of the pipeline. This will allow you to troubleshoot errors with the running of the pipeline, and also provide you with other information such as launch commands, run times and resource usage.

**Output files:**

* `pipeline_info/`
  * Reports generated by Nextflow: `execution_report.html`, `execution_timeline.html`, `execution_trace.txt` and `pipeline_dag.dot`/`pipeline_dag.svg`.
  * Reports generated by the pipeline: `pipeline_report.html`, `pipeline_report.txt` and `software_versions.csv`.
  * Documentation for interpretation of results in HTML format: `results_description.html`.
