Note: This workflow documents the steps used to reproduce the data processing, clone assignment, and mutational burden analysis from the original study. Files and phylogenetic resources were taken from the authors’ published Zenodo dataset when our independently reproduced clustering results did not sufficiently match the original analysis.
- Git clone pipeline: bact-gen-scripts
- Conda environment:
bact-gen-scripts.yml
sbatch /storage/home/hcoda1/2/bli629/scratch/redo_paper/download_parallel.sbatchsbatch /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/gz_01.sbatchsbatch /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/fastp_01.sbatchStep 1.4: Use Pipeline bact-gen-scripts to Get the Alignments Mapping Against Reference Genome for Each Sample
sbatch /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/map_to_bam_original.sbatchpython /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/filter_percentage.py- Conda environment:
clone_assignment.yml
Step 2.1: Determine the Samples with Unique Strain-Type-Patient Pair as Representative for Following SNP Distance Clustering
Result accession numbers are in accession_unique_pair.txt:
python /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/unique_ST_Patient_pair.pyStep 2.2: Combine the Alignments for the Samples with Unique Strain-Type-Patient Pair and Run Through snp-sites to Extract SNPs
- Combine the alignments:
xargs -I {} -a /path/to/accession_unique_pair.txt cat /path/to/bact-gen/step1.4/output/folder/{}/{}_qc.mfa > /path/to/output/merged.aln - Run
snp-sites:snp-sites /path/to/output/merged.aln -o /path/to/output/merged_snpsites.aln
- Rename the
.alnto.fasta:cp /path/to/output/merged_snpsites.aln /path/to/output/merged_snpsites.fasta
pairsnp -t 12 /path/to/output/merged_snpsites.aln > /path/to/pairsnp/output.csvpython /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/UPGMA_clustering.pyAfter clustering the representative samples, the cluster results were reflected to all the samples using the R script below:
Rscript /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/cluster.R- Conda environment:
phyloeffects.yml,snpeff.yml
Step 3.1: Use Alignment Files and Phylogenetic Trees to Reconstruct the Ancestral Genome for Each Clone
All the alignments, tree, and position mapping files are downloaded from Zenodo, as our clustering result is not ideal
sbatch /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/phylloeffects.sbatchThis step is incorporated with Step 3.
Step 3.3: Compare the Reconstructed Ancestral Genome with the Reference Genome at Each Mapped Position
Variants are identified and saved to VCF files:
sbatch /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/reconstruction_and_vcf_building.sbatch- The
SnpEffdatabase was manually built using the GenBank file from the NCBI Reference Genome. - Follow the instructions from the SnpEff documentation.
- Database name was set as:
GCA_000006765.1_ASM676v1_genomic
sbatch /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/snpEff.sbatchpython /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/mutational_burden_analysis.pyUse the R script provided for visualization:
Rscript /storage/home/hcoda1/2/bli629/scratch/original_paper/all_codes/manhattan_plot.R