返回顶部
r

rice-phenotype-prediction 水稻表型预测

>-

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
96
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

rice-phenotype-prediction

水稻表型预测

通过预训练的MMoE模型预测10个水稻农艺性状的独立技能。
所有模型、数据和脚本均在此目录内——直接提供给用户此文件夹。

环境配置

首次检查

bash python DIR>/scripts/checkenv.py

此命令验证Python依赖项和数据完整性。如果缺少依赖包:
bash
pip install -r /requirements.txt

必需依赖:torch>=2.0 numpy pandas scikit-learn scipy requests
GPU为可选——CPU也可运行(仅速度较慢)。如果存在GPU,将自动使用cuda:0。

约定

在整个文件中, 表示此技能根目录的绝对路径(即包含此SKILL.md的文件夹)。运行命令时,请替换为实际路径。
--base_dir 为可选参数;如果省略,脚本将从自身位置自动检测。

支持性状

代码中文英文单位
HD抽穗期Heading Date
PH
株高 | Plant Height | 厘米 | | PL | 穗长 | Panicle Length | 厘米 | | TN | 分蘖数 | Tiller Number | 个 | | GP | 每穗粒数 | Grains Per Panicle | 粒 | | SSR | 结实率 | Seed Setting Rate | % | | TGW | 千粒重 | Thousand Grain Weight | 克 | | GL | 粒长 | Grain Length | 毫米 | | GW | 粒宽 | Grain Width | 毫米 | | Y | 产量 | Yield | 千克/公顷 |

支持地点(7个内置站点)

代码城市纬度经度
km昆明25.02102.68
gzl
六盘水 | 26.59 | 104.83 | | nn | 南宁 | 22.82 | 108.37 | | wh | 武汉 | 30.58 | 114.27 | | hf | 合肥 | 31.82 | 117.25 | | hz | 杭州 | 30.25 | 120.17 | | th | 通化 | 41.73 | 125.94 |

任何输入的经纬度将通过哈弗辛距离自动匹配到最近站点。
对于有网络的地区,还可以通过NASA POWER API获取精确坐标的每日天气数据。

胁迫类型

类型中文默认效果
hightemp高温胁迫最高温+3°C / 最低温+2°C
lowtemp
低温胁迫 | 最高温-3°C / 最低温-2°C | | drought | 干旱胁迫 | 降水量减少90% | | flood | 涝害胁迫 | 降水量增加3倍 | | low_light | 寡照胁迫 | 光合有效辐射减少60% |

预测命令

完整预测(推荐)

bash python /scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1

仅基因型/仅环境

bash python /scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1 --mode gene python /scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1 --mode env

特定性状

bash python /scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1 --trait PH,Y

带胁迫

bash python DIR>/scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1 --stress hightemp python DIR>/scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1 --stress hightemp --stress_delta 5.0

多个样本

bash python /scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1,sample2,sample3

自定义基因型文件

bash python DIR>/scripts/predict.py --lat 30.5 --lon 114.3 --genotypefile /path/to/user_vae.csv

格式:包含1024列(VAE编码特征)的CSV文件,第一列为样本索引。

强制使用CPU/指定设备

bash python /scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1 --device cpu python /scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1 --device cuda:0

人类可读表格

bash python /scripts/predict.py --lat 30.5 --lon 114.3 --sample sample1 --output table

所有CLI参数
参数默认值描述
--lat必需纬度
--lon
必需 | 经度 |

| --sample | 无 | 内置样本ID,逗号分隔(sample1..sample3925) | | --genotype_file | 无 | 自定义1024维VAE CSV文件路径 | | --mode | full | gene、env或full | | --trait | all | 逗号分隔的性状代码或all | | --stress | 无 | 胁迫类型名称 | | --stress_delta | 无 | 覆盖温度变化量 | | --device | auto | auto、cpu或cuda:0 | | --year | 2024 | 环境数据年份 | | --output | json | json或table | | --base_dir | auto | 覆盖技能目录路径 |

处理用户请求

1. 提取地点

  • - 经纬度30.5, 114.3 → --lat 30.5 --lon 114.3
  • 武汉 → --lat 30.58 --lon 114.27
  • 北纬25度,东经103度 → --lat 25 --lon 103

2. 映射性状名称

  • - 株高/plant height → PH
  • 产量/yield → Y
  • 粒长/grain length → GL
  • 抽穗期/heading date → HD
  • 千粒重/1000-grain weight → TGW
  • 穗长/panicle length → PL
  • 结实率/seed setting rate → SSR
  • 每穗粒数/grains per panicle → GP
  • 粒宽/grain width → GW
  • 分蘖数/tiller number → TN

3. 映射胁迫请求

  • - 高温/heat → hightemp
  • 低温/cold/chilling → lowtemp
  • 干旱/drought → drought
  • 洪涝/flooding → flood
  • 阴天/寡照/low light → lowlight
  • 高温+5度 → --stress hightemp --stress_delta 5.0

4. 基因型数据

  • - 内置样本:--sample sample1(共3925个:sample1..sample3925)
  • 用户文件:--genotype_file /path/to/file.csv

5. 解读输出

JSON包含:location(地点)、genotypeprediction(基因型预测)、environmentprediction(环境预测)、stressprediction(胁迫预测)、traitinfo(性状信息)。

以environment_prediction为主要结果(包含环境背景)。
将genotype_prediction作为基线进行比较。
对于胁迫情况,比较正常值与胁迫值。

四舍五入规则:HD/TN/GP → 整数,PH/PL/TGW/SSR → 1位小数,GL/GW → 2位小数,Y → 整数。

目录结构

rice_prediction/ ← 提供给用户此文件夹
├── SKILL.md ← 本文件
├── requirements.txt ← pip依赖项
├── data/
│ ├── grid_points.json ← 7个站点坐标
│ ├── vae_features.csv ← 3925个内置基因型样本(1024维VAE)
│ ├── season_history.csv ← 历史季节数据(用于归一化)
│ ├── env_cache/ ← 缓存的每日天气数据(自动填充)
│ ├── models_env/ ← 10个性状特定的环境+基因型模型(每个约4.6MB)

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 gain-1775937197 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 gain-1775937197 技能

通过命令行安装

skillhub install gain-1775937197

下载

⬇ 下载 rice-phenotype-prediction v1.0.1(免费)

文件大小: 133.64 KB | 发布时间: 2026-4-12 10:03

v1.0.1 最新 2026-4-12 10:03
Add README.md with full usage guide in Chinese and English

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部