[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,85 +2,252 @@
|
||||
id: wiki-2026-0508-evolutionary-biology
|
||||
title: Evolutionary Biology
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AI-EVO-BIO]
|
||||
aliases: [evolution, natural selection, modern synthesis, evo-devo, neutral theory, evolutionary algorithms]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.97
|
||||
tags: [Biology, Evolution, Science, Darwinism]
|
||||
confidence_score: 0.96
|
||||
verification_status: applied
|
||||
tags: [biology, evolution, natural-selection, evo-devo, ga, neuroevolution, ml-bio]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: Python / Bio
|
||||
framework: scikit-bio / DEAP / NEAT / AlphaFold
|
||||
---
|
||||
|
||||
# [[Evolutionary Biology|Evolutionary Biology]] (진화 생물학)
|
||||
# Evolutionary Biology
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "모든 생명체의 현 상태에 대한 '왜?'라는 질문에 답하는 역사적 알고리즘." 생물 집단의 유전적 조성이 세대를 거치며 변화하는 과정과 그 메커니즘을 탐구하여 생명의 다양성을 이해하는 학문이다.
|
||||
## 매 한 줄
|
||||
> **"매 mutation + selection + drift + gene flow 의 의 의 species 의 변화"**. Darwin Origin (1859), modern synthesis (Dobzhansky-Mayr-Simpson), Kimura neutral. 매 modern: 매 genomics + AlphaFold + evolutionary algorithms.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **Natural Selection (자연선택)**: 적응도가 높은 유전자가 다음 세대로 전달될 확률이 높음.
|
||||
- **Genetic Drift (유전적 부동)**: 우연한 사건에 의해 집단의 유전자 빈도가 변하는 현상.
|
||||
- **Speciation (종 분화)**: 지리적 격리나 생식적 격리로 인해 새로운 종이 탄생하는 과정.
|
||||
- **Common Ancestry**: 지구상의 모든 생명이 하나의 공통 조상에서 비롯되었다는 통합적 관점.
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- 다윈의 고전적 진화론은 '점진론(Phyletic Gradualism)'을 강조했으나, 실제 화석 기록에서는 급격한 변화와 정체기가 반복되는 '단속평형설(Punctuated Equilibrium)'이 관찰되기도 한다. 또한 현대 진화론은 '후성유전학(Epigenetics)'을 받아들여, DNA 서열 변화 없이도 획득 형질이 발현될 수 있는 메커니즘을 탐구하며 폭을 넓히고 있다.
|
||||
### 매 mechanism
|
||||
- **Mutation**: 매 random change.
|
||||
- **Natural selection**: 매 fitness-based.
|
||||
- **Genetic drift**: 매 chance.
|
||||
- **Gene flow**: 매 migration.
|
||||
- **Recombination**.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- Related: Genetics-Foundations , Phylogenetic-Tree
|
||||
- Algorithm: [[Evolutionary-Computation|Evolutionary-Computation]]
|
||||
### 매 modern synthesis
|
||||
- **Hardy-Weinberg**: 매 baseline.
|
||||
- **Population genetics**.
|
||||
- **Neutral theory** (Kimura).
|
||||
- **Coalescent theory**.
|
||||
- **Evo-devo**: 매 development.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 응용 (CS / AI)
|
||||
1. **GA (genetic algorithm)**.
|
||||
2. **NEAT** (neuroevolution).
|
||||
3. **Evolutionary strategy** (ES, OpenAI).
|
||||
4. **Quality-diversity** (MAP-Elites).
|
||||
5. **Open-ended** (POET).
|
||||
6. **AlphaFold** (evolution-informed protein).
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
### 매 응용 (bio)
|
||||
1. **Phylogenetics**: 매 tree.
|
||||
2. **Antibiotic resistance**.
|
||||
3. **Cancer evolution**.
|
||||
4. **Crop breeding**.
|
||||
5. **Conservation**.
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
## 💻 패턴
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
### Hardy-Weinberg
|
||||
```python
|
||||
def hardy_weinberg(p):
|
||||
"""매 allele freq p, q=1-p."""
|
||||
q = 1 - p
|
||||
return {'AA': p**2, 'Aa': 2*p*q, 'aa': q**2}
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### Wright-Fisher (drift)
|
||||
```python
|
||||
import numpy as np
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
def wright_fisher(N, p_init, generations=1000):
|
||||
p = p_init
|
||||
history = [p]
|
||||
for _ in range(generations):
|
||||
n_A = np.random.binomial(2*N, p)
|
||||
p = n_A / (2*N)
|
||||
history.append(p)
|
||||
if p == 0 or p == 1: break
|
||||
return history
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### Coalescent simulation
|
||||
```python
|
||||
def coalescent(n=10):
|
||||
"""매 generate random gene tree."""
|
||||
times = []
|
||||
while n > 1:
|
||||
t = np.random.exponential(2 / (n * (n - 1)))
|
||||
times.append(t)
|
||||
n -= 1
|
||||
return times
|
||||
```
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### Genetic algorithm (DEAP)
|
||||
```python
|
||||
from deap import base, creator, tools, algorithms
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
creator.create('FitnessMax', base.Fitness, weights=(1.0,))
|
||||
creator.create('Individual', list, fitness=creator.FitnessMax)
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
toolbox = base.Toolbox()
|
||||
toolbox.register('attr', np.random.rand)
|
||||
toolbox.register('individual', tools.initRepeat, creator.Individual, toolbox.attr, n=10)
|
||||
toolbox.register('population', tools.initRepeat, list, toolbox.individual)
|
||||
toolbox.register('evaluate', lambda ind: (sum(ind),))
|
||||
toolbox.register('mate', tools.cxBlend, alpha=0.5)
|
||||
toolbox.register('mutate', tools.mutGaussian, mu=0, sigma=0.1, indpb=0.1)
|
||||
toolbox.register('select', tools.selTournament, tournsize=3)
|
||||
|
||||
pop = toolbox.population(n=100)
|
||||
pop, log = algorithms.eaSimple(pop, toolbox, cxpb=0.7, mutpb=0.2, ngen=50)
|
||||
```
|
||||
|
||||
### NEAT (neuroevolution)
|
||||
```python
|
||||
import neat
|
||||
|
||||
def eval_genome(genome, config):
|
||||
net = neat.nn.FeedForwardNetwork.create(genome, config)
|
||||
fitness = 0
|
||||
for input_, expected in TRAINING_DATA:
|
||||
output = net.activate(input_)
|
||||
fitness += -(output[0] - expected) ** 2
|
||||
return fitness
|
||||
|
||||
config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction, neat.DefaultSpeciesSet, neat.DefaultStagnation, 'config-feedforward')
|
||||
pop = neat.Population(config)
|
||||
winner = pop.run(eval_genomes, 50)
|
||||
```
|
||||
|
||||
### Evolutionary Strategy (ES, OpenAI)
|
||||
```python
|
||||
def evolution_strategy(theta, fn, sigma=0.1, lr=0.01, n_pop=50):
|
||||
eps = np.random.randn(n_pop, len(theta))
|
||||
rewards = [fn(theta + sigma * e) for e in eps]
|
||||
rewards = (np.array(rewards) - np.mean(rewards)) / (np.std(rewards) + 1e-9)
|
||||
grad = (eps.T @ rewards) / (n_pop * sigma)
|
||||
return theta + lr * grad
|
||||
```
|
||||
|
||||
### Phylogenetic tree (Bio.Phylo)
|
||||
```python
|
||||
from Bio import Phylo, SeqIO
|
||||
from Bio.Phylo.TreeConstruction import DistanceCalculator, DistanceTreeConstructor
|
||||
|
||||
aln = AlignIO.read('seqs.fasta', 'fasta')
|
||||
calc = DistanceCalculator('identity')
|
||||
dm = calc.get_distance(aln)
|
||||
tree = DistanceTreeConstructor().nj(dm)
|
||||
Phylo.draw(tree)
|
||||
```
|
||||
|
||||
### Selection pressure (dN/dS)
|
||||
```python
|
||||
def dn_ds(synonymous, nonsynonymous, sites_s, sites_n):
|
||||
"""매 ω = (Nd/Ns) / (Sd/Ss)."""
|
||||
pn = nonsynonymous / sites_n
|
||||
ps = synonymous / sites_s
|
||||
if ps == 0: return float('inf')
|
||||
return pn / ps # 매 > 1 = positive, < 1 = purifying, ≈ 1 = neutral
|
||||
```
|
||||
|
||||
### Coevolution (predator-prey GA)
|
||||
```python
|
||||
def coevolution_step(predators, prey, eval_battle):
|
||||
new_pred = []
|
||||
for p in predators:
|
||||
opponent = random.choice(prey)
|
||||
fitness = eval_battle(p, opponent, role='predator')
|
||||
p.fitness = fitness
|
||||
new_pred.append(p)
|
||||
# 매 selection + reproduction
|
||||
return select_top_k(new_pred, k=len(predators) // 2) * 2
|
||||
```
|
||||
|
||||
### MAP-Elites (quality-diversity)
|
||||
```python
|
||||
def map_elites(behavior_dim, eval_fn, n_iter=10000):
|
||||
archive = {} # 매 behavior → genome
|
||||
for _ in range(n_iter):
|
||||
if archive: parent = random.choice(list(archive.values()))
|
||||
else: parent = random_genome()
|
||||
child = mutate(parent)
|
||||
behavior, fitness = eval_fn(child)
|
||||
cell = discretize(behavior, behavior_dim)
|
||||
if cell not in archive or fitness > archive[cell].fitness:
|
||||
archive[cell] = child
|
||||
return archive
|
||||
```
|
||||
|
||||
### Antibiotic resistance simulation
|
||||
```python
|
||||
def resistance_evolution(N, mut_rate, antibiotic_pressure, generations):
|
||||
p_resistant = 1e-7
|
||||
for _ in range(generations):
|
||||
# 매 mutation
|
||||
p_resistant += mut_rate * (1 - p_resistant)
|
||||
# 매 selection (resistant 의 advantage during antibiotic)
|
||||
if antibiotic_pressure:
|
||||
p_resistant = p_resistant / (p_resistant + (1 - p_resistant) * 0.01)
|
||||
return p_resistant
|
||||
```
|
||||
|
||||
### AlphaFold (evolution-informed)
|
||||
```python
|
||||
# 매 MSA (multiple sequence alignment) → 매 contact → 매 structure
|
||||
# 매 evolutionary co-variation 의 contact 의 hint
|
||||
def msa_to_contacts(msa):
|
||||
"""매 simplified Direct Coupling Analysis."""
|
||||
cov = compute_residue_covariance(msa)
|
||||
return cov # 매 high covariation = likely contact
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Optimization | GA / ES |
|
||||
| Neural arch search | NEAT / ES |
|
||||
| Diversity | MAP-Elites |
|
||||
| Open-ended | POET / coevolution |
|
||||
| Phylogenetics | NJ / ML / Bayesian |
|
||||
| Cancer | Clonal evolution |
|
||||
| Drug resistance | Population dynamics |
|
||||
|
||||
**기본값**: 매 GA / ES for optimization + 매 MAP-Elites for diversity + 매 phylogenetics for bio + 매 evolution-informed ML.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Biology]] · [[Population-Genetics]]
|
||||
- 변형: [[Genetic-Algorithm]] · [[Neuroevolution]] · [[Evolutionary-Strategy]]
|
||||
- 응용: [[NEAT]] · [[MAP-Elites]] · [[Phylogenetics]] · [[AlphaFold]]
|
||||
- Adjacent: [[Computational-Creativity]] · [[Open-Ended]] · [[Quality-Diversity]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 optimization. 매 architecture search. 매 phylogenetics. 매 protein.
|
||||
**언제 X**: 매 differentiable + gradient available.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **GA where gradient works**: 매 sample-inefficient.
|
||||
- **No diversity**: 매 premature convergence.
|
||||
- **Tiny population**: 매 drift dominate.
|
||||
- **No fitness shaping**: 매 sparse reward fail.
|
||||
- **Ignore neutral theory**: 매 selection 의 over-attribute.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Darwin, Kimura, Salimans ES 2017, Stanley NEAT, Mouret MAP-Elites).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-04-20 | Auto-reinforced |
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — HW / WF / GA / NEAT / ES / MAP-Elites / phylo code |
|
||||
|
||||
Reference in New Issue
Block a user