# Pipeline for annotating genomes using long read transcriptomics
This repository contains a [nextflow](https://www.nextflow.io/) workflow
for assembly and annotation of transcripts from Oxford Nanopore cDNA or direct RNA reads.
## Overview
* cDNA or direct RNA reads are optionally preprocessed by [pychopper](https://github.com/nanoporetech/pychopper) for trimming and orientation.
* Reads are then mapped to a supplied reference genome using [minimap2](https://github.com/lh3/minimap2)
* Transcripts are assembled by[stringtie](http://ccb.jhu.edu/software/stringtie) in long read mode (with or without a guide reference annotation) to generate the GFF annotation.
* The annotation generated by the pipeline is compared to the reference annotation (if supplied) using [gffcompare](http://ccb.jhu.edu/software/stringtie/gffcompare.shtml)
* An html report is generated, which contains various summary statistics and plots of the data.
## Quickstart
The workflow uses [nextflow](https://www.nextflow.io/) to manage compute and
software resources, as such nextflow will need to be installed before attempting
to run the workflow.
The workflow can currently be run using either
[Docker](https://www.docker.com/products/docker-desktop),
[Singularity](https://sylabs.io/singularity/) or
[conda](https://docs.conda.io/en/latest/miniconda.html) to provide isolation of
the required software. Each method is automated out-of-the-box provided
either docker, singularity or conda is installed.
It is not required to clone or download the git repository in order to run the workflow.
For more information on running EPI2ME Labs workflows [visit out website](https://labs.epi2me.io/wfindex).
**Workflow options**
To obtain the workflow, having installed `nextflow`, users can run:
```
nextflow run epi2me-labs/wf-isoforms --help
```
to see the options for the workflow.
**Workflow inputs**
- Directory containing cDNA/direct RNA reads (or path to single file) in fastq/fastq.gz format
- Reference genome in fast format
- Optional reference annotation in GFF2/3 format
**Example workflow run**
```
# To run a small and quick example using synthetic data
nextflow run wf-isoforms/ --fastq test_data/fastq --ref_genome genome.fasta --ref_annotation reference.gff
--out_dir outdir/ -profile conda
```
```
# To evaluate the workflow on a larger Drosophila dataset
chmod u+x ./run_evaluation_dmel.sh outdir
```
**Workflow outputs**
* wf-isoforms-report.html
- Summary and plots of reads, alignments and the transcript assembly and annotation
* str_merged.gff
- The stringtie-generated transcript annotations
* str_merged.stats
- gffcomare file with statistics regarding the accuracy of the assembled query transcripts in relation to the reference annotation
* str_merged.annotated.gtf
- A gffcomapre output file with extra columns relating to comparison with the reference annotation
* str_transcriptome.fas
- A transcriptome made from the query reads
* merged_transcriptome.fas
-A transcriptome made from the combined query reads and reference annotation
## Useful links
* [nextflow](https://www.nextflow.io/)
* [docker](https://www.docker.com/products/docker-desktop)
* [Singularity](https://sylabs.io/singularity/)
* [conda](https://docs.conda.io/en/latest/miniconda.html)