Commit a91967fc authored by khalid's avatar khalid
Browse files

Better export to pdf and force lagTime plot at start

parent 14f54f04
......@@ -6,7 +6,6 @@ library(XML)
library(rentrez)
library(shinycssloaders)
library(shinybusy)
#library(reticulate)
library("tm")
library("SnowballC")
......@@ -16,13 +15,14 @@ library(ggplot2)
require(ggridges)
require(gridExtra)
#library(shinythemes)
library(bslib)
synonymous <- read.table("./journal_synonyms.tsv", header=F, sep="\t", stringsAsFactors=F)
synonymous <- read.table("./journal_synonyms.tsv", header=F, quote="", sep="\t", stringsAsFactors=F)
#liste of all journals where ISEM researchers published there results since 2014
ISEMjournals <- read.table("./ISEM_journal_since_2014.txt", header=F, sep="\t", quote = '"', stringsAsFactors=F)
#ajouter les synonmymes de DAFNEE
ISEMjournals = rbind(ISEMjournals, synonymous)
......@@ -175,9 +175,10 @@ ui <- fluidPage(
sidebarLayout(position ='right',
sidebarPanel( width = 3,
conditionalPanel(condition="input.tabselected==2",
h6("DAFNEE Usage Index calculator"),
radioButtons("IndexMethod", label = h3("Calculate index as"),
choices = list("Author's papers listed In DAFNEE / Total papers" = 1, "Author's papers listed In DAFNEE / papers in curated ISEM list of journals since 2014" = 2), selected = 1),
h5("DAFNEE Usage Index calculator :"),
h6("Author's papers listed In DAFNEE / papers in the inspected list of journals (journals where ISEM authors publisher since 2014)"),
#radioButtons("IndexMethod", label = h3("Calculate index as"),
#choices = list("Author's papers listed In DAFNEE / Total papers" = 1, "Author's papers listed In DAFNEE / papers in curated ISEM list of journals since 2014" = 2), selected = 1),
textInput("nom", "Author last name", ""),
textInput("prenom", "Author first name", ""),
......@@ -248,12 +249,12 @@ observeEvent(input$NewPubmedAuthor,{
return(NULL)
}
# par défaut tous les journaux sont tagués maybe
# par défaut tous les journaux sont tagués not inspected
# s'ils sont dans la liste des journaux de l'ISEM depuis 2014 ils sont tagués no (qu'ils soient DAFNEE ou non)
# s'ils sont dans DAFNEE ou sysnonymes ils seront tagués ok
t = getPubmedPapiers(nom, prenom, maxPapers=100, "Bel-Kh.csv")
Ethical = rep("maybe", dim(t)[1])
Ethical = rep("not inspected", dim(t)[1])
inISEMjournals = toupper(trimws(t$journal)) %in% toupper(trimws(ISEMjournals[,1]))
Ethical[inISEMjournals] = "no"
indafnee = toupper(trimws(t$journal)) %in% DAFNEE
......@@ -275,11 +276,11 @@ observeEvent(input$ExtractISEMAuthor,{
t = ISEMpub[(stringi::stri_trans_general(toupper(trimws(ISEMpub$nom)), "Latin-ASCII") == nom & stringi::stri_trans_general(toupper(trimws(ISEMpub$prenom)), "Latin-ASCII")==prenom) , c(-1,-2,-3)]
# par défaut tous les journaux sont tagués maybe
# s'ils sont dans la liste des journaux de l'ISEM depuis 2014 ils sont tagués no (qu'ils soient DAFNEE ou non)
# par défaut tous les journaux sont tagués not inspected
# s'ils sont dans la liste des journaux de l'ISEM depuis 2014 ils sont d'abord tagués no (qu'ils soient DAFNEE ou non)
# s'ils sont dans DAFNEE ou sysnonymes ils seront tagués ok
Ethical = rep("maybe", dim(t)[1])
Ethical = rep("not inspected", dim(t)[1])
inISEMjournals = toupper(trimws(t$journal)) %in% toupper(trimws(ISEMjournals[,1]))
Ethical[inISEMjournals] = "no"
indafnee = toupper(trimws(t$journal)) %in% DAFNEE
......@@ -294,7 +295,9 @@ output$EthicJournals <- DT::renderDataTable({
datatable(ethicals, style = "bootstrap4", class = 'table-bordered table-condensed',
colnames = c("Journal", "Field", "Publisher", "Business model", "Institution", "Institution type", "Website","APC €uros", "Impact Factor", "PCI partnership"),
caption = "Click on a journal name to get its publications lag times from pubmed data (if available) since 2005 to present",
caption = htmltools::tags$caption( style = 'caption-side: top; text-align: center;',
htmltools::HTML("Click on a journal name to get its publications lag times from pubmed data (if available) since 2005 to present")
),
options = list( pageLength = 15,
dom = "Bfrtip",
buttons = list("copy", "csv", "excel", list(
......@@ -307,7 +310,7 @@ output$EthicJournals <- DT::renderDataTable({
columnDefs = list(list(width = '200px', targets = c(1)), list(width = '100px', targets = c(7))
)
), rownames= FALSE, escape=FALSE, filter = 'top',editable = F, selection = list(mode='single', target = 'row'),extensions = c( "Buttons"))
), rownames= FALSE, escape=FALSE, filter = 'top',editable = F, selection = list(mode='single', target = 'row', selected = 4),extensions = c( "Buttons"))
}, server = FALSE)
......@@ -413,13 +416,17 @@ output$shiny_table <- DT::renderDataTable({
if (is.null(this_table$table)) return()
datatable(this_table$table, style= "bootstrap4",class = 'table-bordered table-condensed',
caption = htmltools::tags$caption( style = 'caption-side: top; text-align: center;',
htmltools::HTML('DAFNEE academia-friendly Journals : <span style="color:forestgreen; font-size:18px"><i class="glyphicon glyphicon-thumbs-up"></i></span>&nbsp;&nbsp;&nbsp; not academia-friendly Journals : <span style="color:red; font-size:18px"><i class="glyphicon glyphicon-thumbs-down"></i></span>&nbsp;&nbsp;&nbsp; Journals not inspected : <span style="color:grey; font-size:18px"><i class="glyphicon glyphicon-eye-close"></i></span>' )
),
options = list( pageLength = 15,
dom = "Bfrtip",
language = list(emptyTable = 'Set author first and last names to get some data'),
buttons = list("copy", "csv", "excel", list(
extend = 'pdf',
pageSize = 'A4',
orientation = 'landscape'
orientation = 'landscape',
exportOptions = list(orthogonal = "export")
)
),
autoWidth = TRUE,
......@@ -438,7 +445,7 @@ output$shiny_table <- DT::renderDataTable({
' if(type === "display"){',
' var color = data === "ok" ? "forestgreen" : data === "no" ? "red" : "grey";',
' var gdata = data === "ok" ? "thumbs-up" : data === "no" ? "thumbs-down" : "eye-close"; ',
' return "<span style=\\\"color:" + color + "; font-size:18px\\\"><i class=\\\"glyphicon glyphicon-" + gdata + "\\\"></i></span>";',
' return "<span style=\\\"color:" + color + "; font-size:18px\\\"><i class=\\\"glyphicon glyphicon-" + gdata + "\\\"></i></span>";',
' } else {',
' return data;',
' }',
......@@ -454,19 +461,22 @@ output$shiny_table <- DT::renderDataTable({
))), editable = F, selection = list(mode='single', target = 'row'),extensions = c( "Buttons"))
}, server = FALSE)
output$ethicalityPlot <- renderPlot({
#here we will ignore journals not listed in ISEMjournals since 2014
nbDAFNEE = sum(this_table$table$`IN DAFNEE`=="ok")
nbISEMnotDAFNEE = sum(this_table$table$`IN DAFNEE`=="no")
if (input$IndexMethod == 1) # all papers
{
PercentEthical = (nbDAFNEE * 100) / length(this_table$table$`IN DAFNEE`)
ISEMethicIndex = ISEMdistrib$nbethics*100 / ISEMdistrib$totpubs
}
else #only those listed in ISEM journals since 2014
# if (input$IndexMethod == 1) # all papers
# {
# PercentEthical = (nbDAFNEE * 100) / length(this_table$table$`IN DAFNEE`)
# ISEMethicIndex = ISEMdistrib$nbethics*100 / ISEMdistrib$totpubs
# subtitle = "% of DAFNEE Journals among author's refs "
# }
# else #only those listed in ISEM journals since 2014
{
PercentEthical = (nbDAFNEE * 100) / (nbDAFNEE + nbISEMnotDAFNEE)
ISEMethicIndex = ISEMdistrib$nbethics*100 / ISEMdistrib$totISEMrated
subtitle = "% of DAFNEE Journals among author's refs in ISEM analysed journals"
}
df = data.frame(ethicIndex=ISEMethicIndex)
......@@ -477,34 +487,32 @@ output$ethicalityPlot <- renderPlot({
geom_vline(aes(xintercept=mean(ethicIndex)), color="blue", linetype="dashed")+
geom_text(aes(x=mean(ethicIndex), label="ISEM mean", y=8), colour="blue", angle=90, vjust = -1, text=element_text(size=10))+
geom_vline(aes(xintercept=PercentEthical), color="red", linetype="dashed")+
geom_text(aes(x=PercentEthical, label=paste0(auteur," ", isolate(this_table$origine)), y=8), colour="red", angle=90, vjust = 1.2, text=element_text(size=10))
geom_vline(aes(xintercept=PercentEthical), color="black", linetype="dotted")+
geom_text(aes(x=PercentEthical, label=paste0(auteur," ", isolate(this_table$origine)), y=8), colour="black", angle=90, vjust = 1.2, text=element_text(size=10))
if (toupper(trimws(isolate(input$nom))) %in% ISEMdistrib$personnel)
{
if (this_table$origine == "pubmed")
{
i = which(ISEMdistrib$personnel == toupper(trimws(isolate(input$nom))))
if (input$IndexMethod == 1) # all papers
{
userISEMethicIndex = ISEMdistrib$nbethics[i]*100 / ISEMdistrib$totpubs[i]
}
else
# if (input$IndexMethod == 1) # all papers
# {
# userISEMethicIndex = ISEMdistrib$nbethics[i]*100 / ISEMdistrib$totpubs[i]
# }
# else
{
userISEMethicIndex = ISEMdistrib$nbethics[i]*100 / ISEMdistrib$totISEMrated[i]
}
p<- p + geom_vline(aes(xintercept=userISEMethicIndex), color="green", linetype="dashed")+
p<- p + geom_vline(aes(xintercept=userISEMethicIndex), color="black", linetype="longdash")+
geom_text(aes(x=userISEMethicIndex, label=paste0(isolate(input$nom),' ISEM DB'), y=8), colour="lightgrey", angle=90, vjust = - 1, text=element_text(size=10))
}
}
p <- p + labs(title="Distribution of DAFNEE Usage Index among ISEM researchers",x="% of DAFNEE Journals among author's refs ", y = "Count")+ theme_classic()
p <- p + labs(title="Distribution of DAFNEE Usage Index among ISEM researchers",x=subtitle, y = "Count")+ theme_classic()
p
})
output$journalLags <- renderPlot({
s = input$EthicJournals_rows_selected
if (length(s)==0) {
......
......@@ -78,13 +78,13 @@
"Zoologica Scripta" "evolution/systematics" "Wiley" "hybrid" "Norwegian Academy of Science and Letters; Royal Swedish Academy of Sciences" "Uni/Gouv" "https://onlinelibrary.wiley.com/journal/14636409" "none" 2500 "2.603" "Frederic_Delsuc"
"Zoological Journal of the Linnean Society" "evolution/systematics" "Oxford University Press" "hybrid" "Linnean Society" "Society" "https://academic.oup.com/zoolinnean" "none" 2812 "2.824" "Frederic_Delsuc"
"Zoosystema" "evolution/systematics" "BioOne" "diamond_OA" "Museum National d'Histoire Naturelle" "Museum" "https://sciencepress.mnhn.fr/fr/periodiques/zoosystema" "none" 0 "0.434" "Frederic_Delsuc"
"Biological Reviews" "general" "Wiley" "hybrid" "Cambridge Philosophical Society" "Society" "https://onlinelibrary.wiley.com/journal/1469185x" "none" "3300" "10.7" "Carole_Smadja"
"Biological Reviews" "general" "Wiley" "hybrid" "Cambridge Philosophical Society" "Society" "https://onlinelibrary.wiley.com/journal/1469185x" "none" "3300" "10.7" "Carole_Smadja"
"Biology Letters" "general" "The Royal Society" "hybrid" "The Royal Society" "Society" "https://royalsocietypublishing.org/journal/rsbl" "none" 2040 "2.869" "Carole_Smadja"
"Biology Open" "general" "The Company of Biologists" "OA" "The Company of Biologists" "Non-profit" "https://journals.biologists.com/bio" "none" 1531 "2.029" "Carole_Smadja"
"Bioscience" "general" "Oxford University Press" "hybrid" "American Institute of Biological Sciences" "Non-profit" "https://academic.oup.com/bioscience" "none" 1883 "8.282" "Carole_Smadja"
"Comptes Rendus Biologies" "general" "Académie des Sciences" "diamond_OA" "Académie des Sciences" "Uni/Gouv" "https://comptes-rendus.academie-sciences.fr/biologies" "none" 0 "1.904" "Carole_Smadja"
"eLife" "general" "eLife Sciences Publications" "OA" "Howard Hughes Medical Institute; Max Planck Society; Wellcome Trust " "Non-profit" "https://elifesciences.org/" "none" 3000 "7.08" "Carole_Smadja"
"Journal of the Royal Society Interface" "general" "The Royal Society" "hybrid" "The Royal Society" "Society" "https://royalsocietypublishing.org/journal/rsif" "none" "2040" "3.748" "Carole_Smadja"
"eLife" "general" "eLife Sciences Publications" "OA" "Howard Hughes Medical Institute; Max Planck Society; Wellcome Trust " "Non-profit" "https://elifesciences.org/" "none" 3000 "7.08" "Carole_Smadja"
"Journal of the Royal Society Interface" "general" "The Royal Society" "hybrid" "The Royal Society" "Society" "https://royalsocietypublishing.org/journal/rsif" "none" "2040" "3.748" "Carole_Smadja"
"Peer Community In Registered Reports" "general" "Peer Community In" "diamond_OA" "Peer Community In" "Non-profit" "https://evolbiol.peercommunityin.org/" "none" 0 "NA" "Carole_Smadja"
"Philosophical Transactions of the Royal Society B" "general" "The Royal Society" "hybrid" "The Royal Society" "Society" "https://royalsocietypublishing.org/journal/rstb" "none" 2040 "5.68" "Carole_Smadja"
"PLoS Biology" "general" "Public Library of Sciences" "OA" "Public Library of Sciences" "Non-profit" "https://journals.plos.org/plosbiology/" "companion" 3272 "7.076" "Carole_Smadja"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment