This episode covers Zabad et al.'s methods to scale summary-statistics-based polygenic risk score (PRS) inference to millions of variants. The authors introduce compressed LD storage, memory-efficient coordinate-ascent variational algorithms, and multi-level parallelism to cut storage, runtime, and RAM by orders of magnitude while retaining competitive prediction accuracy.
0:00Welcome to Base by Base, the papercast that brings genomics to you, wherever you are. Thanks for listening, and don't forget to follow and rate us in your podcast app. You know, we hear so much about, um, the grand promise of personalized medicine.
0:12Oh, absolutely. It's everywhere. Right. There is this incredible, almost futuristic idea that, you know, a doctor could simply look at 1000000s of tiny variants in your DNA and just predict your exact risk for complex diseases.
0:26heart disease to diabetes, yeah. Exactly. It sounds perfect on paper. But here is the massive roadblock that honestly really gets talked about. When scientists try to actually crunch the numbers for 10s of 1000000s of genetic variants all at once.
0:39The computers literally run out of memory. They just buckle under the weight of it. Yeah, the math breaks down and these massive multimillion dollar supercomputing systems just crash. So what really happens when our biological data outgrows our computing power, and how could this change if research has found a way to shrink terabytes of genomic data down so small that you could run these massive health calculations on a standard laptop?
1:02I mean, the scale of the bottleneck is truly phenomenal. We have reached a point where our ability to sequence DNA has completely, uh, outpaced our ability to easily compute what that DNA actually means as a collective whole.
1:19In a very real sense, the field has just been drowning in its own biological data. Today, we celebrate the work of McGill University and Intel labs. who have advanced our understanding of scalable genomic algorithms.
1:32But, um, to truly appreciate what they have pulled off here, we need to lay down some groundwork first. Yeah definitely. We are talking about something called a polygenic risk score or a PRS. Right. So to understand a polygenic risk score.
1:46You kind of have to think about how most complex traits actually work in the human body. Like what kind of traits? Think about standing height, for example, or your risk for developing a specific disease like schizophrenia.
1:57These treats are rarely controlled by just one single isolated gene flipping on or off. It's not just a single switch. Exactly. It's not a single switch. Instead, they are the result of 1000s or even 1000000s of tiny genetic variations all adding their own, you know, microscopic influence to the final outcome.
2:16And to find those specific variations, researchers use something called a GWS, right? Which stands for Genome Wide Association Studies. Spot on. The basic idea there is that they look at the DNA of 100s of 1000s of people to see which these tiny genetic tweaks show up more often in people who have a certain trait versus people who don't.
2:37Yeah, that is the foundation of it. But the challenge is that you cannot just add up all those individual tweaks in a vacuum to get an accurate score. Because they affect each other. Right. You have to account for how those genetic variants interact with each other.
2:49And that brings us to the core biological hurdle in all of this, which is linkage to equilibrium or LD. Linkage to equilibrium. Okay, let's unpack this because it sounds incredibly dense. But it is actually a fundamental rule of genetics.
3:02It really is. Because DNA is a physical structure. It's like it's a long, continuous molecule, right? So genetic variants that sit physically close to each other on a chromosome tend to be inherited together.
3:15They travel as a package deal. They travel together through generations, yeah. So let's say you are trying to calculate a risk score. If you count, um, variant A is a risk factor, and then you count variant B as a completely separate risk factor, you might think you have double the risk.
3:31But they're attached. Exactly. If variant A and variant B are inherited as a package deal, you haven't actually found 2 distinct risks. You have just counted the same biological package twice. So it is kind of like analyzing someone's spending habits and trying to figure out if they're buying a suit.
3:47Okay, I like this If they buy the suit jacket, they almost always buy the suit pants. The jacket and the pants are in linkage to equilibrium. That's great way to put it. Right. So if you count the jacket as one indicator of buying the soup and the pants as a totally separate independent indicator, you're double counting the event, you're artificially inflating the data.
4:06Yeah, that is a much more accurate way to visualize the biology. So to correct for that double counting, scientists have to calculate what is called an LD matrix. Exactly. It's essentially a giant mathematical grid.
4:18It tracks the correlation between every single genetic variant and every other genetic variant, basically mapping out all those suit jackets and pants across the entire genome. And if you're listening to this and wondering why scientists didn't just, you know, buy bigger hard drives to store this grid, it's really important to realize just how astronomically large a grid of 18000000 interacting points really is.
4:42The scale is staggering. I mean, for a long time, the standard practice was to just filter the data down to a subset about 1000000 variants. Which is still huge. Oh, even then, the grid is quite large.
4:52But modern biobanks now have dense data on up to 18000000 variants. Yeah. A grid tracking the correlations of 18000000 items requires terabytes of storage space. It is so massive that just holding it in a computer's active memory requires a high performance supercomputing cluster.
5:12Which means your local clinic, and frankly, most research labs simply cannot use the full scope of the genetic data we have available. They're completely locked out. But earlier, you pointed out something fascinating.
5:24You said this isn't just a physical storage problem where we run out of hard drive space. The math itself actually breaks down. Yeah, this raises an important question. Why do the computers actually crash?
5:34Yeah, why? It comes down to a fundamental mathematical issue that happens in ultra-high dimensions. When you build an LD matrix that large, you are often estimating those correlations based on imperfect real world data.
5:49Like missing information. Exactly. There might be missing genetic reads or the data has been compressed to save space. And because of this inherent noise in the data, the matrix gets mathematically sick.
6:01Sick. Wait, how does a grid of numbers get sick? Well, in linear algebra, a healthy covariance matrix, which is what this grid fundamentally is, must be what we call positive semi-definite. Okay, you're going to have to translate that for me.
6:14Sure, sure. Think of the algorithms used in polygenic risk scoring as a ball rolling down the slopes of a deep valley. Okay, got the Val. The algorithm's job is to let the ball roll until it settles at the absolute lowest point of the valley.
6:27That lowest point is the optimal answer. It is the best possible weight for all those 1000000s of genetic variants. Okay, I am with you. The ball rolls down the valley to find the lowest point. That makes sense.
6:40But when you introduce noise across 18 million interacting dimensions, the matrix stops acting like a normal valley. It starts producing what are known as negative igen values. What does that do to the valley?
6:53A negative engine value essentially turns the bottom of that valley into a bottomless pit. Oh, wow. So the ball never settles. Never. The ball falls forever. It accelerates infinitely. That sounds like a nightmare for the software.
7:06It is. The optimization algorithms try to follow the slope, but because of the negative writing values, they get thrown off a mathematical cliff, the numbers they produce explode in magnitude, reaching infinity, which is, you know, physically impossible for a risk ore.
7:19Right. You can't have infinite risk. Exactly. So the error rates flip, the algorithms panic and the entire supercomputer crashes. That is wild. So researchers are looking at terabytes of data that requires supercomputers just to hold, and the moment they try to run the calculations to find the answer, This sick matrix creates a bottomless pit that destroys the algorithm.
7:42Which is why everyone just threw their hands up and said, well, let's just stick to 1000000 variants. Yeah, that was the accepted compromise for years. Prune the data, ignore the 1000000s of other variants, and stick to a highly filtered subset so the math wouldn't explode.
7:58But this team changed that. Right. The team at McGill and Intel Labs decided to stop throwing away the data. They took an existing tool called VIPRS, which stands for variational inference of polygenic risk scores, and completely rebuilt its computational architecture to solve both the storage crisis and the bottomless pit.
8:16I really want to walk through how they actually did this. Because it sounds like they had to fix multiple distinct failures at the same time. They did, yeah. The 1st issue is the sheer size of the Matrix.
8:27If a grid of 18 million variants takes terabytes of space. How do you even begin to shrink that? Well, the 1st step relies on the geometry of the grid itself. An LD matrix is perfectly symmetrical. Metrical how?
8:41The correlation between variant A and variant B is exactly the same as the correlation between variant B and variant A. So if you draw a diagonal line down the center of the grid, the top half is a perfect mirror image of the bottom half.
8:55Oh, so they didn't need to store the whole thing. Exactly. just chopped it in half. They programmed the new VIPRS algorithm to only store and read the upper triangle of the Matrix, completely eliminating the redundant bottom half.
9:07That is incredibly smart. Right. That instantly cuts the massive terabyte storage requirement down by 50%. But wait, if the algorithm is supposed to calculate the relationships between everything, how does it update its calculations if half the map is physically missing from the computer's memory?
9:23It uses the symmetry to its advantage. As the algorithm moves through its calculations, anytime it needs a value from the bottom half, the code cleverly maps the coordinates backward to pull the mirrored value from the top half.
9:36So it just reflects it. Exactly. Propagates the updates without ever needing to build or store the bottom half in memory. Okay, chopping the grid in half is brilliant, but we're still talking about 100s of gigabytes of data.
9:50My standard desktop still can't hold that in its active memory. What was their next move to get the digital weight down? They looked at the precision of the numbers themselves. This is a process called quantization.
10:02Normally, scientists use 64 bit double precision floating point numbers. That gives you a massive amount of decimal places for every single point on that grid, making the file extremely heavy. Lots of decimals equals lots of data.
10:15Exactly. The VIPRS team dropped that precision all the way down to 8 bit integers known as in 8. This means every data point is represented by just a single bite of memory. It shrinks the memory footprint by a massive factor of eight.
10:29Wow. So instead of storing a high-res photo of a perfectly symmetrical face, they just stored a heavily pixelated photo of half the face. Yes, that's exactly it. And you're telling me that was still enough for the algorithm to recognize the biological relationships accurately.
10:44What's fascinating here is that, yes, it absolutely was. It sounds incredibly aggressive, but even though they drastically reduced the resolution of the correlation data, meaning the exact decimal precision of the linkage between variants was rounded off, the structural integrity of the genetic map remained intact.
11:03So you don't need all those decimals. Turns out, you don't need 15 decimal places of precision to know that the suit jacket and the suit pants travel together. You just need to know they travel together.
11:13The 8 bit integer captures that relationship perfectly well. That is a massive leap in efficiency. But even with a pixelated half image, a file that large still has to be loaded into the computer's RAM to be processed.
11:25Right. If the goal is to run this on a standard laptop, how did they bypass the RAM limit? They changed the physical format of how the data is stored. They moved away from traditional clunky array storage files, and utilized something called the czar format.
11:40Zar format. Yeah, Zar is a highly compressed cloud native storage format that chunks the data into discrete blocks. Chunking. Like breaking it into pieces. Think of it like a massive multivolume encyclopedia.
11:54In the old system, to look up a single fact, the computer had to try and lift all 20 volumes off the shelf and hold them all in its hands at the exact same time. And the RAM would just buckle. Exactly.
12:06With the czar format, the data is chumped into individual pages. The algorithm only pulls the exact page of variance it is actively analyzing at that exact millisecond, reads it, and puts it back. You never have to load the entire terabyte matrix into your computer's active memory at once.
12:23Okay, so they cut it in half, pixelated the data and chunked it, so the computer only reads one page at a time. They solve the storage bottleneck. Yep, they did. But what about the math bottleneck? You said earlier that the noise in 18000000 dimensions creates negative igen values, that bottomless pit that crashes the supercomputer.
12:42How did they fix the math? They instituted a mathematical penalty to rebuild the floor of the valley? Rebuild the floor. Because they knew the negative eigen values were causing the optimization ball to fall infinitely?
12:54The team programmed the VIPRS tool to calculate the absolute value of the smallest negative igen value. Essentially, the code measures exactly how sick the matrix is, and then adds that specific value back into the equation as a constraint.
13:10So it acts like a guardrail. It acts like a new floor. In mathematical terms, adding that penalty restores the convexity of the optimization objective. It forces the parameters to stay grounded. So instead of the ball falling into a bottomless pit, the algorithm hits that constraint settles at the lowest possible valid and produces a mathematically sound risk score without the wild numeric explosions.
13:32That is incredibly elegant. So we have an algorithm that is compressed, memory efficient, and mathematically stable. Let's look at the actual findings because the numbers in this paper are staggering. Oh, they really are.
13:44Let's start with the standard 1400000 variant subset that most researchers have been limited to. Previously, just storing the LD Matrix for that required gigabytes of hard drive space. Lots of space. With the new VIPRS methodology, that dropped to about 300 megabytes.
14:01That is a 54 fold reduction in space. Here's where it gets really interesting. A 300 megabyte file is practically nothing in today's digital world. I mean, an LD matrix used to be something that required a physical hard drive to be bubble wrapped and shipped in the mail between research institutions.
14:17Yeah, snail mail for data. And you could literally send it over Slack or as a quick email attachment. That fundamentally alters the speed at which global scientists can collaborate. And it alters the speed of the computation itself.
14:31On a data set of 1100000 variants, the new VIPRS tool runs the entire risk score analysis in under a minute, using less than one gigabyte of RAM. Under a minute. Yeah. That is an 80-fold speedup over competing state-of-the-art tools like LDPred 2, which can take hours and 10s of gigabytes of memory to do the exact same task.
14:52You mentioned it runs a variational Besian regression in under a minute. For those of us who don't dream in advanced statistics. What is that regression actually doing so fast? Variational Besian regression is essentially an algorithm that continuously updates its own beliefs.
15:08Its beliefs. Right. It starts with an initial guess about how much each genetic variant contributes to a disease. As it processes more and more data from the matrix. It continually refines those guesses, tweaking the weights over and over again until it converges on the most highly probable answer.
15:24Doing that 1000000s of times usually takes hours. The IPRS does it in under 60 seconds. But they didn't stop at 1000000 variants. The whole point was to break the glass ceiling, right? They wanted to do the ultimate stress test.
15:36So they took the Pan UK biobank data set, which is one of the most comprehensive genomic resources on the planet. And they looked at 75 continuous phenotypes. And just to clarify for the listener, when we say phenotypes, we are talking about real-world observable traits, right?
15:52Correct. These are traits you can actively measure, like a person standing height, their blood pressure, their cholesterol levels, or various anthropometric measures. So they looked at 75 of those traits, and they scaled the model all the way up to the full 18000000 variants.
16:05This is the exact scenario that used to crash the supercomputers. This is the ultra high dimensional space where older systems would simply fail, but VIPRS processed the 18000000 variants across those 75 different traits in under 40 minutes per run.
16:21And it did this using less than 15 gigabytes of RAM. Less than 15 gigs of RAM. My laptop sitting right here on the desk has 16 gigs of RAM. We have literally gone from needing a multimillion dollar high-performance computing cluster in a server room to being able to run whole genome inference on a consumer grade laptop you can buy at a retail store.
16:41It is a paradigm shift in accessibility. And to achieve that speed, They didn't just rely on the compression. They also optimized how the computer processor handles the tasks. They utilize something called open MP threads.
16:54Which is a form of parallel processing. Yes. Instead of forcing the computer processor to calculate one variant, finish it, and then move to the next one in a single file line, open MP threads, tell the processors multiple cores to divide and conquer.
17:07So they work at the same time. Exactly. Different processor cores could be working on chromosome one and chromosome 2 at the exact same time. The synergy between the czar data chunking and the parallelized algorithm is what makes it blisteringly fast.
17:20So they achieved the impossible computational feat. But this deep dive doesn't end there because they actually wanted to see if analyzing 18000000 variants made a difference in the real world. Yeah, the real test They conducted a cross biobank validation.
17:35They trained the genetic models on the UK biobank data, and then tested them on a completely different data set, specifically the cartigene cohort over in Quebec, Canada. Because it is one thing to have a model perform flawlessly on the exact data it was trained on.
17:51The true test of a polygenic risk score in clinical medicine is transferability. Can a score generated primarily from British samples accurately predict the traits of French Canadian samples and ocean away.
18:03And the results were surprisingly nuanced. I think if you ask anyone, when you jump from analyzing 1000000 variants to a massive 180000 variant betaset, you would expect a massive leap in predictive accuracy.
18:16The more data, the better the prediction. Yeah, think so. But that isn't what happened. No, the massive leap didn't materialize. For the European descended samples in the cartigene cohort, utilizing 18 million dense variants only improved the predictive accuracy by a marginal 3% to 5% compared to just using the standard 1000000 variant subset.
18:36So what does this all mean? Let me play devil's advocate here. We built this incredibly complex, ultra fast, highly compressed computational pipeline to process 18000000 variants, just to find out that the 1000000 variants we were already using gave us 95% of the answer anyway.
18:53Did we just build a super highway for a bicycle? If we connect this to the bigger picture, the answer is a definitive no. It is incredibly valuable that we discovered that 1000000 variants capture most of the common genetic architecture for populations of European descent.
19:07Okay. But we only know that for sure because we now have the computational ability to actually test the 18000000 variants. Before this tool existed, it was just an educated guess based entirely on hardware limitations.
19:18We had hit a computational glass ceiling, and we didn't know what was above it. Ah, so we had to build a superhighway just to see what the traffic actually looked like. Precisely. And more importantly, while a 3% to 5% improvement might seem like a rounding error in a broad statistical paper in a clinical setting, that margin is vital.
19:35How so? Well, that 5% can be the deciding difference between correctly stratifying a patient into a high risk category for cardiovascular disease or missing it entirely and sending them home without preventative care.
19:47That is a really crucial point. A small percentage across a population of 1000000s is a lot of saved lives. Absolutely. But the real structural value of this breakthrough lies in what it allows us to do next.
19:59The older 1000000 variant models, specifically the widely used hat map 3 sets, were heavily optimized for common variants in populations of European descent. Which, as we know, has been a massive historical limitation in genomics.
20:12Most of the data we have heavily leans toward European ancestries. Exactly. When you expand the capacity to 18 million variants, you finally open the door to capturing rare genetic variants that don't show up in those limited data sets.
20:26You open the door to analyzing diverse non-European ancestries where the genetic architecture and linkage dis-equilibrium patterns look completely different from the UK biobank. And the old systems couldn't handle that.
20:39The old algorithm simply could not scale to encompass that global diversity without crashing the supercomputers. So by shrinking the data footprint and fixing the mathematical bottomless pits, we aren't just making the code run faster.
20:52We are making the science inherently more capable of being inclusive. That is the crux of it. Furthermore, because the computational burden is so low now, researchers can start integrating more complex biological priors into the algorithms.
21:06What do you mean by biological priors? These are functional annotations. Basically, instead of the algorithm just looking at raw numbers, we can feed it prior knowledge about what specific regions of the genome actually do biologically.
21:17Like giving it some context. Yeah. We can say, hey, this variant is in a region that regulates immune cells, so weigh it differently. You couldn't add that layer of biological complexity before because the system would grind to a halt.
21:30Now you can. The researchers proved that the limiting factor in personalized medicine is no longer the raw scale of the linkage to equilibrium matrix. They solved the math problem, they solved the storage problem, the computational bottleneck has been cleared.
21:45Which means the next generation of polygenic risk scoring won't be constrained by how much RAM we have, but by how well we can understand the actual biology of the variants themselves. It shifts the focus entirely from computer science back to human biology.
21:59By completely reimagining how we store and process genetic correlations, researchers have shrunk massive genomic bottlenecks down to size, democratizing who can perform cutting edge polygenic risk scoring.
22:11What does this mean for personalized medicine when any local clinic could potentially run these massive genomic models right on their own desktop computers? It's a whole new world This episode was based on an open access article under the CCBY 4.0 license.
22:27You can find a direct link to the paper and the license in our episode description. If you enjoyed this, follow or subscribe in your podcast app and leave a 5 star rating. If you'd like to support our work, use the donation link in the description.
22:39Now stay with us for an original track created, especially for this episode, and inspired by the article you've just heard about. Thanks for listening, and join us next time as we explore more science based by base.