bio-population-genetics-plink-basics
PLINK file formats, format conversion, and quality control filtering for population genetics. Convert between VCF, BED/BIM/FAM, and PED/MAP formats, apply…
от FridrichMethod★ 17 звёзд на GitHub
Установить bio-population-genetics-plink-basics в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
PLINK Basics
File formats, conversion, and quality control filtering with PLINK 1.9 and 2.0.
File Formats
Binary Format (Recommended)
| File | Contents |
|---|---|
.bed |
Binary genotype data |
.bim |
Variant information (chr, ID, cM, pos, A1, A2) |
.fam |
Sample information (FID, IID, father, mother, sex, pheno) |
PLINK 2.0 Format
| File | Contents |
|---|---|
.pgen |
Binary genotype data (compressed) |
.pvar |
Variant information |
.psam |
Sample information |
Text Format (Legacy)
| File | Contents |
|---|---|
.ped |
Genotypes (FID, IID, father, mother, sex, pheno, genotypes) |
.map |
Variant positions (chr, ID, cM, pos) |
Format Conversion
VCF to PLINK Binary
# PLINK 1.9
plink --vcf input.vcf.gz --make-bed --out output
# PLINK 2.0
plink2 --vcf input.vcf.gz --make-bed --out output
# With sample ID handling
plink2 --vcf input.vcf.gz --double-id --make-bed --out output
PLINK Binary to VCF
# PLINK 1.9
plink --bfile input --recode vcf --out output
# PLINK 2.0
plink2 --bfile input --export vcf --out output
# Compressed VCF
plink2 --bfile input --export vcf bgz --out output
PED/MAP to Binary (PLINK 1.9 Only)
# PLINK 1.9 (PLINK 2.0 doesn't support .ped/.map directly)
plink --file input --make-bed --out output
Binary to PED/MAP
# PLINK 1.9
plink --bfile input --recode --out output
# PLINK 2.0
plink2 --bfile input --export ped --out output
PLINK 1.9 to 2.0 Format
# Convert to PGEN format
plink2 --bfile input --make-pgen --out output
# Convert back to BED
plink2 --pfile input --make-bed --out output
Quality Control Filtering
MAF Filter (Minor Allele Frequency)
# Remove variants with MAF < 0.01
plink --bfile input --maf 0.01 --make-bed --out output
# PLINK 2.0
plink2 --bfile input --maf 0.01 --make-bed --out output
# Remove rare variants (MAF < 0.05)
plink2 --bfile input --maf 0.05 --make-bed --out output
Genotyping Rate Filters
# Per-variant missing rate (remove if >5% missing)
plink2 --bfile input --geno 0.05 --make-bed --out output
# Per-sample missing rate (remove if >5% missing)
plink2 --bfile input --mind 0.05 --make-bed --out output
Hardy-Weinberg Equilibrium Filter
# Remove variants with HWE p-value < 1e-6
plink2 --bfile input --hwe 1e-6 --make-bed --out output
# Different threshold for cases vs controls
plink2 --bfile input --hwe 1e-6 --hwe-all --make-bed --out output
Combined QC Pipeline
# Standard QC filtering
plink2 --bfile input \
--maf 0.01 \
--geno 0.05 \
--mind 0.05 \
--hwe 1e-6 \
--make-bed --out qc_filtered
Sample and Variant Selection
Keep/Remove Samples
# Keep specific samples (samples.txt: FID IID per line)
plink2 --bfile input --keep samples.txt --make-bed --out output
# Remove specific samples
plink2 --bfile input --remove samples.txt --make-bed --out output
# Keep single sample
plink2 --bfile input --keep-fam sample_id --make-bed --out output
Extract/Exclude Variants
# Extract specific variants (variants.txt: variant IDs)
plink2 --bfile input --extract variants.txt --make-bed --out output
# Exclude specific variants
plink2 --bfile input --exclude variants.txt --make-bed --out output
# Extract by range
plink2 --bfile input --extract range chr1:1000000-2000000 --make-bed --out output
Chromosome Selection
# Single chromosome
plink2 --bfile input --chr 22 --make-bed --out chr22
# Multiple chromosomes
plink2 --bfile input --chr 1-22 --make-bed --out autosomes
# Exclude chromosome
plink2 --bfile input --not-chr 23,24,25,26 --make-bed --out autosomes
Allele Frequency
# PLINK 1.9 (MAF-based)
plink --bfile input --freq --out output
# PLINK 2.0 (ALT allele frequency - not MAF!)
plink2 --bfile input --freq --out output
# PLINK 2.0 with MAF
plink2 --bfile input --freq cols=+mac,+mafreq --out output
Missing Data Statistics
# Per-sample and per-variant missing rates
plink2 --bfile input --missing --out output
# Output files:
# output.smiss - sample missing rates
# output.vmiss - variant missing rates
Sex Check
Verify reported sex matches X chromosome heterozygosity.
# PLINK 1.9
plink --bfile input --check-sex --out sex_check
# PLINK 2.0
plink2 --bfile input --split-par hg38 --check-sex --out sex_check
Interpret Results
import pandas as pd
sex = pd.read_csv('sex_check.sexcheck', sep='\s+')
problems = sex[sex['STATUS'] == 'PROBLEM']
print(f'Sex mism
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
read_file - 02
run_shell_command
Вложенные файлы
- examples/qc_pipeline.sh
- usage-guide.md
FAQ
Что делает скилл bio-population-genetics-plink-basics?
PLINK file formats, format conversion, and quality control filtering for population genetics. Convert between VCF, BED/BIM/FAM, and PED/MAP formats, apply MAF, genotyping rate, and HWE filters using PLINK 1.9 and 2.0. Use when working with PLINK format files or running QC.
Как установить скилл bio-population-genetics-plink-basics?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bio-population-genetics-plink-basics запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…