NelworksNelworks

Finance / Season 2 / EP08

How Quants Search for New Drugs

Shez

This is Science. Real Science.

Shez

Quants deal with money. Abstract numbers. They are just degen gamblers!

Kurumi

...this again?

Shez

Here, we deal with physical reality. You can't 'Arbitrage' a virus. You can't 'Short Sell' a protein.

Kurumi

You know there are 10,000 molecules in that tray you're holding, right?

Shez

I know! It's going to take me all week! But this is Drug Discovery. We have to test every chemical to see if it binds to the protein. It's brute force science!

Kurumi

Ah, the Search Space Problem. If only quants had already figured out how to trade 10,000 different stocks in a day. Let's talk about QSAR.

Shez

Q-SAR? Quantitative Structure-Activity Relationship. It's just a regression, right? Y = mX + b?

Kurumi

Fundamentally, yes.

Kurumi

X is the molecule. Y is the potency - IC50, the dose that kills half the virus.

Kurumi

There are 10^60 drug-like molecules. Not enough atoms in the universe to test them.

Kurumi

QSAR is a filter. It creates a 'Shortlist.'

Kurumi

I can test 1 billion molecules inside the GPU in an hour.

Kurumi

The model predicts the 'Profit' (Biological Activity) for each molecule. We throw away the losers and physically test only the top 10 winners.

Shez

Fine, a quant model can screen for molecules. But how does it predict its 'Profit'? A molecule is a 3D Shape. It has geometry. Bonds. Angles!

Shez

A computer model takes Vectors. Lists of numbers. How do you turn a drawing into a spreadsheet without losing the soul of the molecule?

Kurumi

We Vectorize it.

Kurumi

We create a Molecular Fingerprint.

Kurumi

Imagine standing on this Nitrogen atom. Look at your neighbors.

Kurumi

Radius 0: 'I am Nitrogen.'

Kurumi

Radius 1: 'I am attached to Carbon and Carbon.'

Kurumi

Radius 2: 'I see a Double Bond Oxygen.'

Kurumi

We take these fragments—these local environments—and we Hash them.

Shez

I-It now looks like machine code?

Kurumi

It is an ECFP (Extended Connectivity Fingerprint).

Shez

So... what does 'Column 42' mean?

Kurumi

Column 42 might correspond to 'A Benzene Ring attached to a Nitrogen.'

Kurumi

If the molecule has that feature, the bit is 1. If not, it is 0.

Shez

W-wait... It's a Bag of Words. Like in NLP used by quants to screen for earnings transcripts!

Kurumi

Exactly. 'Benzene' is a word. The molecule is a sentence.

Kurumi

We turned chemistry into a language problem.

Shez

Okay, so that handles the structure. We have binary features. Yes/No.

Shez

But stocks have continuous features. 'P/E Ratio' isn't a Yes/No. 'Volatility' is a float.

Shez

How would quant's math for continuous variables work for biology?

Kurumi

Of course. The fingerprint is just the shape.

Kurumi

We also append Physicochemical Descriptors like 'LogP' (Lipophilicity), 'PSA' (Polar Surface Area), and 'Molecular Weight'. These are your floats.

Shez

LogP? PSA?

Kurumi

LogP. It measures Lipophilicity. How much does the drug love fat vs. water?

Kurumi

High LogP = Loves Oil. Low LogP = Loves Water.

Shez

Why does that matter?

Kurumi

To get into a cell, the drug must cross the membrane (Oil).

Kurumi

If LogP is too low (loves water), it bounces off. It stays in the blood.

Kurumi

If LogP is too high (loves oil), it gets stuck in the fat and never leaves.

Kurumi

Next is PSA – Polar Surface Area. It measures the 'water-loving' regions on the molecule: the parts that can form hydrogen bonds.

Shez

So, if LogP is about oil vs water, PSA is about… interaction with water?

Kurumi

Yes, PSA tells us if the molecule can slip through membranes or gets blocked because it loves water too much.

Kurumi

And then: Molecular Weight. Too small, and it might get flushed out before it works. Too large, and it might never get in.

Shez

So for a drug to work, all three dials have to be set 'just right'?

Kurumi

Exactly. Too much or too little of any one—and the molecule fails as a medicine.

Kurumi

Because LogP, PSA, and Molecular Weight are continuous, we can use algorithms like GMM or UMAP.

Shez

To do what?

Kurumi

To find the Safe Space.

Kurumi

We cluster known drugs. We see a dense cloud in the middle.

Kurumi

This cloud is 'Druglike.' If your new molecule falls outside this cloud (e.g., LogP > 7), the model flags it as 'High Risk.'

Shez

W-Wait, that's the same as how quants group similar stocks and risk by class!

Kurumi

Yup. Stocks have Volatility, Liquidity, and Beta. Molecules have LogP, Molecular Weight, and Activity. They can fit into Optimization Curves and be grouped into classes using GMM and dimensionally reduced by UMAP.

Shez

But that's just statistics. You stay in the herd to be safe.

Shez

In chemistry, two things might look exactly the same, but one kills you.

Shez

every step so far has been the same size. Same ground, same everything, nothing's changed—

Kurumi

And the next one is identical to the last. That is exactly what makes it a cliff.

Kurumi

What you just described is the Activity Cliff.

Kurumi

Take these two molecules: Propylene glycol (CH₃CHCH₂OH) and Ethylene glycol ((CH₂OH)₂).

Kurumi

Propylene glycol. One extra methyl group. You can eat it.

Shez

...and the other one?

Kurumi

Ethylene glycol. Sweet, colourless, and it shuts your kidneys down while you sleep.

Kurumi

Both molecules have a Tanimoto similarity > 0.9. Most fingerprints call them neighbors.

Kurumi

But the liver doesn't see fingerprints. It sees chemistry.

Kurumi

A Linear Model (Y = wX) will assume smoothness. 'Small change in X = Small change in Y.'

Kurumi

It will predict Molecule B is 'Mostly Safe.'

Shez

Then the model's prediction accidentally kills the patient!

Kurumi

This is why we use Non-Linear Models. Random Forests. Deep Neural Networks.

Kurumi

A Tree can learn a hard cut.

Kurumi

Rule: IF (Similarity > 0.9) AND (Has_Methyl_Group == True) THEN TOXIC.

Kurumi

It can memorize the exception and map the Cliff.

Kurumi

The same Non-Linear Models idea was used by quants to model financial events like circuit breakers, stop losses, and margin calls.

Kurumi

In both industries, before we even make any profit for ourselves, we must first try to not kill our customers.

Shez

Okay. So we need complex models for complex physics.

Shez

But how do we actually run this? What does a 'Trading Day' look like for a biologist?

Kurumi

In finance, we have a universe of 3,000 stocks. In pharma, we have a universe of 1 billion molecules.

Kurumi

In both industries, we reduce the universe down to a manageable size.

Kurumi

Then, we simulate our truncated universe to find the best strategy or candidates.

Shez

What is Molecular Docking? Is it like a boat?

Kurumi

It's a Physics Engine.

Kurumi

We take the 3D model of the drug and try to jam it into the 3D model of the protein.

Kurumi

The simulation calculates binding energy (ΔG) - how tightly it sticks.

Kurumi

It rotates the key, twists it, vibrates it. 'Does it fit? Is it stable?'

Shez

This looks computationally expensive.

Kurumi

It is. It takes minutes per molecule. That's why we only Dock the survivors of the QSAR filter.

Kurumi

In both industries, we execute the best strategy or candidates.

Shez

So... each of these tube is like a trading strategy to validate?

Kurumi

Yes. The model gives you the Top 10 candidates. Now you test them in the real world.

Shez

If the model is good... one of these 10 should work?

Kurumi

Even if the Hit Rate is only 10%... that's 1 success in 10 tries. Compare that to your random guessing: 1 success in 10,000 tries.

Kurumi

Even if your patient hasn't got killed by the disease, they would have died from old age.

Shez

You increased my leverage by 1,000x.

Kurumi

I just improved your Sharpe Ratio. High Return (Effective Drug) / Low Risk (Wasted Lab Time)

Shez

import rdkit. import deepchem.

Shez

I'm downloading the ZINC database.

Shez

I could use this quant idea to run a High-Throughput Screening! I can test 100,000 molecules in a day!

Kurumi

Why do you think Renaissance Technologies (the best hedge fund) hires physicists and biologists instead of FinBros?

Shez

Because they know science?

Kurumi

Because filtering a stock trend from market noise is mathematically identical to finding a drug candidate in a chemical library.

Shez

Wait... if I discover a drug using code... can I patent it?

Kurumi

That's a legal question. But you can definitely trade the biotech stock before you publish the paper.

Shez

HAHAHA now THAT is a Quant move. I could get rich before my drug even gets approved.

Kurumi

Sharpe catch. That is Insider Trading. See you in court.

Shez

Well, that's a tail risk event I must hedge.