High-Performance Computing at the NIH
GitHub YouTube @nih_hpc RSS Feed
ngsplot

Description

ngsplot is an easy-to-use global visualization tool for next-generation sequencing data.

References

Shen, L.*, Shao, N., Liu, X. and Nestler, E. (2014) ngs.plot: Quick mining and visualization of next-generation sequencing data by integrating genomic databases. BMC Genomics, 15, 284.

How to Use

ngsplot uses environment modules. Type

module load ngsplot

at the prompt. These environment variables are set:

Interactive Use

Here is an example commandline that uses only two cpus (-P 2):

$ module load ngsplot
$ cp -p $NGSPLOT/example/* .
$ cp -p $NGSPLOT/example.bam/* .
$ ngs.plot.r -G hg19 -R tss -C hesc.H3k4me3.1M.bam -O k4.test -P 2
Loading R libraries.....Done
Configuring variables...Done
Analyze bam files and calculate coverage............................................................................................................................................................................................................................................Done
Plotting figures...Done
Saving results...Done
Wrapping results up...Done
All done. Cheers!
$ ls *.pdf
hesc.H3k4me3.tss.avgprof.pdf  hesc.H3k4me3.tss.heatmap.pdf
$ display hesc.H3k4me3.tss.avgprof.pdf
PNG output

As a batch job

Create a batch script, for example:

#!/bin/bash
# -- this file is ngsplot.sh --
module load ngsplot
ngs.plot.r -G hg19 -R tss -C hesc.H3k4me3.1M.bam -O hesc.H3k4me3.tss -T H3K4me3 -L 3000 -FL 300 -P 8

Then submit, allocating the same number of cpus as indicated by -P and a decent amount of memory:

sbatch --mem=8gb --cpus-per-task=8 ngsplot.sh

As a swarm job

Create a swarmfile containing commandlines (for example, the file is named "swarmfile"):

ngs.plot.r -G hg19 -R tss -C sample1.bam -O sample1.tss -T H3K4me3_1 -L 3000 -FL 300 -P 2
ngs.plot.r -G hg19 -R tss -C sample2.bam -O sample2.tss -T H3K4me3_2 -L 3000 -FL 300 -P 2
ngs.plot.r -G hg19 -R tss -C sample3.bam -O sample3.tss -T H3K4me3_3 -L 3000 -FL 300 -P 2
ngs.plot.r -G hg19 -R tss -C sample4.bam -O sample4.tss -T H3K4me3_4 -L 3000 -FL 300 -P 2

Then submit it to swarm like this, again allocating the appropriate number of cpus/threads:

swarm --module ngsplot --file swarmfile -t 2 -g 4

Memory Errors

When ngsplot is run without adequate memory allocation, you may get the following errors:

Error: dims [product 89082] do not match the length of object [0]

or

Error in (result.matrix + result.pseudo.rpm)/(bkg.matrix + bkg.pseudo.rpm) :

Typically ngsplot will require at least 4gb of memory.

Documentation