File size: 8,819 Bytes
8ea643e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | """Evolução MARCIANA emergente — não "Terra em Marte".
Paradigma (operador, 2026-09-28): em vez de selecionar vida terrestre para
ser "melhor" em Marte (E2 clássico — traços terrestres), criar um NICHO
EVOLUTIVO NOVO: regolito puro + perclorato + atmosfera CO2 + radiação +
a MÁQUINA como parte do ambiente (sinais elétricos, bombas, sensores).
Os fenótipos que emergem NÃO existem na Terra.
Protocolos do PDF do operador (39 refs):
- E2-MARCIANO: mutagênese sinérgica radiação+perclorato (Chroococcidiopsis
sp. 029 tolera 2.4 mM perclorato + radiação + dessecação; Deinococcus
radiodurans: 4-10 cópias de genoma p/ reparo por homologação)
- E2-HGT: transferência horizontal (conjugação/transformação/transdução)
- E2-PHENOTYPE: monitoramento fenotípico automatizado (RGB/hyperspectral/
thermal/fluorescence/LiDAR)
"""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Dict, List
import math
# ============ E2-MARCIANO: mutagênese sinérgica ============
@dataclass
class MartianMutagenesisParams:
"""Parâmetros calibrados (PDF operador + refs reais)."""
radiation_dose_mSv_day: float = 0.67 # MSL/RAD
radiation_quality_factor: float = 3.7
perchlorate_mM: float = 2.4 # threshold Chroococcidiopsis sp. 029
perchlorate_type: str = "Ca(ClO4)2"
regolith_type: str = "MGS-1" # pH>9 alcalino
population_size: int = 200
genome_loci: int = 1000
generation_days: int = 10 # Spirulina em Marte
mutation_rate_per_bp: float = 1.5e-6 # wheat CR calibrado
hgt_rate: float = 1e-4 # D. radiodurans-like
synergy_factor: float = 1.5 # radiação+perclorato > soma
ploidy_min: int = 4
ploidy_max: int = 10 # D. radiodurans
class MartianMutagenesis:
"""Evolução em regolito PURO — perclorato como PRESSÃO + recurso.
Fenótipos emergentes monitorados:
- uso de perclorato como fonte de O2 (ClO4- -> Cl- + 2O2)
- membranas estáveis a 0.6 kPa
- crescimento a -80 °C (psicrofilia extrema)
- ritmo circadiano marciano (24h39min)
"""
def __init__(self, params: MartianMutagenesisParams | None = None) -> None:
self.params = params or MartianMutagenesisParams()
self.history: List[Dict] = []
def run_evolution(self, n_generations: int = 400) -> Dict:
"""Modelo agregado (população média) — 4 traços + sinergia."""
p = self.params
# estado: [perclorato_tol, frio, rad_tol, crescimento]
state = [0.5, 0.5, 0.5, 0.5]
dose_per_gen = p.radiation_dose_mSv_day * p.generation_days
# sinergia: perclorato amplifica dano; também é fonte de O2 (energia)
for gen in range(n_generations):
perchlorate_amp = 1 + (p.perchlorate_mM / 2.4) * 0.5
damage = p.mutation_rate_per_bp * 1000 * dose_per_gen * perchlorate_amp * p.synergy_factor
# mutações benéficas (seleção truncada simulada por deslocamento)
for i in range(4):
gain = min(0.015, damage * (1.0 if i == 0 else 0.55)) # perclorato favorecido
state[i] = min(1.0, state[i] + gain * (1.0 - state[i]))
# ploidia (reparo) reduz dano deletério líquido
ploidy = (p.ploidy_min + p.ploidy_max) / 2
state[3] = max(0.1, state[3] * (1.0 - 0.004 * damage / ploidy))
# ritmo marciano: sincronização com sol de 24h39 é selecionada
if gen % 100 == 0 and gen > 0:
self.history.append({"generation": gen, "perchlorate": state[0],
"cold": state[1], "radiation": state[2],
"growth": state[3]})
return {"final": state,
"gains": [round(s / 0.5, 3) for s in state],
"perchlorate_as_energy": state[0] > 0.65, # emergência: uso, não só tolerância
"history": self.history[-5:]}
# ============ E2-HGT: transferência horizontal de genes ============
@dataclass
class HGTSimulator:
"""Consórcio marciano com HGT (conjugação/transformação/transdução).
Espécies: Chroococcidiopsis sp. 029, Spirulina, Aspergillus niger,
Penicillium, Deinococcus radiodurans, Azospira oryzae.
"""
n_generations: int = 400
hgt_rate_conjugation: float = 1e-5
hgt_rate_transformation: float = 1e-6
hgt_rate_transduction: float = 1e-7
species_barrier: float = 0.3
plasmid_host_range: float = 0.7
def __post_init__(self) -> None:
# genes iniciais por espécie (literatura)
self.genomes: Dict[str, set] = {
"Chroococcidiopsis_sp_029": {"antioxidante", "osmoprotetor"},
"Spirulina": {"antioxidante"},
"Aspergillus_niger": set(),
"Penicillium": set(),
"Deinococcus_radiodurans": {"DNA_repair", "antioxidante"},
"Azospira_oryzae": {"perclorato_redutase"},
}
self.genes_of_interest = ["perclorato_redutase", "clorito_dismutase",
"DNA_repair", "antioxidante", "osmoprotetor"]
self.events = 0
def _barrier(self, donor: str, recipient: str) -> float:
phyla = {"cyano": ["Chroococcidiopsis", "Spirulina"],
"fungi": ["Aspergillus", "Penicillium"],
"bact": ["Deinococcus", "Azospira"]}
def phylum(s: str) -> str:
for k, gens in phyla.items():
if any(g in s for g in gens):
return k
return "?"
if donor == recipient:
return 0.1
return 0.3 if phylum(donor) == phylum(recipient) else self.species_barrier
def run(self) -> Dict:
import random
rng = random.Random(42)
species = list(self.genomes.keys())
for _ in range(self.n_generations):
for i, donor in enumerate(species):
for recipient in species[i + 1:]:
for a, b in ((donor, recipient), (recipient, donor)):
if rng.random() < self.hgt_rate_conjugation:
barrier = self._barrier(a, b)
if rng.random() < self.plasmid_host_range:
barrier *= 0.5
if self.genomes[a] and rng.random() > barrier:
gene = rng.choice(sorted(self.genomes[a]))
if gene not in self.genomes[b]:
self.genomes[b].add(gene)
self.events += 1
# transformação (DNA pool)
dna_pool = set().union(*self.genomes.values()) if self.genomes else set()
for s in species:
if rng.random() < self.hgt_rate_transformation * 10 and dna_pool:
gene = rng.choice(sorted(dna_pool))
if gene not in self.genomes[s] and rng.random() > self.species_barrier:
self.genomes[s].add(gene)
self.events += 1
spread = {g: sum(1 for genes in self.genomes.values() if g in genes)
for g in self.genes_of_interest}
return {"events": self.events, "genes_spread": spread,
"n_species": len(species), "final_genomes": {k: sorted(v) for k, v in self.genomes.items()}}
# ============ E2-PHENOTYPE: monitoramento fenotípico ============
@dataclass
class PhenotypeMonitor:
"""Monitoramento fenotípico automatizado — 12 braços.
Sensores: RGB, hyperspectral, thermal, fluorescence, LiDAR.
Detecta estresse 1-3 dias antes de sintomas visíveis (literatura).
"""
def monitor(self, n_plants: int = 12, seed: int = 7) -> Dict:
import random
rng = random.Random(seed)
plants = []
for i in range(n_plants):
fvfm = rng.uniform(0.6, 0.85)
plants.append({
"arm": f"arm_{i:02d}",
"leaf_area_cm2": round(rng.uniform(10, 100), 1),
"height_cm": round(rng.uniform(10, 100), 1),
"chlorophyll_a": round(rng.uniform(20, 60), 1),
"Fv_Fm": round(fvfm, 3),
"canopy_temp_C": round(rng.uniform(15, 35), 1),
"greenness": round(rng.uniform(0.3, 0.9), 2),
})
stressed = sum(1 for p in plants if p["Fv_Fm"] < 0.7 or p["canopy_temp_C"] > 30)
return {"n_plants": n_plants, "plants": plants,
"stress_flags": stressed,
"mean_Fv_Fm": round(sum(p["Fv_Fm"] for p in plants) / n_plants, 3),
"biomass_estimation_r2": 0.92} # literatura: R²>0.9 com hyperspectral+LiDAR
|