Skip to content
MikeDMorgan edited this page Apr 26, 2016 · 3 revisions

Pipeline Usage Instructions

This pipeline was used to perform analysis for a project assessing the influence of a high fat diet on the intra-testicular germ cell transcriptome.

The pipeline has three tasks:

  • Expression quantification using featureCounts
  • Differential expression testing, using DESeq2
  • Generation of in silico spike in table, with differential expression testing

For power analysis there is a separate R script that can be run, for instance in an R Studio session (NB: input files are hard-coded, so just change them to the relevant path).

This pipeline relies heavily on the Python code in the CGAT code repository (CGATPipelines). This code, and the parent repo (CGAT), contain the relevant interface between a working environment and high performance computing cluster. For more information see the relevant documentation associated with each repository.

Assuming the above repositories have been properly cloned and implemented, the remainder of this wiki will describe the usage of this specfic pipeline.

Setup

To setup the relevant config files in the working directory (i.e. where the input files are contained, and the output files will be generated), run:: <source_directory>/pipeline_project035.py config

where <source_directory> is the location of the pipeline script file pipeline_project035.py. It is good idea to preserve the directory structure from this repository to avoid unexpected errors.

Pipeline execution

To run a task (described below) use a similar invocation as the setup command above. This time use the make <task> syntax. The number of parallel instances of a single task to be run is controlled by the -p flag and pipeline logging verbosity by -v. It is recommended to tune -p to the resources and load of your computing cluster. It is recommend to make -v as high as possible to aid with any error debugging, i.e. -v 6.

To see what the pipeline tasks that will be run with your files are use the show command inplace of make. This will generate the specific jobs to be executed with the relevant input and output file names.

For more advanced usage see the general CGATPipelines documentation

Expression quantification

Input::

  • BAM file(s)
  • GTF(s) of annotation of interest (gzip compressed)

Pipeline configuration parameters are stored and altered in the associatied pipeline.ini file. This contains various task parameters in the pipeline that can be altered at the user's discretion. BEWARE: there are not always default values, all parameters are required, none are optional.

run make loadFeatureCounts to run featureCounts on all .bam files, and combine counts across samples into a single table of genes X samples. This then loads the table into an sqlite database called csvdb indexed on the gene_id attribute.

If there are multiple GTF files then counting will be performed for each combination of GTF & BAM file.

Differential expression testing

Input::

  • counts table, i.e. output from expression quantification
  • experimental design table, name design.tsv (NB: the design file must be called design.tsv, else it will fail).

Differential expression testing will be carried out for each input counts table (i.e. there may be multiple counts table for different annotations). It is assumed there is a single experimental design, regardless of the number of annotations of interest. If there are different design tables then run this pipeline in a different working directory with the relevant experimental design table.

To perform the differential expression testing, and generate the relevant MA-plots, sample clustering (hierarchical) and PCA plots (first 2 PCs), use the make loadDiffGenes command. This will also load the differential expression table(s) into the sqlite database.

In silico spike in generation & testing

Input::

  • counts table
  • experimental design

The purpose of this is to generate an in silico spike in counts table that can be used to assess the power of the experiment to detect differentially expressed features. Annotations (rows) are iteratively shuffled within experimental groups (preserving variance structure), retaining suffled rows that show a log fold or absolute difference between conditions. This process is repeated until bins over a given range are filled.

This uses the CGAT Python script counts2counts.py. The script parameters can be defined in the pipeline config file (pipeline.ini).

To execute this task, and load into the sqlite database, use make loadSpikeIn.

Differential expression testing can be performed on this counts table (and database loading), used for power calculations, with the command make loadSpikeInDESeq.