25
PARALLEL PAIR-HMM SNP DETECTION GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Embed Size (px)

Citation preview

Page 1: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

PARALLEL PAIR-HMM SNP

DETECTION

GNUMAP-SNP

Nathan ClementThe University of TexasAustin, TX, USA

Page 2: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Outline

MotivationNGS Issues and RequirementsPair-HMM

Memory Optimizations Results Conclusion

Page 3: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

MotivationMutation Detection: SNP discovery

HapMap and resequencing Species Identification Bisulfite Sequencing

Epigenetic influencesRNA editing

Page 4: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Error Rates*

Instrument Run Time Mb/run Bases/read

Primary Error Type

Error Rate (%)

3730xl (Capillary)

2 h 0.06 650 Substitution 0.1-1

454 FLX+ 18-20 h 900 700 Indel 1

Illumina HiSeq2000

10 days ≤ 600,000 100+100 Substitution ≥0.1

Ion Torrent – 318 chip

2 h >1000 >100 Indel ~1

PacBio RS 0.5-2h 5-10 860-1100 CG Deletions

16

* Data current as of May 2011: Glenn, Travis C, “Field guide to next-generation DNA sequencers,” Molecular Ecology Resources, vol 11, pp 759-769, 2011

Page 5: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Pair-HMM

Page 6: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Pair-HMM (Mathematics)

Match

Gap (in both directions)

Page 7: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Pair-HMM (M)

a t a c g a c t

a 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

g 0.00 0.68 0.00 0.00 0.00 0.00 0.00 0.00

t 0.00 0.32 0.68 0.00 0.00 0.00 0.00 0.00

a 0.00 0.00 0.32 0.68 0.00 0.00 0.00 0.00

g 0.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00

a 0.00 0.00 0.00 0.00 0.00 1.00 0.00 0.00

c 0.00 0.00 0.00 0.00 0.00 0.00 1.00 0.00

c 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1.00

Page 8: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Pair-HMM (X)

a t a c g a c t

a 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

g 0.31 0.00 0.00 0.00 0.00 0.00 0.00 0.00

t 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

a 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

g 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

a 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

c 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

c 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

Page 9: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Pair-HMM (Y)

a t a c g a c t

a 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

g 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

t 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

a 0.00 0.00 0.00 0.31 0.00 0.00 0.00 0.00

g 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

a 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

c 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

c 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

Page 10: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Pair-HMMA C G T

a 1.00 0.00 0.00 0.00

g 0.00 0.00 0.68 0.31

t 0.32 0.00 0.00 0.68

a 0.99 0.00 0.00 0.00

g 0.00 0.00 1.00 0.00

a 1.00 0.00 0.00 0.00

c 0.00 1.00 0.00 0.00

c 0.00 1.00 0.00 0.00

Page 11: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Expected ResultsCHR POS TOT A C G T SNP? PVAL

chrX 1755234 17.00 0.00 0.00 17 0.00 N

chrX 1755235 18.00 0.00 18.00 0.00 0.00 N

chrX 1755236 19.00 9.99 0.00 9.00 0.01 Y:g->a/g 2.54e-08

chrX 1755237 19.50 0.00 0.00 0.00 19.50 N

chrX 1755238 19.50 0.00 0.00 19.50 0.00 N

chrX 1755239 46.00 0.01 19.49 0.00 0.00 N

Page 12: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Why Inline SNP Calling?

Post-ProcessingDisk space, less memory

InlineRequires more memoryLess disk spaceCan include specifics probabilities for each

read

Page 13: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Previous Optimizations

Two methods for speeding up mapping:1. Entire genome on one machine

2. Split memory among different machines○ Must normalize across all genome portions○ MPI reduction

Page 14: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Previous Optimizations

Page 15: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Memory Requirements

Human Genome (3gb)HashMap ≈ 12GB4 bits/character = 1.5GB5 floating point values per base (plus N) =

sizeof(float)*5 * 3GB=60GBAlso stores total for easy computation =

sizeof(float) * 3GB = 12GB Total of ≈ 90GB per run

Page 16: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Three Memory Optimizations Normal (no optimization) Integer discretization Centroid discretization

Page 17: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Integer Discretization

Only need one floating point value (for total) and 1 byte/nucleotide.

“Parts per 255” Biggest hit: Going into and out of

“integer space”

Page 18: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Integer DiscretizationAdded from ri:

1.0 0.00 0.68 0.31 0.01 0.00 Step 1: Convert from

Integer Space Step 2: Add from ri to

Genome Step 3: Convert

back to Integer Space

Genome

Total A C G T N

12.0 3 231 7 12 3

Total A C G T N

12.0 0.15 10.9 0.33 0.56 0.15

Total A C G T N

13.0 0.15 11.6 0.64 0.57 0.15

Total A C G T N

13.0 2 228 13 11 2

Page 19: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Centroid Discretization

Many states not used:[255, 255, 255, 255, 255][0, 0, 0, 0, 0]

Many states not biologically relevantSNP transition (common) vs transversion

(not likely) MSA uses this compression to perform

fast alignment of one-to-many alignment

Page 20: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Centroid Discretization (cont)

Page 21: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Centroid Discretization (cont) Benefits

Doesn’t waste impossible or infrequently used space

Much smaller memory footprint Drawbacks:

Slight overhead in converting from centroid to floating point spaces

Rounding error (how significant?)

Page 22: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Speed Comparison

Page 23: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Optimization Stats (chrX)

Optimization Memory Mem % Wallclock TP FP

Normal 4.76GB 100% 04:25:55 1309 127

CharDisc 2.58GB 54.2% 04:36:58 677 0

CentDisc 2.01GB 42.2% 04:27:29 166 9058

Page 24: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Conclusion

For high error rates, HMM approach is ideal, but requires more memoryDistributing the genome across processors

doesn’t scale linearly Discretization methods provide good

memory reductions (up to 42%)Centroid discretization performs poorlyInteger discretization can be used when

available memory is low

Page 25: GNUMAP-SNP Nathan Clement The University of Texas Austin, TX, USA

Questions