Pittsburgh Supercomputing Center 

Advancing the state-of-the-art in high-performance computing, communications and informatics.

Picard

 

 

Picard comprises Java-based command-line utilities that manipulate SAM files, and a Java API (SAM-JDK) for creating new programs that read and write SAM files. Both SAM text format and SAM binary (BAM) format are supported.

Installed on blacklight  and biou.

Other resources that may be helpful include:

Website: http://picard.sourceforge.net

Running Picard

1) Make Picard availiable for use

a) blacklight:
The Picard program will be made availiable for use through the module command. To load the Picard module enter:

module load picard-tools

The picard command jar files will be found in the directory $PICARD_TOOLS_HOME

b) biou:
The Picard programs are availiable through the Galaxy instance on biou.

To make the Picard programs availiable through the command line, csh users should enter the following command:

% source /packages/bin/SETUP_BIO_SOFTWARE

To make the Picard programs availiable through the command line, bash users should enter the following command:

% source /packages/bin/SETUP_BIO_SOFTWARE

2) Usage:

Picard Commands can be invoked as follows:

java jvm-args -jar PicardCommand.jar  \
    OPTION1=value1 OPTION2=value2...

To see the command line arguments for an individual Picard command:

java jvm-args -jar PicardCommand.jar --help

For example, to see the command line arguments for the Picard AddOrReplaceReadGroups command on blacklight enter:

java -XX:ParallelGCThreads=1 -jar \                   
    $PICARD_TOOLS_HOME/AddOrReplaceReadGroups.jar

3) Picard Commands:
The following commands are availiable in the Picard package:

AddOrReplaceReadGroups
BamToBfq
BamIndexStats
BuildBamIndex
CalculateHsMetrics
CleanSam
CollectAlignmentSummaryMetrics
CollectGcBiasMetrics
CollectInsertSizeMetrics
CollectMultipleMetrics
CollectTargetedPcrMetrics
CollectRnaSeqMetrics
CompareSAMs
CreateSequenceDictionary
DownsampleSam
ExtractIlluminaBarcodes
EstimateLibraryComplexity
FastqToSam FilterSamReads
FixMateInformation
IlluminaBasecallsToFastq
IlluminaBasecallsToSam
CheckIlluminaDirectory
IntervalListTools
MakeSitesOnlyVcf
MarkDuplicates
MeanQualityByCycle
MergeBamAlignment
MergeSamFiles
MergeVcfs
NormalizeFasta
ExtractSequences
QualityScoreDistribution
ReorderSam
ReplaceSamHeader
RevertSam
SamFormatConverter
SamToFastq
SortSam
VcfFormatConverter
MarkIlluminaAdapters
SplitVcfs
ValidateSamFile
ViewSam 
Building

4) Example PBS script (blacklight) running SamFormatConverter and SortSam:

#!/bin/bash
#PBS -q batch
#PBS -j oe
#PBS -l ncpus=16
#PBS -l walltime=24:00:00
#PBS -N PicardExample 
#
# ---------------
# Bowtie Setup
# ---------------
source /usr/share/modules/init/bash
module load picard-tools/1.48
module load java
#
set -x
################################################################
# WORKDIR: Location where input files are and location where 
# output files are placed. 
# 
# SAMFILE: (input) Points to the samfile to be converted to 
# bam format 
# 
# BAMFILE: (output) The bamfile (converted from original 
# samfile) 
# 
# SORTEDBAMFILE: (output) The sorted bamfile 
################################################################
WORKDIR=/brashear/$USER/WORKDIR
SAMFILE=Bowtie.sam
BAMFILE=BowtieP.bam
SORTEDBAMFILE=BowtieP.sort.bam
# --------------------------------------------------------
# Run picard SamFormatConverter.jar on original SAM file
# --------------------------------------------------------
cd $WORKDIR
ja $SCRATCH/$$.0
java -XX:ParallelGCThreads=1 -Xmx100G \
    -jar $PICARD_TOOLS_HOME/SamFormatConverter.jar \
    INPUT=$SAMFILE OUTPUT=$BAMFILE TMP_DIR=$SCRATCH_RAMDISK \
    MAX_RECORDS_IN_RAM=50000000
ja -set $SCRATCH/$$.0
# -------------------------------------
# Run picard SortSam.jar on BAM file
# -------------------------------------
ja $SCRATCH/$$.1
java -XX:ParallelGCThreads=1 -Xmx100G \
    -jar $PICARD_TOOLS_HOME/SortSam.jar \
    SORT_ORDER=coordinate \
    INPUT=$BAMFILE OUTPUT=$SORTEDBAMFILE TMP_DIR=$SCRATCH_RAMDISK
ja -set $SCRATCH/$$.1

Stay Connected

Stay Connected with PSC!

facebook 32 twitter 32 google-Plus-icon