print(paste(count(Prevention)," Prevention CTs,", count(Treatments)," Treatments CTs and ",count(Posttreatment)," Post-treatment CTs."))
```
## Export of data and viz
Data are exported in several formats. The list of all treatments is also exported assuming that treatments are separated by a '+' signe in the column treatment of the original db.
```{r}
source("coronalib.R")
library(reshape)
library(wordcloud)
library(ggplot2)
# Html format
# export of a corpus with treatments and outcomes
garg_export_with_html(Treatments,"Treatment") # exporte Treatmeant et Outcomes des essais cliniques de type Treatment
garg_export_with_html(AllData,"AllData") # exporte Treatmeant et Outcomes des essais cliniques de tous types
garg_export_treatments_with_html(AllData,"AllData") # exporte Treatmeant des essais cliniques de tous types
# export of the list of all types of treatments whatever the phase in the format Gargantext map list Gargantext V3 & V4
gargV4_export_treaments_list(AllData,"AllDb")
gargV3_export_treaments_list(AllData,"AllDb")
# Conversion of the tsv file into Gargantext readable tsv dile
# Seleciton of the kind of CT to export : All / Prevention / Treatment / Post-treatment
# Selection of the kind of informations to include in the main text to be processed by Gargantext (bastract column): Treatmeant and/or Outcomes
# simple txt export
garg_export_all_plain(Treatments,"Treatment") # export main information in plain text
garg_export_OnlyTreatments(Treatments,"Treatment") # export only treatments in plain text
garg_export_OnlyOutcomes(Treatments,"Treatment") # export only outcomes in plain text
garg_export_all_plain(AllData,"All") # export main information in plain text
# raw export (just to have specific maps)
garg_export_raw_treatments(AllData,"AllData") ## export only info relative to treatments without any formating.
# Some simple viz - Tag cloud of the treaments per category of CT
Some R script to process convert clinical trials tsv file into Gargantext readable file + other small script.
The main file to run is Process_CT_for_Gargantext.Rmd
Make shure that you have placed your database in the /Rscripts/data folder in the tsv format (separator = tabulation ; no delimiters) formated in UTF8.
When Process_CT_for_Gargantext.Rmd is ran, a new csv file is writen at the right place in /data to update the clinical trials descriptions.
x$abstract=paste("<a href='",df$Full.text.link,"' target='blank'>Link to study</a></br></br><b> ",df$Study.design," (</b>",df$Recruitment.status,")</br></br><b>TYPE OF PATIENTS:</b> ",df$Type.of.patients,"</br></br><b>",toupper(df$Pharmacological.treatment),"</b></br><i>Type: </i>",df$Treatment.type,"</br><i> Treatment name: </i>",str_replace_all(tolower(df$Treatment.name),"[[+]]"," + "),"</br></br><b>PRIMARY OUTCOME</b></br>",df$primary.outcome,"</br></br><b>",df$Center,"</b> (",df$Countries,")</br><b>N in this treatment group:</b> ",df$n.randomized.in.this.arm," </br><b>N in the trial: </b>",df$Total.sample.size)
x$abstract=paste("Link to study: ",df$Full.text.link," DESIGN: ",df$Study.design,", RECRUITEMENT STATUS: ",df$Recruitment.status,", TYPE OF PATIENTS: ",df$Type.of.patients," TREATMENT: ",toupper(df$Pharmacological.treatment),", TYPE: ",df$Treatment.type,", TREATMENT NAME: ",str_replace_all(tolower(df$Treatment.name),"[[+]]"," + "),", PRIMARY OUTCOME: ",df$primary.outcome,", CENTER: ",df$Center,", COUNTRY: ",df$Countries,", N in this treatment group: ",df$n.randomized.in.this.arm,", N in the trial: ",df$Total.sample.size)