@@ -42,20 +42,20 @@ createTaxonTable <- function(dat, n=10){
4242 fixed = TRUE
4343 ))
4444 })) %> %
45- mutate(total_signatures = sapply(metaphlan_name , function (x )
45+ mutate(`Total Signatures` = sapply(metaphlan_name , function (x )
4646 .countTaxon(dat = dat , x = x , direction = " both" ))) %> %
47- mutate(increased_signatures = sapply(metaphlan_name , function (x )
47+ mutate(`Increased Signatures` = sapply(metaphlan_name , function (x )
4848 .countTaxon(dat = dat , x = x , direction = " increased" ))) %> %
49- mutate(decreased_signatures = sapply(metaphlan_name , function (x )
49+ mutate(`Decreased Signatures` = sapply(metaphlan_name , function (x )
5050 .countTaxon(dat = dat , x = x , direction = " decreased" ))) %> %
5151 mutate(Taxon = gsub(" .+\\ |" , " " , output $ metaphlan_name ))
5252
5353 output %> % separate(col = " Taxon" , into = c(" Taxonomic Level" , " Taxon Name" ), sep = " __" ) %> %
5454 mutate(`Taxonomic Level` = unname(dmap [`Taxonomic Level` ])) %> %
5555 rowwise() %> %
56- mutate( `Binomial Test pval` = .createBinomTestSummary(increased_signatures , total_signatures , wordy = FALSE )) %> %
56+ mutate( `Binomial Test pval` = .createBinomTestSummary(`Increased Signatures` , `Total Signatures` , wordy = FALSE )) %> %
5757 ungroup() %> %
58- relocate(`Taxon Name` , `Taxonomic Level` , total_signatures , increased_signatures , decreased_signatures , `Binomial Test pval` )
58+ relocate(`Taxon Name` , `Taxonomic Level` , `Total Signatures` , `Increased Signatures` , `Decreased Signatures` , `Binomial Test pval` )
5959}
6060
6161.countTaxon = function (dat , x , direction = c(" both" , " increased" , " decreased" )){
@@ -115,24 +115,24 @@ createStudyTable <- function(bsdb.df, includeAlso = NULL) {
115115 # Core of the change is in how study IDs are generated, see function in
116116 # simple.R. NB: the function also fixes DOI links as side effect, now.
117117
118- bsdb_with_StudyCodes .df <- .make_unique_study_ID(bsdb.df )
118+ bsdb_with_StudyIDs .df <- .make_unique_study_ID(bsdb.df )
119119
120120 # some dplyr-fu to summarize tables, with more recent syntax
121- study_table_fixed <- bsdb_with_StudyCodes .df %> %
122- group_by(`Study code ` ) %> %
121+ study_table_fixed <- bsdb_with_StudyIDs .df %> %
122+ group_by(`Study Identifier ` ) %> %
123123 reframe(
124- MaxCases = max(`Group 1 sample size` ),
125- MaxControls = max(`Group 0 sample size` ),
124+ Cases = max(`Group 1 sample size` ),
125+ Controls = max(`Group 0 sample size` ),
126126 across(
127127 all_of(
128128 c(" Study design" , " Condition" , " PMID" , " DOI" , " URL" , includeAlso )
129129 ),
130130 .fns = function (x )
131131 paste(unique(x ), collapse = " ; " )
132132 ),
133- N_signatures = n()
133+ `Number of signatures` = n()
134134 ) %> %
135- relocate(N_signatures , .after = Condition )
135+ relocate(`Number of signatures` , .after = Condition )
136136
137137 return (study_table_fixed )
138138}
@@ -147,10 +147,10 @@ globalVariables(
147147 " Study.Design" ,
148148 " Taxon Name" ,
149149 " Binomial Test pval" ,
150- " total_signatures " ,
150+ " Total Signatures " ,
151151 " Abundance in Group 1" ,
152- " decreased_signatures " ,
153- " increased_signatures " ,
152+ " Decreased Signatures " ,
153+ " Increased Signatures " ,
154154 " Taxonomic Level" ,
155155 " metaphlan_name" ,
156156 " Freq" ,
@@ -164,10 +164,10 @@ globalVariables(
164164 " PMID" ,
165165 " URL" ,
166166 " uniqueRank" ,
167- " Study code " ,
167+ " Study Identifier " ,
168168 " Group 0 sample size" ,
169169 " Group 1 sample size" ,
170- " N_signatures "
170+ " Number of signatures "
171171 )
172172)
173173
0 commit comments