Merged_Abundance_Processing.R & process_abundance_data.py Tutorial - sciencesharon/MicrobialSeq GitHub Wiki
Merged_Abundance_Processing.R & process_abundance_data.py Tutorial
These functions are designed for use downstream of MetaPhlAn4 analysis.
They generate both read count tables and relative abundance tables for all taxonomic levels (Kingdom, Phylum, Class, Order, Family, Genus, Species, and Strain) and save the output to a specified directory, and in R also saves to the global environment.
Input File Example
Example MetaPhlAn4 output file: merged_abundance_table_example.txt
For Use in R with Merged_Abundance_Processing.R
First, read the file into R as a dataframe:
merged <- read.table("/path/to/file/merged_abundance_table_example.txt", header = FALSE, sep = "\t")
The function is then directly applicable to the merged abundance file, and will automatically generate the outputs to your global environment and to the specified output directory
processed_list <- merged_abundance_processing(merged = merged, output_dir = "/path/to/output/dir"
For use in Python with process_abundance_data.py
python process_abundance_data.py /path/to/your/merged_abundance_table_example.txt /path/to/output_directory
Output Files
The following files are generated by the script:
Read Count Files:
Relative Abundance Files: