SangerAlignment Level

SangerContig Level

SangerRead Level

library(sangeranalyseR)

Basic Information:

  • Output Directory : r params$outputDir
  • cat("<li>**Input Source : **  <span><i>", params$SangerAlignment@inputSource, "</i></span></li>")
    cat("<li>**Process Method : **  <span><i>", params$SangerAlignment@processMethod, "</i></span></li>")
    if (params$SangerAlignment@inputSource == "ABIF" && !is.null(params$SangerAlignment@ABIF_Directory)) {
        cat("<li>**Input ABIF Directory : **  <span><i>", params$SangerAlignment@ABIF_Directory, "</i></span></li>")
    } else if (params$SangerAlignment@inputSource == "FASTA" && !is.null(params$SangerAlignment@FASTA_File)){
        cat("<li>**Fasta File Name : **  <span><i>", params$SangerAlignment@FASTA_File, "</i></span></li>")
    }
    
    if (params$SangerAlignment@processMethod == "REGEX" && !is.null(params$SangerAlignment@REGEX_SuffixForward) && !is.null(params$SangerAlignment@REGEX_SuffixReverse)) {
          cat("<li>**Forward Reads Suffix Regex : **  <span><i>", params$SangerAlignment@REGEX_SuffixForward, "</i></span></li>")
          cat("<li>**Reverse Reads Suffix Regex : **  <span><i>", params$SangerAlignment@REGEX_SuffixReverse, "</i></span></li>")
    } else if (params$SangerAlignment@processMethod == "CSV" && !is.null(params$SangerAlignment@CSV_NamesConversion)) {
            cat("<li>**Names Conversion CSV file : **  <span><i>", params$SangerAlignment@CSV_NamesConversion, "</i></span></li>")
    } 
    


Contigs Consensus

Primary Sequence


if (params$colors == "default") {
  A_color = "#1eff00"
  T_color = "#ff7a7a"
  C_color = "#7ac3ff"
  G_color = "#c9c9c9"
  unknown_color = "purple"
} else if (params$colors == "cb_friendly") {
  A_color = rgb(122, 122, 122, max = 255)
  T_color = rgb(199, 199, 199, max = 255)
  C_color = rgb(0, 114, 178, max = 255)
  G_color = rgb(213, 94, 0, max = 255)
  unknown_color = rgb(204, 121, 167, max = 255)
} else {
  A_color = colors[1]
  T_color = colors[2]
  C_color = colors[3]
  G_color = colors[4]
  unknown_color = colors[5]
}
contigSeqsCon <- unlist(strsplit(as.character(params$SangerAlignment@contigsConsensus), ""))
contigSeqsConDF <- data.frame(t(data.frame(contigSeqsCon)), stringsAsFactors = FALSE)
colnames(contigSeqsConDF) <- substr(colnames(contigSeqsConDF), 2, 100)
rownames(contigSeqsConDF) <- NULL
AstyleList <- SetCharStyleList(contigSeqsConDF, "A", A_color)
TstyleList <- SetCharStyleList(contigSeqsConDF, "T", T_color)
CstyleList <- SetCharStyleList(contigSeqsConDF, "C", C_color)
GstyleList <- SetCharStyleList(contigSeqsConDF, "G", G_color)
styleList <- c(AstyleList, TstyleList, CstyleList, GstyleList)
suppressWarnings(suppressMessages(
    excelTable(data = contigSeqsConDF, defaultColWidth = 30,
               editable = FALSE, rowResize = FALSE,
               columnResize = FALSE, allowInsertRow = FALSE,
               allowInsertColumn = FALSE, allowDeleteRow = FALSE,
               allowDeleteColumn = FALSE, allowRenameColumn = FALSE,
               style = styleList, loadingSpin = TRUE, autoWidth = FALSE)
))


Contigs Alignment

browseSeqHTML <- file.path(params$outputDir, "Contigs_Alignment_BrowseSeqs.html")
BrowseSeqs(DNAStringSet(params$SangerAlignment@contigsAlignment),
           openURL=FALSE, htmlFile=browseSeqHTML)
shiny::includeHTML(browseSeqHTML)


Contigs Tree

if (length(params$SangerAlignment@contigsTree$tip.label) == 0) {
  cat("<p style='font-size: 13px; font-weight:bold'> The number of contigs is less than 3 or quality of reads are too low. 'Contigs Tree' cannot be created. </p>")
} else {
  plot(params$SangerAlignment@contigsTree) 
}




Contigs Reports

    if (!is.null(params$contigsFN)) {
      for (i in 1:length(params$contigsFN)){
          cat('<li style = "margin-top: 35px; font-weight: bold">')
          cat('<a style = "margin-top: -10px" role="button" class="btn btn-info" href="',   file.path(".", basename(dirname(params$contigsFN[[i]])), basename(params$contigsFN[[i]])), '">')
          cat(paste0('Go to Contig: "', basename(params$SangerAlignment@contigList[[i]]@contigName), '" Report'))
          cat('</a>\n') 
          cat('</li>')
      }
    }
    
if (is.null(params$contigsFN)) {
    cat("<p style='font-size: 13px; font-weight:bold'> 'includeSangerContig' is 'FALSE'. Contigs are not included in this report. </p>")
}




roblanf/sangeranalyseR documentation built on April 15, 2024, 12:44 a.m.