Random subsample from a BAM file

picard DownsampleSam

1
java -jar picard.jar DownsampleSam P=0.25 I=QX70A.sorted.bam O=QX70A.Per0.25.bam CREATE_INDEX=true

picard

samtools -s

1
samtools view -h -b -s 0.25 QX70A.sorted.bam -o QX70A.Per0.25.bam

GATK -dfrac

1
java -jar GenomeAnalysisTK.jar -T PrintReads -R ref.fa -I input.bam -o output.bam -dfrac 0.25