Bioinformatics for agriculture is now a core skill for plant breeders, agronomy and biotechnology students, and PhD scholars at agricultural universities. Hands-on trainings across India now teach the same core pipeline: Linux and cloud computing, raw read quality control, genome mapping, variant calling and annotation, and finally linking genotypes to traits. This free guide walks you through that whole pipeline step by step, with commands you can copy and run, so you can practise before a training, follow along during one, or learn it entirely on your own.
Who this is for: M.Sc. and Ph.D. students in genetics and plant breeding, biotechnology, agricultural statistics and bioinformatics; ICAR, SAU and CSIR project staff (JRF/SRF/RA); and anyone preparing for a hands-on bioinformatics workshop or a genomics project.
Run this whole pipeline without coding: our free NGS Pipeline Studio does every step below in your browser, with no Linux, installation or sign-up: FASTQ quality control, fastp trimming, BWA mapping, variant calling, GATK-style filtering, VCF statistics, gene-effect annotation and GWAS. It runs the real fastp, BWA, Samtools and bcftools on your own computer, so your data is never uploaded. Try it with the built-in demo rice data first.
📺 Prefer video? Follow the step-by-step videos on our YouTube channel @dailyfirst007 and subscribe so you don’t miss the next part.
The pipeline at a glance
Every resequencing project in rice, wheat, maize, chickpea or any other crop follows the same path from sequencer to biological answer:
- Raw reads (FASTQ) from Illumina sequencing
- Quality control and trimming with FastQC and fastp
- Mapping to the reference genome with BWA, then sorting and indexing with Samtools
- Marking duplicates and calling variants (SNPs and InDels) with GATK
- Filtering and annotating the VCF file (GATK, bcftools, SnpEff)
- From genotype to trait: GWAS, marker discovery and interpretation
Tip: you can draw this workflow as a clean figure for your thesis or presentation with our free Scientific Diagram Maker.
Step 0: Set up your Linux, HPC or cloud environment
Almost all genomics tools run on Linux. You have three options: a Linux laptop (or Windows with WSL2), your institute’s HPC cluster, or a cloud machine such as an AWS EC2 instance. For a crop genome, plan for at least 16 GB RAM, 4 or more CPU cores and 100 GB or more of disk space.
Ten Linux commands you will use every day
pwd # where am I?
ls -lh # list files with sizes
cd project/ # move into a folder
mkdir -p raw qc ref bam vcf # make folders
head -n 8 sample_R1.fastq # look at the first 2 reads
zcat sample_R1.fastq.gz | wc -l # count lines (reads = lines / 4)
less file.txt # scroll through a file (q to quit)
grep -c "^>" genome.fa # count chromosomes/contigs
df -h # free disk space
nohup command > log.txt 2>&1 & # keep a job running after you log out
Install all the tools in one go with Conda (Bioconda)
# install Miniforge first (a free, minimal Conda), then:
conda create -n agrigenomics -c conda-forge -c bioconda \
fastqc fastp bwa samtools bcftools gatk4 snpeff sra-tools plink -y
conda activate agrigenomics
Running on an HPC cluster (SLURM)
On a shared cluster you do not run heavy jobs on the login node. You submit a job script instead:
#!/bin/bash
#SBATCH --job-name=bwa_map
#SBATCH --cpus-per-task=8
#SBATCH --mem=32G
#SBATCH --time=12:00:00
#SBATCH --output=bwa_%j.log
source activate agrigenomics
bwa mem -t 8 ref/genome.fa qc/S1_R1.trim.fq.gz qc/S1_R2.trim.fq.gz | samtools sort -@ 4 -o bam/S1.sorted.bam
Submit it with sbatch map.sh and check it with squeue -u $USER.
No coding? Skip the setup entirely: NGS Pipeline Studio needs no Linux, Conda or HPC account and runs in Chrome, Edge or Firefox. Come back to this setup when you move to whole genomes on a cluster.
Step 1: Get practice data (reference genome and reads)
We use rice as the example because its genome is small (about 390 Mb) and well annotated. The same steps work for any crop: just swap the reference.
cd ref
# Rice reference genome (IRGSP-1.0) from Ensembl Plants
wget https://ftp.ensemblgenomes.ebi.ac.uk/pub/plants/current/fasta/oryza_sativa/dna/Oryza_sativa.IRGSP-1.0.dna.toplevel.fa.gz
gunzip Oryza_sativa.IRGSP-1.0.dna.toplevel.fa.gz
mv Oryza_sativa.IRGSP-1.0.dna.toplevel.fa genome.fa
cd ..
# Paired-end reads from NCBI SRA (replace SRRxxxxxxx with a real run ID)
cd raw
fasterq-dump --split-files --threads 4 SRRxxxxxxx
gzip SRRxxxxxxx_1.fastq SRRxxxxxxx_2.fastq
cd ..
If the download link stops working (Ensembl is moving to a new platform in 2026), open the rice page on Ensembl Plants and use its “Download DNA sequence (FASTA)” link to get the same dna.toplevel file.
Where to find runs: search NCBI SRA for “Oryza sativa whole genome resequencing” (the 3,000 Rice Genomes Project data are public) and pick a paired-end Illumina run. For quick practice, keep only the first two million reads: zcat raw/SRRxxxxxxx_1.fastq.gz | head -n 8000000 | gzip > raw/S1_R1.fastq.gz (and the same for read 2).
Step 2: Raw read quality control and trimming (FastQC and fastp)
# 1. Check raw quality
fastqc -t 4 -o qc raw/S1_R1.fastq.gz raw/S1_R2.fastq.gz
# 2. Trim adapters and low-quality bases
fastp -i raw/S1_R1.fastq.gz -I raw/S1_R2.fastq.gz \
-o qc/S1_R1.trim.fq.gz -O qc/S1_R2.trim.fq.gz \
--detect_adapter_for_pe -q 20 -l 50 -w 4 \
-h qc/S1_fastp.html -j qc/S1_fastp.json
# 3. Re-check after trimming
fastqc -t 4 -o qc qc/S1_R1.trim.fq.gz qc/S1_R2.trim.fq.gz
How to read the FastQC report: look at “Per base sequence quality” (most bases should stay above Q30), “Adapter content” (should be close to zero after fastp) and “Sequence duplication levels”. Some warnings, such as per-base sequence content at the start of reads, are normal for Illumina libraries and are not a reason to discard data.
No coding? Upload your FASTQ files to NGS Pipeline Studio, step 2 (quality control) for a FastQC-style report, then trim them with fastp in step 3.
Step 3: Genome mapping and indexing (BWA and Samtools)
# Index the reference once (BWA, Samtools and GATK each need their own index)
bwa index ref/genome.fa
samtools faidx ref/genome.fa
gatk CreateSequenceDictionary -R ref/genome.fa
# Map reads with a read group (GATK needs it), then sort
bwa mem -t 8 -R "@RG\tID:S1\tSM:S1\tPL:ILLUMINA\tLB:lib1" \
ref/genome.fa qc/S1_R1.trim.fq.gz qc/S1_R2.trim.fq.gz \
| samtools sort -@ 4 -o bam/S1.sorted.bam
samtools index bam/S1.sorted.bam
# Mapping statistics
samtools flagstat bam/S1.sorted.bam
samtools coverage bam/S1.sorted.bam | head
What good looks like: for resequencing of the same species, more than 90% of reads usually map. A much lower rate suggests contamination, the wrong reference or poor library quality.
Mark PCR duplicates
gatk MarkDuplicates -I bam/S1.sorted.bam -O bam/S1.dedup.bam \
-M bam/S1.dup_metrics.txt
samtools index bam/S1.dedup.bam
No coding? Map your reads with BWA-MEM, mark duplicates and see mapping rate, depth and a coverage plot in NGS Pipeline Studio, step 4.
Step 4: Variant calling with GATK (SNPs and InDels)
The GATK “GVCF” workflow lets you call each sample separately and then genotype all samples together, which is the standard approach for populations and breeding panels.
# Per sample
gatk HaplotypeCaller -R ref/genome.fa -I bam/S1.dedup.bam \
-O vcf/S1.g.vcf.gz -ERC GVCF
# Combine all samples (repeat -V for each sample)
gatk CombineGVCFs -R ref/genome.fa \
-V vcf/S1.g.vcf.gz -V vcf/S2.g.vcf.gz -V vcf/S3.g.vcf.gz \
-O vcf/cohort.g.vcf.gz
# Joint genotyping
gatk GenotypeGVCFs -R ref/genome.fa -V vcf/cohort.g.vcf.gz -O vcf/cohort.vcf.gz
Filter variants (hard filtering)
Crops usually lack the curated “truth” variant sets that GATK’s machine-learning filter (VQSR) needs, so hard filters are the common choice. These are GATK’s recommended starting values for SNPs:
gatk SelectVariants -V vcf/cohort.vcf.gz -select-type SNP -O vcf/snps.vcf.gz
gatk VariantFiltration -V vcf/snps.vcf.gz -O vcf/snps.filtered.vcf.gz \
-filter "QD < 2.0" --filter-name "QD2" \
-filter "FS > 60.0" --filter-name "FS60" \
-filter "MQ < 40.0" --filter-name "MQ40" \
-filter "SOR > 3.0" --filter-name "SOR3" \
-filter "MQRankSum < -12.5" --filter-name "MQRankSum-12.5" \
-filter "ReadPosRankSum < -8.0" --filter-name "ReadPosRankSum-8"
# Keep only variants that passed
bcftools view -f PASS vcf/snps.filtered.vcf.gz -Oz -o vcf/snps.pass.vcf.gz
bcftools index vcf/snps.pass.vcf.gz
bcftools stats vcf/snps.pass.vcf.gz > vcf/snps.stats.txt
For InDels use -select-type INDEL with GATK’s InDel filters (QD < 2.0, FS > 200.0, SOR > 10.0, ReadPosRankSum < -20.0).
No coding? Call SNPs and InDels across all your samples in step 5 (the browser tool uses bcftools, because GATK cannot run in a browser) and apply these GATK hard filters with one click in step 6. You can also upload a VCF from GATK straight into step 6.
Step 5: Understand and annotate the VCF file
A VCF line tells you the chromosome (CHROM), position (POS), reference and alternate alleles (REF/ALT), a quality score (QUAL), whether it passed filters (FILTER), extra information (INFO), and each sample’s genotype (0/0 = same as reference, 0/1 = heterozygous, 1/1 = homozygous alternate).
# Peek at variants without the header
bcftools view -H vcf/snps.pass.vcf.gz | head
# Annotate with SnpEff: find the rice database name first
snpEff databases | grep -i oryza
snpEff -Xmx8g <database_name> vcf/snps.pass.vcf.gz > vcf/snps.ann.vcf
SnpEff labels every variant by its effect: synonymous, missense, stop-gained, splice-site, upstream and so on, and writes a summary HTML report. Missense and stop-gained variants in candidate genes are where breeders usually look first.
No coding? Get Ts/Tv, variant density, depth and per-sample plots for any VCF in the VCF explorer (step 7), and annotate missense, stop-gained, splice and other effects from your GFF3 in step 8, like SnpEff.
Step 6: From genotype to trait
Once you have clean SNPs across a panel of lines, you can connect them to traits such as yield, grain quality, drought tolerance or disease resistance.
# Convert VCF to PLINK format and filter rare/missing markers
plink --vcf vcf/snps.pass.vcf.gz --allow-extra-chr --double-id \
--maf 0.05 --geno 0.1 --make-bed --out gwas/panel
# Population structure (principal components)
plink --bfile gwas/panel --allow-extra-chr --pca 10 --out gwas/panel_pca
Then run the association test (GWAS) in R with packages such as GAPIT or rMVP, using your phenotype file and the principal components as covariates. You can make the Manhattan plot, QQ plot, PCA plot and phenotype statistics (ANOVA, heritability, correlations) in our free R & Python Research Lab, which runs real R and Python in your browser with nothing to install. For quick tests, see our free statistical tools for biology.
No coding? Upload your VCF and phenotype CSV to NGS Pipeline Studio, step 9 for PCA, kinship, GLM and MLM GWAS, Manhattan and QQ plots and the top SNPs with nearby genes. A 220-line demo panel is built in.
Project ideas for practice and presentations
- Call SNPs in 5 to 10 rice accessions and compare variant density across the 12 chromosomes.
- Find missense and stop-gained variants in a known gene (for example a blast resistance or grain size gene) and check which accessions carry them.
- Build a PCA plot of a diversity panel and see whether indica and japonica lines separate.
- Run a small GWAS on a public phenotype (such as plant height or days to flowering) and report the top associated regions.
- Compare variant counts before and after hard filtering and explain what each filter removes.
Present your project on a clean academic poster with our free Research Poster Templates.
Common errors and quick fixes
- “Read group not found” or “SM tag missing” in GATK: you mapped without
-R "@RG\t...". Add read groups withgatk AddOrReplaceReadGroupsor re-map. - “Fasta dict file not found”: run
gatk CreateSequenceDictionaryandsamtools faidxon the reference. - Chromosome names don’t match: the reference used for mapping and calling must be the same file (Ensembl names like “1” differ from “Chr1”).
- Killed / out of memory: give Java more memory, for example
gatk --java-options "-Xmx16g" HaplotypeCaller ..., or request more memory in your SLURM script. - Job stops when you close the terminal: use
nohup,screen/tmux, or submit withsbatch. - PLINK complains about chromosome names: add
--allow-extra-chr.
Quick cheat sheet
| Step | Tool | Input → Output |
|---|---|---|
| Quality check | FastQC | FASTQ → HTML report |
| Trimming | fastp | FASTQ → clean FASTQ |
| Indexing | bwa index, samtools faidx | FASTA → index files |
| Mapping | BWA-MEM + samtools sort | FASTQ → sorted BAM |
| Duplicates | GATK MarkDuplicates | BAM → dedup BAM |
| Variant calling | GATK HaplotypeCaller, GenotypeGVCFs | BAM → VCF |
| Filtering | GATK VariantFiltration, bcftools | VCF → filtered VCF |
| Annotation | SnpEff | VCF → annotated VCF |
| Genotype to trait | PLINK, GAPIT/rMVP | VCF → GWAS results |
Frequently asked questions
Do I need programming to learn bioinformatics for agriculture?
No. You can run the whole pipeline without any coding in our free NGS Pipeline Studio. To run it on large datasets yourself, you need basic Linux commands, which you can learn in a week of practice. R or Python helps later for statistics and plots, but you can start with our browser-based R & Python Research Lab.
Can I do this on a Windows laptop?
Yes, install WSL2 (Windows Subsystem for Linux) and Ubuntu, then follow the same commands. For many samples or large genomes such as wheat, use an HPC cluster or cloud machine.
Which reference genome should I use for wheat or other crops?
Use the latest assembly from Ensembl Plants or the crop’s official consortium (for wheat, IWGSC RefSeq). Always map and call variants against the same reference file.
GATK or bcftools for variant calling?
Both are widely used. GATK’s GVCF workflow is the standard for multi-sample joint genotyping and is what most trainings teach; bcftools mpileup | bcftools call is faster and simpler for quick analyses.
How much sequencing depth do I need?
For reliable SNP calling in resequencing projects, around 10x to 30x per sample is common. Low-coverage designs (1x to 5x) need imputation.
Keep learning with dailyfirst.in
This guide is part of our free research skills series for agriculture and life science researchers. Bookmark it, share it with your lab group, and explore our AI Research Tools for thesis writing, statistics, graphs and figures. For video walkthroughs of each step, subscribe to dailyfirst on YouTube.
🔬 Writing a thesis, paper or conference poster?
Use 25+ free AI research tools on dailyfirst.in: check plagiarism, format citations, polish your abstract, run statistics and build a poster.
Open AI Research Tools →One email a day with every new job, scholarship and update. No spam, unsubscribe in one click.