LncPipe

AUR nextflow

Overall

Recently, long noncoding RNA molecules (lncRNA) captured widespread attentions for its critical roles in diverse biological process and important implications in variety of human diseases and cancers. Identification and profiling of lncRNAs is a fundamental step to advance our knowledge on their function and regulatory mechanisms. However, RNA sequencing based lncRNA discovery is limited due to complicated operations and implementation. Therefore, we presented a one-stop pipeline called LncPipe focused on characterizing lncRNAs from raw transcriptome sequencing data. The pipeline was developed based on a popular workflow framework Nextflow, composed of four core procedures including reads alignment, assembly, identification and quantification. It contains various unique features such as well-designed lncRNAs annotation strategy, optimized calculating efficiency, diversified classification and interactive analysis report. Additionally, LncPipe allows users cancel pipeline, reset parameters from command or modifying main script directly and resume analysis from continues checkpoint.

Table of Contents

Schematic diagram

Installation

Nextflow
LncPipe is implemented with Nextflow pipeline manage system. To run our pipelines. Nextflow should be preinstalled at POSIX compatible system (Linux, Solaris, OS X, etc), It requires BASH and Java 7 or higher to be installed. We do not recommend running the pipes in the Windows since most of bioinformatic tools do not supported. Here, we show the step by step installation of Nextflow in linux system as an example, which adapted from NextFlow.

  1. Download the executable package by copying and pasting the following command in your terminal window:
    wget -qO- get.nextflow.io | bash
    

It will create the Nextflow main executable file in the current directory.

  1. Optionally, move the nextflow file in a directory accessible by your $PATH variable (this is only required to avoid to remember and type the Nextflow full path each time you need to run it). Of course you can download the lastest binary version of NextFlow by yourself from the https://github.com/nextflow-io/nextflow/releases and add the path into your system environment. All those pipelines were written in Nextflow commands. For more details, please see here.

  2. A type command for run nextflow

nextflow run LncRNAanalysisPipe.nf

Prepare input files

References, index and annotation files(required)

  1. Hisat index (e.g. human index can be downloaded from ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/data/grch38_tran.tar.gz) or STAR index (hg38 genome index etc.) according aligner your are going to use. > Building index of hisat relatively require large amount of memory, thus we sugguested that users downloaded it directly from the hisat website.
    1. Genome reference (genome fasta file with suffix .fa , UCSC etc.).
    2. GENCODE gene annotation file in GTF format
    3. LNCipedia gene annotation file in GTF format.(set null if not available for your species)
    4. Raw sequence file with *.fastq.gz / *.fq.gz suffixed

Supported species

>Currently, LncPipe was designed for human only, but it also support other species which required users providing "known_protein_coding.gtf" and  "known_lncRNA.gtf "
the detail usage for non-human species could be found here.

Run Docker

  1. Prepare input files.
  2. Modify the docker.config in mandatory section.
  3. Install docker
  4. Command
    nextflow -c docker.config run LncRNAanalysisPipe.nf
    

docker image can be downloaded from https://hub.docker.com/r/bioinformatist/lncpipe/tags/ with the latest tag.

Alternatively, nextflow can automatically pull image from docker.io. Dockerfile recorded that what we have done with the image. For docker pull image from local china, we suggest users using mirror site instead.

Dependencies

Prerequisites install command (required when docker image is not favored, you should execute them via root)

or AfterQC

    aria2c https://github.com/OpenGene/AfterQC/archive/v0.9.7.tar.gz -q -o /opt/AfterQC-0.9.7.tar.gz && \
    tar xf /opt/AfterQC-0.9.7.tar.gz --use-compress-prog=pigz -C /opt/ && \
    cd /opt/AfterQC-0.9.7 && \
    make && \
    perl -i -lape's/python/pypy/ if $. == 1' after.py && \
    rm -rf Dockerfile Makefile README.md testdata report_sample && \
    rm editdistance/*.cpp editdistance/*.h && \
    ln -s /opt/AfterQC-0.9.7/*.py /usr/local/bin/ && \
    rm /opt/AfterQC-0.9.7.tar.gz

When using afterQC, we recommended that users install pypy in your operation system, which can accelerated about 3X speed for raw reads processing, as suggested by author of AfterQC.

Alternatively, when you are going to using STAR-Cufflinks in your system, the corresponding installation command should be as follows:

The gffcompare utility share the same function as cuffcompare, therefore, in STAR-cufflinks analysis pipe gffcompare is not required.

Interactive reports

LncPipe output was well-summarized in an interactive manner, which was carried out by a novel-developing R package LncPipeReporter.

Configuration

As a nextflow-based analysis pipeline, LncPipe allow users edit configure file nextflow.config to set the index files and default file path parameters instead of typing in command. We strongly recommended that users using config file rather than command input to adjust their parameters. For example, plz go to params line, and set the following information of your operation system and environment groovy

    params {
    /*
        User setting options (mandatory)
         */
    // input file and genome reference()
        fastq_ext = '*_{1,2}.clean.fq.gz'
        fasta_ref = '/data/database/hg38/genome.fa'
        design = 'design.file'
        hisat2_index = '/data/database/hg38/hisatIndex/grch38_snp_tran/genome_snp_tran'
        gencode_annotation_gtf = "/data/database/hg38/Annotation/gencode.v24.annotation.gtf"
        lncipedia_gtf = "/data/database/hg38/Annotation/lncipedia_4_0_hg38.gtf"
        cpatpath = '/home/zhaoqi/software/CPAT/CPAT-1.2.2'

    /*
        User setting options (optional)
         */
        star_idex = ''//set if star used
        bowtie2_index = ''//set if tophat used
        aligner = "hisat" // or "star","tophat"
        sam_processor="sambamba"//or "samtools"
        qctools = "fastqc" // or "afterqc","fastp"
        singleEnd = false
        unstrand = false
        skip_combine = false
        lncRep_Output = 'reporter.html'
        lncRep_theme = 'npg'
        lncRep_cdf_percent = 10
        lncRep_max_lnc_len = 10000
        lncRep_min_expressed_sample = 50
        mem=60//Gb
        cpu=30
    }

Parameters

Those parameters would cover the setting from nextflow.config file Mandatory(plz configure those in nextflow.config* file)

Name Example/Default value Description
--input_folder . input folder
--species human Your species, mouse, fly and zebra fish are also supported
--fastq_ext *_{1,2}.fastq.gz input raw paired reads
--out_folder . output folder
--design FALSE a txt file that stored experimental design information, plz see details from --design section below
Name Required Description
--star_index/--bowtie2_index/--hisat2_index - Path to STAR/bowtie2/hisat2(mutually exclusive) index(required if not set in config file)
--fasta - Path to Fasta reference(required if not set in config file)
--gencode_annotation_gtf - An annotation file from GENCODE database for annotating lncRNAs(required if not set in config file). e.g. gencode.v26.annotation.gtf
--lncipedia_gtf - An annotation file from LNCipedia database for annotating lncRNAs(required if not set in config file) e.g. lncipedia_4_0_hc_hg38.gtf
Name Required Description
--cpatpath - Home folder of cpat installed location

since cpat may call model data from its home path, users should specified where the model file is located in. Especially users install cpat by themselves without our install code.

Name Default value Description
--singleEnd FALSE specify that the reads are single ended
--merged_gtf FALSE Skip mapping and assembly step by directly providing assembled merged gtf files
--unstrand FALSE specify that library is unstrand specific
--aligner star Aligner for reads mapping (optional), STAR is default and supported only at present,star/tophat/hisat2
--qctools afterqc Tools for assess raw reads quality or filtered by AfterQC, fastqc or afterqc
Name Default value Description
--lncRep_Output reporter.html Specify report file name.
--lncRep_theme npg Plot theme setting in interactive plot. Values from ggsci
--lncRep_min_expressed_sample 50 Minimum expressed gene allowed in each sample, 50 default. Samples not passed were filtered from analysis

--fastq_ext

Raw fastq files were required for denovo analysis.This parameters should be set according to your paired or singled reads file names. Suppose your paired end sequence files are compressed with .gz suffixed. For example:

    Sample1_1.fq.gz
    Sample1_2.fq.gz
    Sample2_1.fq.gz
    Sample2_2.fq.gz

Then you can input pattern *_{1,2}.fq.gz to make the all paired end file recognized by LncPipe .

For singled reads file, file pattern should be feed with --singleEnd specified.

--star_idex/--bowtie2_index/--hisat2_index

This parameter is required when not configured in nextflow.config file. It specify the star/tophat/hisat2(mutually exclusive) index folder built before running LncPipe . If you don't know what it is,You can use --fasta to specify the reference sequence data. The index file would be built by LncPipe automatically.

--design

Experimental design file matrix for differential expression analysis. Default: null Format:

WT:Sample1,Sample2,Sample3
KO:Sample1,Sample2,Sample3

While KO/WT represents the two experimental condition, and sample1, sample2, sample3 are replicates which should be comma-delimited in the same line .

For sample names, it should be the sample as the prefix of fastq files which was trimmed by --fastq_ext.

For example:

if fastq file names are Sample1_1.fq.gz, Sample1_2.fq.gz that comes from one sample and your --fastq_ext is set as *_{1,2}.fq.gz, the sample name should be Sample1.

Output

While the whole pipeline is finished properly, there is Result folder under current path(default) or output_folder set by user. The basic structure of Result is follows:

    Result/
    ├── QC
    │   ├── N1141_1.clean_fastqc.html
    │   ├── N1141_2.clean_fastqc.html
    │   ├── N1177_1.clean_fastqc.html
    │   └── N1177_2.clean_fastqc.html
    ├── Identified_lncRNA
    │   ├── all_lncRNA_for_classifier.gtf
    │   ├── final_all.fa
    │   ├── final_all.gtf
    │   ├── lncRNA.fa
    │   ├── protein_coding.fa
    │   └── protein_coding.final.gtf
    ├── LncReporter
    │   ├── Differential_Expression_analysis.csv
    │   └── Report.html
    ├── Quantification
    │   ├── kallisto.count.txt
    │   └── kallisto.tpm.txt
    └── Star_alignment
        ├── STAR_N1141
        │   ├── N1141Aligned.sortedByCoord.out.bam
        │   ├── N1141Log.final.out
        │   ├── N1141Log.out
        │   ├── N1141Log.progress.out
        │   └── N1141SJ.out.tab
        └── STAR_N1177
            ├── N1177Aligned.sortedByCoord.out.bam
            ├── N1177Log.final.out
            ├── N1177Log.out
            ├── N1177Log.progress.out
            └── N1177SJ.out.tab

Tips

Acknowledgement

Thanks to the author of AfterQC, Shifu Chen, for his help on providing a gzip output support to meet the require of LncPipe. Thanks to the internal test by Hongwan Zhang and Yan Wang from SYSUCC Cancer bioinformatics platform.

FAQ

Contact

For implementation:
Qi Zhao zhaoqi@sysucc.org.cn, Sun Yat-sen University Cancer Center;
Yu Sun sun_yu@mail.nankai.edu.cn, Nan kai University;
For project design and new feature request:
Qi Zhao zhaoqi@sysucc.org.cn, Sun Yat-sen University Cancer Center;
Zhixiang Zuo zuozhx@sysucc.org.cn, Sun Yat-sen University Cancer Center;

We strongly recommend users open new issues if they have questions or find bugs.

License

GPL v3 license

Citation