ARG profile calling using ‘rgi bwt’ for any downstream metagenomic analysis like MetaPhlAn or HUMAnN (Data_Tam_Metagenomics_2026_Wastewater)

Yes — exactly. Both scripts call the identical rgi bwt command with the identical flags (-1, -2, -o, -n 16, --clean, --include_wildcard). The only differences are the input reads and the output directory:

rgi_bwt.sh (full) rgi_bwt_on_subsampled_kneaddata.sh (test)
Input Full *_paired_1/2.fastq from KneadData 10% / 200k-read subsample (*_sub_1/2.fastq.gz)
Output dir ARG_results/ ARG_results_test/
rgi bwt command identical identical

So rgi_bwt.sh will produce, per sample, the exact same set and format of files:

${sample}_arg.sorted.length_100.bam (+ .bai)
${sample}_arg.reference_mapping_stats.txt
${sample}_arg.allele_mapping_data.json / .txt
${sample}_arg.gene_mapping_data.txt      ← the one your R script reads
${sample}_arg.overall_mapping_stats.txt
${sample}_arg.artifacts_mapping_stats.txt

What will differ (content, not format)

  • File sizes: BAMs and mapping tables will be larger (~10× more input reads).
  • Richness: gene_mapping_data.txt will contain more ARGs and higher read counts (the test run gave you 360 ARGs; the full run will detect additional low-abundance ARGs that were missed at 10% depth).
  • Runtime: roughly 10× longer per sample — that’s why I suggested the parallel xargs -P 4 version for the full run.

For your R script

Nothing changes except the input path — just switch at the top of analyze_rgi_arg_output.R:

arg_dir <- "~/DATA/Data_Tam_Metagenomics_2026_Wastewater/ARG_results/"

and rerun. The parser (gene_mapping_data\\.txt pattern) will pick up the full-depth files automatically.

Leave a Reply

Your email address will not be published. Required fields are marked *