0
|
1 I. Quick start.
|
|
2
|
|
3 The merge_metadata.py script has been included in the MaAsLin package to help add metadata to otu tables (or any tab delimited file where columns are the samples). This script was used to make the maaslin_demo.pcl file found in this project.
|
|
4
|
|
5 The generic command to run the merge_metadata.py is:
|
|
6 python merge_metadata.py input_metadata_file < input_measurements_file > output_pcl_file
|
|
7
|
|
8 An example of the expected files are found in this project in the directory maaslin/input/for_merge_metadata
|
|
9 An example of how to run the command on the example files is as follows (when in the maaslin folder in a terminal):
|
|
10 python src/merge_metadata.py input/for_merge_metadata/maaslin_demo_metadata.metadata < input/for_merge_metadata/maaslin_demo_measurements.pcl > input/maaslin_demo.pcl
|
|
11
|
|
12 II. Script overview
|
|
13 merge_metadata.py takes a tab delimited metadata file and adds it to a otu table. Both files have expected formats given below. Additionally, if a pipe-delimited consensus lineage is given in the IDs of the OTUs (for instance for the genus Bifidobacterium, Bacteria|Actinobacteria|Actinobacteria|Bifidobacteriales|Bifidobacteriaceae|Bifidobacterium), the higher level clades in the consensus lineage are added to other otu in the same clade level generating all higher level clade information captured in the otu data*. This heirarchy is then normalized using the same heirarchical structure. This means, after using the script, a sample will sum to more than 1, typically somewhere around 6 but will depend on if your data is originally at genus, species, or another level of resolution. All terminal otus (or the original otus) in a sample should sum to 1.
|
|
14
|
|
15 *To help combat multiple comparisons, additional clades are only added if they add information to the data set. This means if you have an otu Bacteria|Actinobacteria|Actinobacteria|Bifidobacteriales|Bifidobacteriaceae|Bifidobacterium and no other related otus until Bacteria|Actinobacteria|Actinobacteria|Bifidobacteriales, Bacteria|Actinobacteria|Actinobacteria|Bifidobacteriales|Bifidobacteriaceae will not be added to the data set because it will be no different than the already existing and more specific Bacteria|Actinobacteria|Actinobacteria|Bifidobacteriales|Bifidobacteriaceae|Bifidobacterium otu. Clades at and above Bacteria|Actinobacteria|Actinobacteria|Bifidobacteriales will be included depending on if there are other otus to add them to at those clade levels.
|
|
16
|
|
17
|
|
18 III. Description of input files
|
|
19
|
|
20 Metadata file:
|
|
21 Please make the file as follows:
|
|
22 1. Tab delimited
|
|
23 2. Rows are samples, columns are metadata
|
|
24 3. Sample Ids in the metadata file should match the sample ids in the otu table.
|
|
25 4. Use NA for values which are not recorded.
|
|
26 5. An example file is found at input/for_merge_metadata/maaslin_demo_metadata.metadata
|
|
27
|
|
28 OTU table:
|
|
29 Please make the file as follows:
|
|
30 1. Tab delimited.
|
|
31 2. Rows are otus, columns are samples (note this is transposed in comparison to the metadata file).
|
|
32 3. If a consensus lineage is included in the otu name, use pipes as the delimiter.
|
|
33 4. An example file is found at input/for_merge_metadata/maaslin_demo_measurements.pcl
|