library(knitr)

```{css reportcss, echo=FALSE}

.figure { width:80%!important; }

.figure img { display: block!important; width:80%!important; margin: auto!important; }

.title { color:steelblue!important }

.caption { color:grey!important; font-style: italic!important; }

img[alt~="Structure"] { display: block!important; width:70%!important; margin: auto!important; }

img[alt=" "] { display: block!important; width:30%!important; margin: auto!important; }

```r
#Extract the selected oligonucleotides names to print as a comma separated string
if (length(selected.oligos.db()) > 1) { #if more than one oligo, then use plural
  selected.oligos <- paste("oligonucleotides", paste(selected.oligos.db()[1:length(selected.oligos.db())-1], collapse=", "), "and", selected.oligos.db()[length(selected.oligos.db())])
} else { #else use singular 
  selected.oligos <- paste("oligonucleotide", paste(selected.oligos.db(), collapse=", "))
}
#Document title takes selected oligonucleotides values
title_var <- selected.oligos.db()

title: r title_var output: word_document: reference_docx: word-styles-reference.docx


#table of oligonucleotides properties (pageable)
db.info <- db.info() %>%
  filter(oligo %in% selected.oligos.db()) %>% #only display selected oligos data
  select(c('sequence', 'ext.coeff.260', 'DOI')) %>%
  magrittr::set_colnames(c('Sequence (5\' to 3\')', '$\\epsilon_{260 nm}~(M^{-1}cm^{-1})$', 'DOI'))

knitr::kable(db.info,
             escape = F) #DOI parsed in HTML reports

       

diagcap <- paste0('Structure diagram of ', selected.oligos.db())
knitr::include_graphics(paste0("https://raw.githubusercontent.com/EricLarG4/EricLarG4.github.io/master/media/schemes/4x/",selected.oligos.db(),".png"))
knitr::include_graphics("https://raw.githubusercontent.com/EricLarG4/EricLarG4.github.io/master/media/schemes/4x/Legend.png")

\newpage

     

#Extraction of the oligo concentration
conc.cd <- db.cd.select() %>%
  group_by(oligo) %>%
  filter(oligo == selected.oligos.db()) %>%
  ungroup() %>%
  select(con) %>%
  unique() %>%
  as.numeric()

#Extraction of the path length
path.cd <- db.cd.select() %>%
  group_by(oligo) %>%
  filter(oligo == selected.oligos.db()) %>%
  ungroup() %>%
  select(l) %>%
  unique() %>%
  as.numeric()


CDcap <- paste0('Circular dichroism spectra of the ', selected.oligos.db(), ' oligonucleotide (', conc.cd, ' μM), acquired at 25°C in ', path.cd, '-cm path-length cuvettes')
p.CD.db()+
  guides(shape = FALSE,
         colour = guide_legend(nrow = 2,
                               title = element_blank())) +
  theme(legend.position = 'bottom')

# theme(legend.position = 'bottom',
#       legend.text = element_text(size = 8),
#       legend.title = element_text(size = 9))

 

NMRcap <- paste('$^{1}$H-NMR spectrum of the', selected.oligos.db(), 'oligonucleotide, acquired at 25°C in', db.nmr.select()$buffer.id)
p.NMR.db()+
  theme(legend.position = 'none')

 

UVcap <- paste('Folded fraction of the', selected.oligos.db(), 'oligonucleotide as a function of temperature, determined by UV-melting ($\\lambda$ = 295 nm)')
p.UV.melting.db() +
  guides(colour=guide_legend(nrow = 2,
                             title = element_blank()))+
  theme(
    legend.position = 'bottom',
    legend.text = element_text(size = 8)
  )

\newpage

#controls whether MS section is knitted or not based on the use of the plotMS button
if(input$plotMS.db == 0) {
  print.option <- FALSE
} else {
  print.option <- TRUE
}
MScap <- paste('Native ESI-MS spectra of the', selected.oligos.db(), 'oligonucleotide (10 μM)')
MScap2 <- paste0('Native ESI-MS spectra of the ', selected.oligos.db(), ' oligonucleotide (10 μM), focused on the ', input$charge.select, '$^{-}$ charge state')
p.MS.db() +
  theme(
    legend.position = 'none',
    strip.text.x = element_blank(),
    strip.text.y = element_text(size = 7, face = 'bold', colour = 'grey25')
  ) +
  coord_cartesian(ylim = c(0,1.1))

 

p.MS.db.2() +
  theme(
    legend.position = 'none',
    strip.text.x = element_blank(),
    strip.text.y = element_text(size = 7, face = 'bold', colour = 'grey25')
  ) +
  coord_cartesian(ylim = c(0,1.1))


EricLarG4/g4dbr documentation built on Nov. 21, 2020, 8:37 p.m.