This function merges and formats metadata from various sources, including QIIME metadata, experimental sample metadata, and qPCR or FCM data, to create a unified metadata file for downstream analyses.
Value
A data frame containing the unified metadata. The data frame is also saved as a file in the project's input_data
folder.
Details
The function ensures that the metadata is unified and correctly formatted for further analysis by:
Reading and processing the
metadata_extra.tsv
file, which must contain at least:SampleID
: A unique identifier for each sample.sample_type
: Indicates whether the sample is asample
,mock
, orblank
.DNA_Concentration
: The DNA concentration (in ng/µl).
Optionally processing and integrating qPCR or FCM data:
If qPCR data is available, calculating the mean for duplicates and merging it with
metadata_extra
.If FCM data is available, calculating the mean for duplicates and merging it with
metadata_extra
.
Reading the
metadata.tsv
file (QIIME metadata), ensuring it contains theSampleID
column, and combining it with the processedmetadata_extra
.Writing the final combined metadata to a file. Note that the output file is named by concatenating the project name with
_metadata_formatted.tsv
and is saved in the project'sinput_data
folder.
All metadata files (QIIME metadata, experimental sample metadata, and qPCR/FCM data) must include
the SampleID
column for proper merging. This column serves as the key to align data from multiple sources.