This function creates a folder structure for projects, ensuring that all necessary directories exist and that specific files required for downstream analyses are present.
Arguments
- projects
A character vector containing the names of the project (folders).
- base_path
A character string indicating the base directory where the project folders are located. This path is used to locate the project folder and create the required subfolders.
- log_file
A character string specifying the path to the log file where warnings and errors will be recorded.
Details
This function facilitates the setup of downstream analyses by:
Creating a consistent directory structure for each project, including subfolders such as
input_data
,output_data
,figures
, andmessages
.Copying essential files from the
qiime2_output
folder into theinput_data
folder. These essential files include:table.qza
: The feature table from QIIME2.rooted-tree.qza
: The phylogenetic tree used for diversity analysis.classifier.qza
: The classifier used for taxonomy assignment.metadata.tsv
: The QIIME2 sample metadata file required for analyses.metadata_extra.tsv
: Any additional metadata provided for the samples.pantaxa_stats_NCBI.tsv
: The reference database for copy number correction from rrndb.prediction.RDS
: The predicted 16S copy numbers for each feature.
Checking for optional files that enhance analyses, such as:
qPCR.csv
: Contains quantitative PCR data.fcm.csv
: Contains flow cytometry data.
Logging warnings for missing optional files and errors for missing required files.
The function ensures that downstream analyses—which rely on specific input
files (e.g., table.qza
, rooted-tree.qza
, etc.) have access to these files
in the correct directory structure. If any required files are missing from
the qiime2_output
folder, the function stops execution and logs an error
message.