|
| 1 | +## First time setup |
| 2 | + |
| 3 | +While no pre-installation is required for running workflows in this repository, you first need to download the repository to your local computer: |
| 4 | +~~~bash |
| 5 | +git clone https://github.com/KunDHuang/KunDH-2024-CRM-MSM_metagenomics.git |
| 6 | +~~~ |
| 7 | + |
| 8 | +NOTE: As scripts provided in this repository depend on many third-party tools, we highly recommend [conda](https://conda.io/projects/conda/en/latest/index.html) environment for managing required dependencies which are listed in each of sections in the tutorials. |
| 9 | + |
| 10 | +## General usages |
| 11 | + |
| 12 | +This repository provides two types of utilities: 1) Python scripts and 2) Importable R functions |
| 13 | + |
| 14 | +1) Python scripts are codes encapulated for executing specific analysis. |
| 15 | +Example: [visualizing cumulative distribution function.](../docs/cumulative_distribution_function.md) |
| 16 | +~~~bash |
| 17 | +$ cumulative_distribution_function.py --input_table <example_reads_stats.tsv> --output_figure <nr_QC_reads_pairs.svg> --value_header <nr_QC_reads_pairs> --palette_map <reads_stats_color_map.tsv> |
| 18 | +~~~ |
| 19 | + |
| 20 | +2) Importable R functions are R codes wrapped up for solving specific problems and should be reusable by just importing their scripts. |
| 21 | + |
| 22 | +Example: [estimate PERMANOVA significance.](../docs/beta_diversity_analysis.md) |
| 23 | + |
| 24 | +~~~R |
| 25 | +>source(file = "path_to_the_package/KunDH-2023-CRM-MSM_metagenomics/scripts/functions/beta_diversity_funcs.R") |
| 26 | +>est_permanova(mat = matrix, |
| 27 | + md = metadata, |
| 28 | + variable = "condom_use", |
| 29 | + covariables = c("Antibiotics_6mo", "HIV_status", "inflammatory_bowel_disease", "BMI_kg_m2_WHO", "diet"), |
| 30 | + nper = 999, |
| 31 | + to_rm = c("no_receptive_anal_intercourse"), |
| 32 | + by_method = "margin") |
| 33 | + |
| 34 | + Df SumOfSqs R2 F Pr(>F) |
| 35 | +condom_use 4 1.2161 0.08194 1.5789 0.008 ** |
| 36 | +Antibiotics_6mo 2 0.4869 0.03281 1.2643 0.160 |
| 37 | +HIV_status 1 0.3686 0.02484 1.9146 0.030 * |
| 38 | +inflammatory_bowel_disease 1 0.2990 0.02015 1.5529 0.066 . |
| 39 | +BMI_kg_m2_WHO 5 1.8376 0.12382 1.9087 0.002 ** |
| 40 | +diet 3 0.8579 0.05781 1.4853 0.036 * |
| 41 | +Residual 49 9.4347 0.63571 |
| 42 | +Total 65 14.8412 1.00000 |
| 43 | +--- |
| 44 | +Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 |
| 45 | +~~~ |
0 commit comments