Usually I work with RNAseq data, I align with STAR and then perform my downstream…
- User
Usually I work with RNAseq data, I align with STAR and then perform my downstream analysis. I now want to work with some public data, I have 2 paired-end samples, in fastq.gz format of DNA sequencing, meaning I have sample1_1.fastq.gz sample1_2.fastq.gz sample2_1.fastq.gz sample2_2.fastq.gz. How do I go about aligning this? or what other recommendations for analysing this data?
- Assistant
- User
My aim is variant calling
- Assistant
- User
why use BWA and not bowtie2?
- Assistant
Excellent question — both BWA and Bowtie2 are fast, memory-efficient aligners for short-read DNA sequences. However, BWA (specifically BWA-MEM) is generally preferred for variant calling, and here's why:
🔍 Why BWA-MEM > Bowtie2 for Variant Calling? ✅ 1. Better Handling of Gapped Alignments (Indels)
- User
OK, thanks. Now I want to download data from the ENA browser, should I use wget or the SRA?
- Assistant
Great question — choosing between ENA (with wget) and SRA Toolkit depends on:
Your preferred file format
Your internet speed and reliability
How much preprocessing you're willing to do
🔄 Comparison: wget from ENA vs. SRA Toolkit FeatureENA (wget/curl)SRA Toolkit (fasterq-dump)🔹 Download formatFASTQ (.fastq.gz)SRA binary ➝ must convert to FASTQ🔹 SpeedUsually faster and resume-friendlyOften slower, high overhead🔹 Parallelizable✅ Easily split with xargs, aria2, etc.⚠️ Needs careful scripting for parallel🔹 DependenciesJust wget or curlNeeds SRA Toolkit installed🔹 Reproducibility✅ You get exactly what ENA provides⚠️ Potential for changes with newer SRA versions🔹 Disk usageEfficient if downloading .gz⚠️ Uncompressed intermediate files during dump🔹 Read namesStandardized FASTQ headersSometimes odd formatting from SRA dumps
- User
for the bwa you used -t 8, how many GB of memory should I supply to my sbatch? and how many cores? 64 and 8?
- Assistant
Great — you're setting this up on a cluster using sbatch, so here’s a clear breakdown:
🔧 bwa mem -t 8 — What Does That Mean?
-t 8 tells BWA to use 8 threads (CPU cores)
This speeds up the alignment phase, especially for large genomes (e.g., human)
🧠 Memory Usage (RAM) BWA-MEM is light on memory: Genome SizePeak RAM UsageHuman (GRCh38)~4–8 GBMouse (mm10)~4 GBSmall genomes (e.g., bacteria, yeast)<1 GB
Even for large genomes, ~12 GB total RAM is usually plenty, even with 8 threads.
✅ Recommended sbatch Settings For human/mouse-sized genome: bashCopyEdit#SBATCH --cpus-per-task=8 #SBATCH --mem=16G #SBATCH --time=4:00:00
--cpus-per-task=8: matches -t 8 in BWA
--mem=16G: plenty of RAM for BWA and buffer for IO/compression
--time: adjust based on read depth, but 1–4 hours is typical for WGS samples
For small genomes (bacteria, viral): bashCopyEdit#SBATCH --cpus-per-task=4 #SBATCH --mem=4G #SBATCH --time=0:30:00
❌ No Need for 64 Cores or 64 GB RAM
- User
zebrafish
- Assistant
Thanks — for zebrafish (Danio rerio) genome alignment with BWA-MEM, here’s what you need to know:
🧬 Zebrafish Genome Size
~1.4 Gb (gigabases), about half the size of human
Similar in complexity to mouse, with a few teleost-specific quirks
BWA-MEM handles it easily
✅ Recommended sbatch Settings for Zebrafish + BWA-MEM For one paired-end sample: bashCopyEdit#SBATCH --cpus-per-task=8 #SBATCH --mem=12G #SBATCH --time=2:00:00
--cpus-per-task=8 — matches bwa mem -t 8
--mem=12G — safe upper bound (BWA typically uses <10G)
--time — zebrafish WGS or exome typically aligns in 30–90 mins
You can go lighter if needed: bashCopyEdit#SBATCH --cpus-per-task=4 #SBATCH --mem=8G #SBATCH --time=2:00:00
🧠 RAM Notes
BWA's memory usage is mostly for the reference index, which for zebrafish is ~5–8 GB
Actual RAM usage scales slightly with the number of threads and read depth, but not dramatically
🏁 Optional: Monitor Usage If you're unsure about your cluster limits, you can wrap the BWA job in /usr/bin/time -v to track actual RAM/CPU usage: bashCopyEdit/usr/bin/time -v bwa mem -t 8 reference.fa R1.fastq.gz R2.fastq.gz > output.sam