Skip to content

HPC scripts

ShirNehoray edited this page May 18, 2025 · 3 revisions

Between-Farms Prediction

1. Generate HPC Job Scripts

  • Script: create_all_bash_jobs.R

This R script builds the HPC submission script by looping over all pairs of farms and writing the necessary qsub commands.To generate the job script, run:

Rscript create_all_bash_jobs.R \ --input data/input/rumen_mln.csv \ --output jobs/between_farms/HPC_bash_jobs_between_two_farms_code.sh

The file jobs/between_farms/HPC_bash_jobs.sh will contain one qsub command per farm-to-farm prediction.

2. Submit Jobs on the Cluster

  • Wrapper: bash_code_between_two_farms.sh

Execution: bash bash_code_between_two_farms.sh \ jobs/between_farms/HPC_bash_jobs_between_two_farms_code.sh

3. Core Prediction Script

  • Script: between_two_farms_hpc.R

  • Parses command-line arguments for farms and output paths.

  • Loads rumen_mln.csv and fitted_asvs_phylo_tree.rds.

  • Performs SVD on Farm A network.

  • Applies phylogenetic imputation to Farm B.

  • Predicts co-occurrence weights.

  • Saves all output CSV files in the directory, named as JOB_ID_FarmA_to_FarmB.csv (49 files total), for downstream analysis.

4. Merge Predicted Outputs

Script: combined_raw_data_csv.R

Merges all individual prediction CSV outputs into a single observed data table Raw_data_table_all_farms.csv for metric calculation.

Clone this wiki locally