Functionality for obtaining meta-signatures for a column of interest

getMetaSignatures(
  df,
  column,
  direction = c("BOTH", "UP", "DOWN"),
  min.studies = 2,
  min.taxa = 5,
  comb.fun = sum,
  ...
)

Arguments

df

data.frame storing BugSigDB data. Typically obtained via importBugSigDB.

column

character. Column of interest. Need to be a valid column name of df.

direction

character. Indicates direction of abundance change for signatures to be included in the computation of meta-signatures. Use "UP" to restrict computation to signatures with increased abundance in the exposed group. Use "DOWN" to restrict to signatures with decreased abundance in the exposed group. Defaults to "BOTH" which will not filter signatures by direction of abundance change.

min.studies

integer. Minimum number of studies for a category in column to be included. Defaults to 2, which will then only compute meta-signatures for categories investigated by at least two studies.

min.taxa

integer. Minimum size for meta-signatures. Defaults to 5, which will then only include meta-signatures containing at least 5 taxa.

comb.fun

function. Function for combining sample size of the exposed group and sample size of the unexposed group into an overall study sample size. Defaults to sum which will simply add sample sizes of exposed and unexposed group.

...

additionals argument passed on to getSignatures.

Value

A list of meta-signatures, each meta-signature being a named numeric vector. Names are the taxa of the meta-signature, numeric values correspond to sample size weights associated with each taxon.

See also

getSignatures

Examples

 df <- importBugSigDB()
#> Using cached version from 2025-05-29 17:03:46

 # Body-site specific meta-signatures composed from signatures reported as both 
 # increased or decreased across all conditions of study:
 bs.meta.sigs <- getMetaSignatures(df, column = "Body site")

 # Condition-specific meta-signatures from fecal samples, increased
 # in conditions of study. Use taxonomic names instead of the default NCBI IDs:
 df.feces <- df[df$`Body site` == "Feces", ]
 cond.meta.sigs <- getMetaSignatures(df.feces, column = "Condition", 
                                     direction = "UP", tax.id.type = "taxname")

 # Inspect the results
 names(cond.meta.sigs)
#>   [1] "Acute lymphoblastic leukemia"                             
#>   [2] "Acute myeloid leukemia"                                   
#>   [3] "Age"                                                      
#>   [4] "Air pollution"                                            
#>   [5] "Alcohol consumption measurement"                          
#>   [6] "Allergic rhinitis"                                        
#>   [7] "Alzheimer's disease"                                      
#>   [8] "Anemia"                                                   
#>   [9] "Anorexia nervosa"                                         
#>  [10] "Antimicrobial agent"                                      
#>  [11] "Anxiety disorder"                                         
#>  [12] "Arthritis"                                                
#>  [13] "Asthma"                                                   
#>  [14] "Atopic eczema"                                            
#>  [15] "Attention deficit hyperactivity disorder"                 
#>  [16] "Autism"                                                   
#>  [17] "Autism spectrum disorder"                                 
#>  [18] "Autoimmune disease"                                       
#>  [19] "Autoimmune type 1 diabetes"                               
#>  [20] "Behcet's syndrome"                                        
#>  [21] "Bipolar disorder"                                         
#>  [22] "Body mass index"                                          
#>  [23] "Breast cancer"                                            
#>  [24] "Breastfeeding duration"                                   
#>  [25] "Breed"                                                    
#>  [26] "COVID-19"                                                 
#>  [27] "Cervical cancer"                                          
#>  [28] "Cesarean section"                                         
#>  [29] "Chronic constipation"                                     
#>  [30] "Chronic fatigue syndrome"                                 
#>  [31] "Chronic kidney disease"                                   
#>  [32] "Clinical treatment"                                       
#>  [33] "Clostridium difficile infection"                          
#>  [34] "Cognitive impairment"                                     
#>  [35] "Colitis"                                                  
#>  [36] "Colorectal adenoma"                                       
#>  [37] "Colorectal cancer"                                        
#>  [38] "Colorectal carcinoma"                                     
#>  [39] "Constipation"                                             
#>  [40] "Crohn's disease"                                          
#>  [41] "Delivery method"                                          
#>  [42] "Depressive disorder"                                      
#>  [43] "Diabetes mellitus"                                        
#>  [44] "Diabetic nephropathy"                                     
#>  [45] "Diabetic neuropathy"                                      
#>  [46] "Diabetic retinopathy"                                     
#>  [47] "Diarrhea"                                                 
#>  [48] "Diet"                                                     
#>  [49] "Diet measurement"                                         
#>  [50] "Eczema"                                                   
#>  [51] "Endometriosis"                                            
#>  [52] "Environmental exposure measurement"                       
#>  [53] "Environmental factor"                                     
#>  [54] "Epilepsy"                                                 
#>  [55] "Ethnic group"                                             
#>  [56] "Exercise"                                                 
#>  [57] "Fasting"                                                  
#>  [58] "Food allergy"                                             
#>  [59] "Gastric cancer"                                           
#>  [60] "Gestational diabetes"                                     
#>  [61] "Graft versus host disease"                                
#>  [62] "HIV infection"                                            
#>  [63] "HIV mother to child transmission"                         
#>  [64] "Health study participation"                               
#>  [65] "Hepatocellular carcinoma"                                 
#>  [66] "High fat diet"                                            
#>  [67] "Human immunodeficiency virus"                             
#>  [68] "Hypertension"                                             
#>  [69] "Increased intestinal transit time"                        
#>  [70] "Inflammatory bowel disease"                               
#>  [71] "Insulin sensitivity measurement"                          
#>  [72] "Iron deficiency anemia"                                   
#>  [73] "Irritable bowel syndrome"                                 
#>  [74] "Ischemic stroke"                                          
#>  [75] "Ketogenic diet"                                           
#>  [76] "Leukemia"                                                 
#>  [77] "Lifestyle measurement"                                    
#>  [78] "Lung cancer"                                              
#>  [79] "Major depressive disorder"                                
#>  [80] "Maternal milk"                                            
#>  [81] "Metastatic colorectal cancer"                             
#>  [82] "Milk allergic reaction"                                   
#>  [83] "Multiple myeloma"                                         
#>  [84] "Multiple sclerosis"                                       
#>  [85] "Non-Hodgkins lymphoma"                                    
#>  [86] "Non-alcoholic fatty liver disease"                        
#>  [87] "Non-alcoholic steatohepatitis"                            
#>  [88] "Nucleic acid extraction protocol"                         
#>  [89] "Obesity"                                                  
#>  [90] "Pancreatic carcinoma"                                     
#>  [91] "Parkinson's disease"                                      
#>  [92] "Phenotype"                                                
#>  [93] "Physical activity"                                        
#>  [94] "Polycystic ovary syndrome"                                
#>  [95] "Population"                                               
#>  [96] "Prediabetes syndrome"                                     
#>  [97] "Psoriasis"                                                
#>  [98] "Response to allogeneic hematopoietic stem cell transplant"
#>  [99] "Response to antibiotic"                                   
#> [100] "Response to antiviral drug"                               
#> [101] "Response to diet"                                         
#> [102] "Response to immunochemotherapy"                           
#> [103] "Response to ketogenic diet"                               
#> [104] "Response to metformin"                                    
#> [105] "Response to transplant"                                   
#> [106] "Rheumatoid arthritis"                                     
#> [107] "Sample treatment protocol"                                
#> [108] "Schizophrenia"                                            
#> [109] "Smoking behavior"                                         
#> [110] "Socioeconomic status"                                     
#> [111] "Stroke"                                                   
#> [112] "Traditional Chinese medicine type"                        
#> [113] "Transplant outcome measurement"                           
#> [114] "Treatment"                                                
#> [115] "Treatment outcome measurement"                            
#> [116] "Type I diabetes mellitus"                                 
#> [117] "Type II diabetes mellitus"                                
#> [118] "Ulcerative colitis"                                       
#> [119] "Unipolar depression"                                      
#> [120] "Urinary tract infection"                                  
#> [121] "Vitiligo"                                                 
 cond.meta.sigs["Bipolar disorder"]
#> $`Bipolar disorder`
#>                      Flavonifractor               Bilophila wadsworthia 
#>                         0.038958376                         0.038753332 
#>                     Lactobacillales                    Streptococcaceae 
#>                         0.032602009                         0.032602009 
#>        Allisonella histaminiformans                        Bacteroidota 
#>                         0.031166701                         0.031166701 
#>                   Leyella stercorea                Megamonas funiformis 
#>                         0.031166701                         0.031166701 
#>              Oxalobacter formigenes          Parabacteroides distasonis 
#>                         0.031166701                         0.031166701 
#>    Parasutterella excrementihominis                Phocaeicola plebeius 
#>                         0.031166701                         0.031166701 
#>             [Clostridium] symbiosum                         Actinomyces 
#>                         0.031166701                         0.023990158 
#>                    Actinomycetaceae                     Actinomycetales 
#>                         0.023990158                         0.023990158 
#>                      Alcaligenaceae                         Bacillaceae 
#>                         0.023990158                         0.023990158 
#>                             Bacilli                            Bacillus 
#>                         0.023990158                         0.023990158 
#>                  Corynebacteriaceae                     Corynebacterium 
#>                         0.023990158                         0.023990158 
#>                    Enterobacterales                 Gammaproteobacteria 
#>                         0.023990158                         0.023990158 
#>             Lacticaseibacillus zeae                       Peptoniphilus 
#>                         0.023990158                         0.023990158 
#>               Phascolarctobacterium                          Sutterella 
#>                         0.023990158                         0.023990158 
#>                     Veillonellaceae                    Lactobacillaceae 
#>                         0.023990158                         0.008611852 
#>                       Lactobacillus                       Streptococcus 
#>                         0.008611852                         0.008611852 
#>                    Alistipes ihumii                  Alistipes sp. HGB5 
#>                         0.007586631                         0.007586631 
#>            Azospirillum sp. CAG:239                         Bacteroides 
#>                         0.007586631                         0.007586631 
#>               Bacteroides eggerthii             Bacteroides sp. CAG:770 
#>                         0.007586631                         0.007586631 
#>                Bilophila sp. 4_1_30             Collinsella aerofaciens 
#>                         0.007586631                         0.007586631 
#>           Collinsella sp. 4_8_47FAA             Collinsella sp. CAG:166 
#>                         0.007586631                         0.007586631 
#>             Eubacterium sp. CAG:202        Firmicutes bacterium CAG:240 
#>                         0.007586631                         0.007586631 
#>         Firmicutes bacterium CAG:83           Fusobacterium sp. CAG:815 
#>                         0.007586631                         0.007586631 
#>               Mitsuokella multacida          Oscillibacter sp. KLE 1728 
#>                         0.007586631                         0.007586631 
#>          Oscillibacter sp. KLE 1745 Oscillospiraceae bacterium VE202-24 
#>                         0.007586631                         0.007586631 
#>                Paraprevotella clara             Phocaeicola coprophilus 
#>                         0.007586631                         0.007586631 
#>       Ruminococcaceae bacterium cv2               uncultured crAssphage 
#>                         0.007586631                         0.007586631 
#>