Sign inSign up

coder02lq/geformer

By coder02lq

Updated 8 months ago

GEFormer environment

Image
0

271

coder02lq/geformer repository overview

GEFormer

1. Quick Start

1.1 Pull Docker Image
docker pull coder02lq/geformer:v1.1

Data Introduction

CVF File Examples

Cross-validation files for splitting training and validation sets.

First column: ID, Second column: CV

M1_CVF.csv 【Ten fold cross validation】

IDCV
ID17
ID22
ID31
ID45
ID59
ID68
ID77
ID85
ID98
ID106
ID1110
ID124
ID139
ID143
ID155

M2_CVF.csv 【K-fold cross validation (K=number of environments)】

IDCV
ID1_HeB1
ID2_HeB1
ID3_HeB1
ID4_HeB1
ID5_HeB1
ID6_HeB1
ID7_HeB1
ID8_HeB1
ID9_HeB1
ID10_HeB1
ID11_HeB1
ID12_HeB1
ID13_HeB1
ID14_HeB1
ID15_HeB1
ID1_LN2
ID2_LN2
ID3_LN2
ID4_LN2
ID5_LN2
ID6_LN2
ID7_LN2
ID8_LN2
ID9_LN2
ID10_LN2
ID11_LN2
ID12_LN2
ID13_LN2
ID14_LN2
ID15_LN2

M3_CVF.csv 【Ten*K fold cross validation (K=number of environments)】

IDCV
ID1_HeB7
ID2_HeB2
ID3_HeB1
ID4_HeB5
ID5_HeB9
ID6_HeB8
ID7_HeB7
ID8_HeB5
ID9_HeB8
ID10_HeB6
ID11_HeB10
ID12_HeB4
ID13_HeB9
ID14_HeB3
ID15_HeB5
ID1_LN7
ID2_LN2
ID3_LN1
ID4_LN5
ID5_LN9
ID6_LN8
ID7_LN7
ID8_LN5
ID9_LN8
ID10_LN6
ID11_LN10
ID12_LN4
ID13_LN9
ID14_LN3
ID15_LN5

Environment File Examples

Environmental data with fixed first two column names (env and date), followed by environmental factor data from the third column.

File Name:${envName}_env.csv

LN_env.csv

envdateDLGDDdGDDDTR
LN2014/5/1114.3716.14707.758
LN2014/5/1214.4078.4512.30417.712
LN2014/5/1314.44213.8965.44531.014
LN2014/5/1414.47710.8813.01524.444
LN2014/5/1514.51210.5840.29726.19
LN2014/5/1614.54512.5371.95329.358
LN2014/5/1714.57813.6351.09827.756
LN2014/5/1814.61117.8024.16725.524
LN2014/5/1914.64313.2484.55416.416

Genotype File Examples

Genotypic data with first column name: ID

geno.csv

IDSNP1SNP2SNP3SNP4SNP5SNP6SNP7SNP8SNP9SNP10
ID10000100100
ID20000000000
ID30000000000
ID40202220022
ID50000002200
ID60000000000
ID70000000000
ID80000000000
ID90000000000
ID100000101200
ID112000000000
ID120202220022
ID130000102200
ID142000000000
ID150020201100

Phenotype File Examples

Phenotypic data

File Name:${phenoName}_phe.csv

Column Name:${phenoName}_${envName}

PH_phe.csv

IDPH_LNPH_HeB
ID1241.13228.8
ID2204196.75
ID3207.4233.33
ID4230.5189.4
ID5200183.75
ID6230.5205.25
ID7211.6225
ID8228202.5
ID9248.2195
ID10204184.5
ID11205.4192.5
ID12193.86208
ID13239.6211
ID14221.2197.2
ID15161.8138.2

Parameter Introduction

Required Parameters

  • --geno_path // Path to genotype data file
  • --phe_folder // Folder containing phenotype data
  • --pheno_name // Phenotype name
  • --env_folder // Folder containing environment data
  • --env_name // Environment name required for M1 and M3 schemes
  • --cvf_folder // Folder for training/validation set configuration
  • --scheme // Choose M1/M2/M3 scheme
  • --device // Which GPU to use
  • --need_optuna // Whether to enable hyperparameter optimization

Hyperparameters

When --need_optuna is True: Automatically optimize combinations of the following hyperparameters within specified ranges

When --need_optuna is False: Use default parameters or specify the following parameters

Basic Parameters
  • --batch // Batch size (default: 64)
  • --dropout // Dropout rate (prevents overfitting) (default: 0.3)
  • --depth // Number of feature layers (default: 2)
  • --neurons1 // Number of neurons 1 (default: 256)
  • --neurons2 // Number of neurons 2 (default: 32)
  • --lr // Learning rate (default: 5e-4)
Optuna Optimization Parameters
  • --need_optuna // Whether to enable hyperparameter optimization (default: True)
  • --optuna_epoch // Number of attempts with different parameter combinations (default: 100)
  • --num_fold // Folded number (default: 1)
Optuna Search Ranges
  • --batch_1 // Minimum batch size (default: 16)
  • --batch_2 // Maximum batch size (default: 128)
  • --dropout_1 // Minimum dropout rate (default: 0.2)
  • --dropout_2 // Maximum dropout rate (default: 0.6)
  • --depth_1 // Minimum depth (default: 1)
  • --depth_2 // Maximum depth (default: 6)
  • --neurons1_1 // Minimum neurons1 number (default: 128)
  • --neurons1_2 // Maximum neurons1 number (default: 512)
  • --neurons2_1 // Minimum neurons2 number (default: 1)
  • --neurons2_2 // Maximum neurons2 number (default: 128)
  • --lr_1 // Minimum learning rate (default: 1e-7)
  • --lr_2 // Maximum learning rate (default: 1e-2)

Usage Examples

1. Manual Path Specification (Advanced)

If your data structure differs from default, map volumes manually:

# Example for Manual Mapping
docker run --gpus all --rm -it \
  -v "/your/local/data:/data_input" \
  -v "/your/local/best_model:/gef/code/best_model" \
  -v "/your/local/k_model:/gef/code/k_model" \
  -w /gef/code \
  coder02lq/geformer:v1.1 \
  python train.py \
  --scheme M1 \
  --geno_path /data_input/geno/geno.csv \
  --phe_folder /data_input/phe/ \
  --env_folder /data_input/env \
  --cvf_folder /data_input/cvf \
  --env_name LN \
  --pheno_name PH

If your data folder matches standard structure (contains geno, phe, env folders):

docker run --gpus all --rm -it \
  -v "/your/local/data:/gef/data" \
  -v "/your/local/best_model:/gef/code/best_model" \
  -v "/your/local/k_model:/gef/code/k_model" \
  -w /gef/code \
  coder02lq/geformer:v1.1 \
  python train.py --scheme M1 --env_name LN --pheno_name PH

Note for Windows Git Bash Users: Git Bash on Windows has a path conversion issue. To prevent errors, you must use double slashes // for absolute paths inside the container:

  • Replace -w /gef/code with -w //gef/code
  • Replace paths like /data_input with //data_input
3. Command Parameters Explanation
Parameter / PlaceholderTypeDescription
/your/local/dataUser PathReplace this with the absolute path to your data folder on your computer.
(e.g., /home/user/project/data or D:/project/data)
/your/local/best_modelUser PathReplace this with the path where you want to save the trained model files.
(e.g., /home/user/project/results or D:/project/results)
/your/local/k_modelUser PathReplace this with the path where you want to save the k-fold model files.
(e.g., /home/user/project/k_models or D:/project/k_models)

Note: The simplified command works because the code defaults to reading from ../data (/gef/data in container).

Tag summary

Content type

Image

Digest

sha256:59ce27d72

Size

2.2 GB

Last updated

8 months ago

docker pull coder02lq/geformer:v1.1