Stacks

pstacks

Similar to ustacks, except this program will extract stacks that have been aligned to a reference genome by a program such as BWA or GSnap and identify SNPs. These stacks can then be processed with cstacks and/or sstacks.

Program Options

pstacks -f file_path -i id -o path [-m min_cov] [-p num_threads] [-t file_type]

Model options:

For the SNP or Bounded SNP model:

For the Bounded SNP model:

For the Fixed model:

Example Usage

  1. Aligning samples with BWA, then running pstacks on the SAM outputs (setting a numeric ID for each one)

    % bwa mem -t 8 bwa_db/gac_gen_broads1_e77 ./samples/exp1_dam.fastq > ./aligned/exp1_dam.sam % bwa mem -t 8 bwa_db/gac_gen_broads1_e77 ./samples/exp1_sire.fastq > ./aligned/exp1_sire.sam % bwa mem -t 8 bwa_db/gac_gen_broads1_e77 ./samples/exp1_control_1.fastq > ./aligned/exp1_control.sam % bwa mem -t 8 bwa_db/gac_gen_broads1_e77 ./samples/exp1_treatment.fastq > ./aligned/exp1_treatment.sam

    % pstacks -p 8 -t sam -f ./aligned/exp1_dam.sam -o ./stacks -i 1 -m 3 % pstacks -p 8 -t sam -f ./aligned/exp1_sire.sam -o ./stacks -i 2 -m 3 % pstacks -p 8 -t sam -f ./aligned/exp1_control.sam -o ./stacks -i 3 -m 3 % pstacks -p 8 -t sam -f ./aligned/exp1_treatment.sam -o ./stacks -i 4 -m 3

  2. Here we will align samples with BWA, convert them to BAM to save space, then run pstacks

    % bwa mem -t 8 bwa_db/gac_gen_broads1_e77 ./samples/exp1_dam.fastq > ./aligned/exp1_dam.sam % bwa mem -t 8 bwa_db/gac_gen_broads1_e77 ./samples/exp1_sire.fastq > ./aligned/exp1_sire.sam % bwa mem -t 8 bwa_db/gac_gen_broads1_e77 ./samples/exp1_control.fastq > ./aligned/exp1_control.sam % bwa mem -t 8 bwa_db/gac_gen_broads1_e77 ./samples/exp1_treatment.fastq > ./aligned/exp1_treatment.sam % samtools view -h -b ./aligned/exp1_dam.sam > ./aligned/exp1_dam.bam % samtools view -h -b ./aligned/exp1_sire.sam > ./aligned/exp1_sire.bam % samtools view -h -b ./aligned/exp1_control.sam > ./aligned/exp1_control.bam % samtools view -h -b ./aligned/exp1_treatment.sam > ./aligned/exp1_treatment.bam % rm ./aligned/exp1_dam.sam ./aligned/exp1_sire.sam ./aligned/exp1_control.sam ./aligned/exp1_treatment.sam

    % pstacks -p 16 -f ./aligned/exp1_dam.bam -o ./stacks -i 1 -m 3 % pstacks -p 16 -f ./aligned/exp1_sire.bam -o ./stacks -i 2 -m 3 % pstacks -p 16 -f ./aligned/exp1_control.bam -o ./stacks -i 3 -m 3 % pstacks -p 16 -f ./aligned/exp1_treatment.bam -o ./stacks -i 4 -m 3

  3. Aligning samples with GSnap, then running pstacks on the SAM outputs (setting a numeric ID for each one)

    % gsnap -t 12 -A sam -m 5 -i 2 --min-coverage 0.90 --gunzip -d gac_gen_broads1_e77 -D ./gsnap_db/gac_gen_broads1_e77 --split-output=./aligned/sample_01 ./samples/sample_01.fq.gz % gsnap -t 12 -A sam -m 5 -i 2 --min-coverage 0.90 --gunzip -d gac_gen_broads1_e77 -D ./gsnap_db/gac_gen_broads1_e77 --split-output=./aligned/sample_02 ./samples/sample_02.fq.gz % gsnap -t 12 -A sam -m 5 -i 2 --min-coverage 0.90 --gunzip -d gac_gen_broads1_e77 -D ./gsnap_db/gac_gen_broads1_e77 --split-output=./aligned/sample_03 ./samples/sample_03.fq.gz % gsnap -t 12 -A sam -m 5 -i 2 --min-coverage 0.90 --gunzip -d gac_gen_broads1_e77 -D ./gsnap_db/gac_gen_broads1_e77 --split-output=./aligned/sample_04 ./samples/sample_04.fq.gz

    % pstacks -p 12 -t sam -f ./aligned/sample_01.uniq -o ./stacks -i 1 -m 3 % pstacks -p 12 -t sam -f ./aligned/sample_02.uniq -o ./stacks -i 2 -m 3 % pstacks -p 12 -t sam -f ./aligned/sample_03.uniq -o ./stacks -i 3 -m 3 % pstacks -p 12 -t sam -f ./aligned/sample_04.uniq -o ./stacks -i 4 -m 3

Other Pipeline Programs

Raw Reads

Core

Execution control

Utilities