Get data.table of sample metadata from MbioDataset
Source:R/methods-MbioDataset.R
getSampleMetadata-MbioDataset-method.Rd
Returns a data.table of sample metadata
Arguments
- object
MbioDataset
- asCopy
boolean indicating whether to return the data as a copy or by reference
- includeIds
boolean indicating whether we should include recordIdColumn and ancestorIdColumns
- metadataVariables
The metadata variables to include in the sample metadata. If NULL, all metadata variables will be included.
Examples
getSampleMetadata(microbiomeData::DiabImmune)
#> Participant_Id participant_repeated_measure_Id age_months
#> <char> <char> <int>
#> 1: E000823 (Source) E000823_1 (Source) 1
#> 2: E000823 (Source) E000823_10 (Source) 10
#> 3: E000823 (Source) E000823_12 (Source) 12
#> 4: E000823 (Source) E000823_13 (Source) 13
#> 5: E000823 (Source) E000823_15 (Source) 15
#> ---
#> 3345: T029922 (Source) T029922_14 (Source) 14
#> 3346: T029922 (Source) T029922_16 (Source) 16
#> 3347: T029922 (Source) T029922_19 (Source) 19
#> 3348: T029922 (Source) T029922_22 (Source) 22
#> 3349: T029922 (Source) T029922_7 (Source) 7
#> age_1st_animal_milk_or_solids_given_days age_1st_given_apple_months
#> <num> <num>
#> 1: 5 6
#> 2: 5 6
#> 3: 5 6
#> 4: 5 6
#> 5: 5 6
#> ---
#> 3345: 4 4
#> 3346: 4 4
#> 3347: 4 4
#> 3348: 4 4
#> 3349: 4 4
#> age_1st_given_banana_months age_1st_given_barley_months
#> <num> <num>
#> 1: 6 11
#> 2: 6 11
#> 3: 6 11
#> 4: 6 11
#> 5: 6 11
#> ---
#> 3345: 4 10
#> 3346: 4 10
#> 3347: 4 10
#> 3348: 4 10
#> 3349: 4 10
#> age_1st_given_beef_months age_1st_given_berries_months
#> <num> <num>
#> 1: 6.0 6.0
#> 2: 6.0 6.0
#> 3: 6.0 6.0
#> 4: 6.0 6.0
#> 5: 6.0 6.0
#> ---
#> 3345: 5.5 7.5
#> 3346: 5.5 7.5
#> 3347: 5.5 7.5
#> 3348: 5.5 7.5
#> 3349: 5.5 7.5
#> age_1st_given_cabbs_months age_1st_given_carrot_months
#> <num> <num>
#> 1: 7 5
#> 2: 7 5
#> 3: 7 5
#> 4: 7 5
#> 5: 7 5
#> ---
#> 3345: 5 4
#> 3346: 5 4
#> 3347: 5 4
#> 3348: 5 4
#> 3349: 5 4
#> age_1st_given_corn_months age_1st_given_cowsmilk_months
#> <num> <num>
#> 1: 6 12.0
#> 2: 6 12.0
#> 3: 6 12.0
#> 4: 6 12.0
#> 5: 6 12.0
#> ---
#> 3345: 5 8.5
#> 3346: 5 8.5
#> 3347: 5 8.5
#> 3348: 5 8.5
#> 3349: 5 8.5
#> age_1st_given_egg_months age_1st_given_fish_months
#> <num> <num>
#> 1: 8 7
#> 2: 8 7
#> 3: 8 7
#> 4: 8 7
#> 5: 8 7
#> ---
#> 3345: 11 6
#> 3346: 11 6
#> 3347: 11 6
#> 3348: 11 6
#> 3349: 11 6
#> age_1st_given_milk_products_months age_1st_given_oat_months
#> <num> <num>
#> 1: 10 5
#> 2: 10 5
#> 3: 10 5
#> 4: 10 5
#> 5: 10 5
#> ---
#> 3345: 7 5
#> 3346: 7 5
#> 3347: 7 5
#> 3348: 7 5
#> 3349: 7 5
#> age_1st_given_pear_months age_1st_given_peas_months
#> <num> <num>
#> 1: 10.0 6.5
#> 2: 10.0 6.5
#> 3: 10.0 6.5
#> 4: 10.0 6.5
#> 5: 10.0 6.5
#> ---
#> 3345: 4.5 5.0
#> 3346: 4.5 5.0
#> 3347: 4.5 5.0
#> 3348: 4.5 5.0
#> 3349: 4.5 5.0
#> age_1st_given_plum_months age_1st_given_pork_months
#> <num> <num>
#> 1: 5.0 7
#> 2: 5.0 7
#> 3: 5.0 7
#> 4: 5.0 7
#> 5: 5.0 7
#> ---
#> 3345: 4.5 8
#> 3346: 4.5 8
#> 3347: 4.5 8
#> 3348: 4.5 8
#> 3349: 4.5 8
#> age_1st_given_potato_months age_1st_given_poultry_months
#> <num> <num>
#> 1: 5 6
#> 2: 5 6
#> 3: 5 6
#> 4: 5 6
#> 5: 5 6
#> ---
#> 3345: 5 5
#> 3346: 5 5
#> 3347: 5 5
#> 3348: 5 5
#> 3349: 5 5
#> age_1st_given_rice_months age_1st_given_rye_months
#> <num> <num>
#> 1: 5.0 11.0
#> 2: 5.0 11.0
#> 3: 5.0 11.0
#> 4: 5.0 11.0
#> 5: 5.0 11.0
#> ---
#> 3345: 4.5 7.5
#> 3346: 4.5 7.5
#> 3347: 4.5 7.5
#> 3348: 4.5 7.5
#> 3349: 4.5 7.5
#> age_1st_given_sweet_potato_months age_1st_given_tomato_months
#> <num> <num>
#> 1: NA 9
#> 2: NA 9
#> 3: NA 9
#> 4: NA 9
#> 5: NA 9
#> ---
#> 3345: NA 6
#> 3346: NA 6
#> 3347: NA 6
#> 3348: NA 6
#> 3349: NA 6
#> age_1st_given_wheat_months age_at_anthropometry_days
#> <num> <int>
#> 1: 12 1110
#> 2: 12 1110
#> 3: 12 1110
#> 4: 12 1110
#> 5: 12 1110
#> ---
#> 3345: 6 1123
#> 3346: 6 1123
#> 3347: 6 1123
#> 3348: 6 1123
#> 3349: 6 1123
#> age_at_two_autoantibodies_positive_days
#> <int>
#> 1: NA
#> 2: NA
#> 3: NA
#> 4: NA
#> 5: NA
#> ---
#> 3345: NA
#> 3346: NA
#> 3347: NA
#> 3348: NA
#> 3349: NA
#> age_at_type_1_diabetes_diagnosis_days
#> <int>
#> 1: NA
#> 2: NA
#> 3: NA
#> 4: NA
#> 5: NA
#> ---
#> 3345: NA
#> 3346: NA
#> 3347: NA
#> 3348: NA
#> 3349: NA
#> antibiotics_before_delivery_by_maternal_report
#> <char>
#> 1: No
#> 2: No
#> 3: No
#> 4: No
#> 5: No
#> ---
#> 3345: <NA>
#> 3346: <NA>
#> 3347: <NA>
#> 3348: <NA>
#> 3349: <NA>
#> bmi_minus_for_minus_age_z_minus_score breastfed_duration country
#> <num> <int> <char>
#> 1: 1.62 397 Finland
#> 2: 1.62 397 Finland
#> 3: 1.62 397 Finland
#> 4: 1.62 397 Finland
#> 5: 1.62 397 Finland
#> ---
#> 3345: 0.63 83 Estonia
#> 3346: 0.63 83 Estonia
#> 3347: 0.63 83 Estonia
#> 3348: 0.63 83 Estonia
#> 3349: 0.63 83 Estonia
#> delivery_mode diet_in_first_three_days exclusive_breastfed_duration
#> <char> <char> <int>
#> 1: Vaginal Mother's breast milk 150
#> 2: Vaginal Mother's breast milk 150
#> 3: Vaginal Mother's breast milk 150
#> 4: Vaginal Mother's breast milk 150
#> 5: Vaginal Mother's breast milk 150
#> ---
#> 3345: Cesarean Mother's breast milk 1
#> 3346: Cesarean Mother's breast milk 1
#> 3347: Cesarean Mother's breast milk 1
#> 3348: Cesarean Mother's breast milk 1
#> 3349: Cesarean Mother's breast milk 1
#> gestational_diabetes_by_maternal_report
#> <char>
#> 1: No
#> 2: No
#> 3: No
#> 4: No
#> 5: No
#> ---
#> 3345: No
#> 3346: No
#> 3347: No
#> 3348: No
#> 3349: No
#> glutamic_acid_decarboxylase_antibodies hla_risk_by_hla_haplotyping
#> <char> <int>
#> 1: No 2
#> 2: No 2
#> 3: No 2
#> 4: No 2
#> 5: No 2
#> ---
#> 3345: No 3
#> 3346: No 3
#> 3347: No 3
#> 3348: No 3
#> 3349: No 3
#> height_minus_for_minus_age_z_minus_score insulin_autoantibodies
#> <num> <char>
#> 1: 1.46 No
#> 2: 1.46 No
#> 3: 1.46 No
#> 4: 1.46 No
#> 5: 1.46 No
#> ---
#> 3345: -0.25 No
#> 3346: -0.25 No
#> 3347: -0.25 No
#> 3348: -0.25 No
#> 3349: -0.25 No
#> insulinoma_minus_associated_protein_2_autoantibodies
#> <char>
#> 1: No
#> 2: No
#> 3: No
#> 4: No
#> 5: No
#> ---
#> 3345: No
#> 3346: No
#> 3347: No
#> 3348: No
#> 3349: No
#> islet_cell_autoantibodies linear_growth_during_1st_year_cm
#> <char> <num>
#> 1: No 29.83651
#> 2: No 29.83651
#> 3: No 29.83651
#> 4: No 29.83651
#> 5: No 29.83651
#> ---
#> 3345: No 31.48248
#> 3346: No 31.48248
#> 3347: No 31.48248
#> 3348: No 31.48248
#> 3349: No 31.48248
#> maternal_age_at_birth_year mean_linear_growth_during_1st_3_years_cm_year
#> <num> <num>
#> 1: 35.75342 16.77027
#> 2: 35.75342 16.77027
#> 3: 35.75342 16.77027
#> 4: 35.75342 16.77027
#> 5: 35.75342 16.77027
#> ---
#> 3345: 36.23288 16.47863
#> 3346: 36.23288 16.47863
#> 3347: 36.23288 16.47863
#> 3348: 36.23288 16.47863
#> 3349: 36.23288 16.47863
#> mean_weight_gain_during_1st_3_years_kg_year sex
#> <num> <char>
#> 1: 4.876532 Male
#> 2: 4.876532 Male
#> 3: 4.876532 Male
#> 4: 4.876532 Male
#> 5: 4.876532 Male
#> ---
#> 3345: 4.059528 Male
#> 3346: 4.059528 Male
#> 3347: 4.059528 Male
#> 3348: 4.059528 Male
#> 3349: 4.059528 Male
#> study_group type_1_diabetes_diagnosed
#> <char> <char>
#> 1: Antibiotics cohort No
#> 2: Antibiotics cohort No
#> 3: Antibiotics cohort No
#> 4: Antibiotics cohort No
#> 5: Antibiotics cohort No
#> ---
#> 3345: Three country cohort (Karelia) No
#> 3346: Three country cohort (Karelia) No
#> 3347: Three country cohort (Karelia) No
#> 3348: Three country cohort (Karelia) No
#> 3349: Three country cohort (Karelia) No
#> urban_or_rural_site weight_gain_during_1st_year_kg
#> <char> <num>
#> 1: Rural 7.886785
#> 2: Rural 7.886785
#> 3: Rural 7.886785
#> 4: Rural 7.886785
#> 5: Rural 7.886785
#> ---
#> 3345: Urban 8.942992
#> 3346: Urban 8.942992
#> 3347: Urban 8.942992
#> 3348: Urban 8.942992
#> 3349: Urban 8.942992
#> weight_minus_for_minus_age_z_minus_score
#> <num>
#> 1: 2.06
#> 2: 2.06
#> 3: 2.06
#> 4: 2.06
#> 5: 2.06
#> ---
#> 3345: 0.29
#> 3346: 0.29
#> 3347: 0.29
#> 3348: 0.29
#> 3349: 0.29
#> zinc_transporter_8_autoantibodies Sample_Id habitat host_body_habitat
#> <char> <int> <char> <char>
#> 1: No 3000150 Human Colon
#> 2: No 3102722 Human Colon
#> 3: No 3106237 Human Colon
#> 4: No 3106238 Human Colon
#> 5: No 3106239 Human Colon
#> ---
#> 3345: No 3117645 Human Colon
#> 3346: No 3117647 Human Colon
#> 3347: No 3119973 Human Colon
#> 3348: No 3119976 Human Colon
#> 3349: No 3116926 Human Colon
#> host_body_product host_body_site sample_type
#> <char> <char> <char>
#> 1: Feces Colon Stool
#> 2: Feces Colon Stool
#> 3: Feces Colon Stool
#> 4: Feces Colon Stool
#> 5: Feces Colon Stool
#> ---
#> 3345: Feces Colon Stool
#> 3346: Feces Colon Stool
#> 3347: Feces Colon Stool
#> 3348: Feces Colon Stool
#> 3349: Feces Colon Stool
getSampleMetadata(microbiomeData::DiabImmune, metadataVariables = c("age_months", "sex"))
#> Sample_Id Participant_Id participant_repeated_measure_Id age_months
#> <int> <char> <char> <int>
#> 1: 3000150 E000823 (Source) E000823_1 (Source) 1
#> 2: 3102722 E000823 (Source) E000823_10 (Source) 10
#> 3: 3106237 E000823 (Source) E000823_12 (Source) 12
#> 4: 3106238 E000823 (Source) E000823_13 (Source) 13
#> 5: 3106239 E000823 (Source) E000823_15 (Source) 15
#> ---
#> 3345: 3117645 T029922 (Source) T029922_14 (Source) 14
#> 3346: 3117647 T029922 (Source) T029922_16 (Source) 16
#> 3347: 3119973 T029922 (Source) T029922_19 (Source) 19
#> 3348: 3119976 T029922 (Source) T029922_22 (Source) 22
#> 3349: 3116926 T029922 (Source) T029922_7 (Source) 7
#> sex
#> <char>
#> 1: Male
#> 2: Male
#> 3: Male
#> 4: Male
#> 5: Male
#> ---
#> 3345: Male
#> 3346: Male
#> 3347: Male
#> 3348: Male
#> 3349: Male