Analysis Surrounding HRP2 and HRP3 deletions
  • Home
  • Final Manuscript
  • Window Analysis
    • Windows
    • Running Haplotype Reconstruction on Windows
    • Genomic Locations Of Final Windows

    • Window analysis by coverage
    • Processing Coverage Initial Windows
    • Processing Coverage on Sub Windows

    • Window analysis of deletion patterns
    • Telomere healing
    • Processing Samples with HRP2 Deletions TARE1
    • Processing Samples with Chr11 Deletions TARE1
    • Processing Samples for chr13 TARE1 presence
    • pfmdr1 duplication
    • Processing Samples with pfhrp3 13-5++ deletion pattern

    • Final Coverage Windows
    • Processing Coverage on Sub Windows - final

    • Window analysis by sequence/variation
    • Plotting haplotype variation within regions

    • Analysis by SNP variant analysis
    • Calling variants and Estimating COI
    • Plotting BiAllelic Variant Plots
  • HB3/SD01 Longreads analysis
    • Set up
    • Creating Hybrid genomes

    • Spanning Raw Reads analysis
    • Processing Spanning Reads
    • SD01 spanning specific

    • HB3
    • Processing chr11 and chr13
    • Final Process Assembly

    • SD01
    • Running SD01 assemblies
    • Processing SD01 assemblies

    • Both
    • Illumina against HB3/SD01 Assemblies
    • Comparison To 3D7 Simplified View
  • rRNA Segmental Duplications

    • Chr11/13 Duplicated Region
    • Characterizing Duplicated Region
  • Related Genomic Regions Vis
    • Analysis
    • Finding shared regions genome wide
    • Mapping out surrounding Genes on Assembled Strains

    • Misc
    • Plotting HRPs Tandem Repeats
    • Info on all rRNA
  • Comparing to related Plasmodiums
    • Comparing to all 6 Plasmodium Laverania
    • Comparing to all 6 Plasmodium Laverania Gene Arrangements chr05,07,08,11,13
    • Comparing to HRP2/3 falciparum sequences
  • References
    • Getting Raw Data References
    • References
    • R Session and Commandline tools info

Contents

  • R code
  • R Version
  • Package Versions
  • NJH tools
    • Elucidator
      • Version
      • Current git commit
    • PathWeaver
      • Version
      • Current git commit

R Session Info

  • Show All Code
  • Hide All Code

  • View Source

R code

Common function used to help generate the analysis presented on this site

Code
#turn off messages and warnings and make it so output isn't prefixed by anything,
#default is to put "##" in front of all output for some reason
#also set tidy to true so code is wrapped properly 
knitr::opts_chunk$set(message=FALSE, warning=FALSE, comment = "", cache = F, fig.align = "center")
options(width = 200)
options(readr.show_col_types = FALSE)

packagesUsed = c("GGally", "DT", "ggplot2", "stringr", 
                 "tidyverse", "stringr", 'bookdown', 
                 'knitr', 'rmarkdown', "finalfit",
                  "heatmaply", "cowplot",
                 "fastmatch", "rwantshue", "lubridate", 
                 "plotly", "ggnewscale", "ggtree", "ggtreeExtra", "ComplexHeatmap", 
                 "dendextend", "magrittr", "ggpmisc", 
                 "ggthemes", "ggridges", "HaplotypeRainbows", "ggdist", 
                 "here")
# oldw <- getOption("warn")
# oldmessage <- getOption("message")
# options(warn = -1, message = -1) 
suppressMessages(lapply(packagesUsed, require, character.only = TRUE))
#loaded = lapply(packagesUsed, require, character.only = TRUE)
# options(warn = oldw, message = oldmessage)

myFormula= x~y
# commonly used functions  
`%!in%` <- Negate(`%in%`)
is.notna <-function(x){
  return(!is.na(x))
}
scheme <- iwanthue(seed = 42, force_init = TRUE) 
palettes <- ggthemes_data[["tableau"]][["color-palettes"]][["regular"]]


# ggplot themes 
transparentBackground = theme(
  panel.background = element_rect(fill='transparent'), #transparent panel bg
  plot.background = element_rect(fill='transparent', color=NA), #transparent plot bg
  panel.grid.major = element_blank(), #remove major gridlines
  panel.grid.minor = element_blank(), #remove minor gridlines
  legend.background = element_rect(color = NA, fill='transparent'), #transparent legend bg
  legend.box.background = element_rect(color = NA, fill='transparent') #transparent legend panel
)
sofonias_theme_noTransparentBackground = theme_bw() +
  theme(panel.grid.major = element_blank(),panel.grid.minor = element_blank() )+
  theme(axis.line.x = element_line(color="black", linewidth = 0.3),axis.line.y =
          element_line(color="black", linewidth = 0.3))+
  theme(text=element_text(size=12, family="Helvetica"))+
  theme(axis.text.y = element_text(size=12))+
  theme(axis.text.x = element_text(size=12)) +
  theme(legend.position = "bottom") + 
  theme(plot.title = element_text(hjust = 0.5))

sofonias_theme = sofonias_theme_noTransparentBackground +
  transparentBackground
sofonias_theme_backgroundTransparent = sofonias_theme

sofonias_theme_xRotate_noBackgroundTransparent = theme_bw() +
  theme(panel.grid.major = element_blank(),panel.grid.minor = element_blank() )+
  theme(axis.line.x = element_line(color="black", linewidth = 0.3),axis.line.y =
          element_line(color="black", linewidth = 0.3))+
  theme(text=element_text(size=12, family="Helvetica"))+
  theme(axis.text.y = element_text(size=12))+
  theme(axis.text.x = element_text(size=12)) +
  theme(legend.position = "bottom") + 
  theme(plot.title = element_text(hjust = 0.5)) + 
  theme(axis.text.x = element_text(size=12, angle = -90, vjust = 0.5, hjust = 0)) 

sofonias_theme_xRotate = sofonias_theme_xRotate_noBackgroundTransparent + 
  transparentBackground

sofonias_theme_xRotate_backgroundTransparent = sofonias_theme_xRotate




colorPalette_08 = c("#2271B2","#F748A5","#359B73","#F0E442","#D55E00","#3DB7E9","#E69F00","#000000")
colorPalette_12 = c("#E20134","#FF6E3A","#008DF9","#8400CD","#FFC33B","#9F0162","#009F81","#FF5AAF","#00FCCF","#00C2F9","#FFB2FD","#A40122")
colorPalette_15 = c("#F60239","#003C86","#EF0096","#9400E6","#009FFA","#008169","#68023F","#00DCB5","#FFCFE2","#FF71FD","#7CFFFA","#6A0213","#008607","#00E307","#FFDC3D")


# "#9E0242"
# "#A40122"


rowAnnoColorsMod_hrp3DeletionPattern = c(
  "13-11++" = "#8400CD",
  "11++/13-" = "#8400CD",
  "11/13-TARE1" = "#003C86",
  "13-TARE1" = "#003C86",
  "11/13-" = "#008DF9",
  "13-" = "#008DF9",
  "11-/13" = "#9F0162",
  "11-TARE1/13" = "#EF0096",
  "11-TARE1" = "#EF0096",
  "13++11-" = "#6A0213",
  "5++/13-" = "#FF6E3A", 
  "13-5++" = "#FF6E3A", 
  "8-TARE1" = "#00DCB5"
  #, "13++11-" = "#F60239"
)

# 5, 3, 7, 6, 6, 2, 8, 7, 3 
haplotypeRankColors = c(
  "-1" = "black",
  "1" = "#A40122",
  "2" = "#FF6E3A",
  "3" = "#008DF9",
  "4" = "#8400CD",
  "5" = "#FFC33B",
  "6" = "#00FCCF",
  "7" = "#009F81",
  "8" = "#FF5AAF"
)


continentColors = c(
  "AFRICA"  =   "#E69F00",
  "ASIA" =      "#F0E442",
  "OCEANIA"  =  "#F748A5",
  "S_AMERICA" = "#0072B2"
)

pfhrpsCallColors = c("pfhrp2-/pfhrp3+" = "#68023F", "pfhrp2-/pfhrp3-" = "#F60239", "pfhrp2+/pfhrp3-" = "#009FFA", "pfhrp2+/pfhrp3+" =  "#003C86")


createColorListFromDf <- function(df, colorPalette = colorPalette_12, iwanthudSeed = rnorm(1) * 100){
  colorList = list()
  for (dfColname in colnames(df)) {
    levels = sort(unique(df[[dfColname]]))
    scheme <- iwanthue(seed = iwanthudSeed, force_init = TRUE)
    if (length(levels) <= length(colorPalette_12)) {
      levelsCols = colorPalette_12[1:length(levels)]
    } else{
      levelsCols = scheme$hex(length(levels))
    }
    names(levelsCols) = levels
    colorList[[dfColname]] = levelsCols
  }
  return(colorList)
}

createDownloadLink <-function(fnp, linkName = ""){
  relToHere = sub(here(),"",normalizePath(getwd()), fixed = T)
  depth = stringr::str_count(relToHere, "/")
  prefix = ""
  if(depth > 0){
    prefix = paste0(paste0(rep("..",depth), collapse = "/"), "/")
  }
  if ("" == linkName) {
    linkName =  basename(fnp)
  }
  return(paste0("[", linkName, "]", "(", paste0(prefix, gsub(paste0(here(),"/"),"",normalizePath(fnp), fixed = T)), "){.downloadLink .btn .btn-info}" ) )
}

createImgLink <-function(fnp, linkName = ""){
  relToHere = sub(here(), "", normalizePath(getwd()), fixed = T)
  depth = stringr::str_count(relToHere, "/")
  prefix = ""
  if(depth > 0){
    prefix = paste0(paste0(rep("..",depth), collapse = "/"), "/")
  }
  if ("" == linkName) {
    linkName =  basename(fnp)
  }
  return(paste0("![", linkName, "]", "(", paste0(prefix, gsub(paste0(here(),"/"),"",normalizePath(fnp), fixed = T)), ")" ) )
}

create_dt <- function(x){
  DT::datatable(x,
                extensions = 'Buttons',
                options = list(dom = 'Blfrtip',
                               buttons = c('copy', 'csv', 'excel', 'pdf', 'print'),
                               lengthMenu = list(c(10,25,50,-1),
                                                 c(10,25,50,"All"))), 
                filter = "top")
}



create_tabsetOfHtmlWidgets <- function(htmlObjectsList) {
  zz <- textConnection("foo", "w")
  sink(zz)
  cat("::: {.panel-tabset}\n")
  iwalk(htmlObjectsList, ~ {
    cat('## ', .y, '\n\n')
    tempList = list()
    tempList[["item"]] = .x
    print(htmltools::tagList(tempList))
    cat('\n\n')
  })
  cat(":::\n")
  sink()
  close(zz)
  paste0(foo, collapse = "\n")
}


subRegionOrder = c("South America", "West Africa", "Central Africa", "East Africa", "Oceania-SEA")

R Version

 setting  value
 version  R version 4.4.1 (2024-06-14)
 os       macOS Sonoma 14.5
 system   x86_64, darwin20
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2024-06-19
 pandoc   3.2 @ /usr/local/bin/ (via rmarkdown)

Package Versions

The following packages were used in the analysis of the data

 package           * version date (UTC) lib source
 bookdown          * 0.39    2024-04-15 [1] CRAN (R 4.4.0)
 ComplexHeatmap    * 2.20.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
 cowplot           * 1.1.3   2024-01-22 [1] CRAN (R 4.4.0)
 dendextend        * 1.17.1  2023-03-25 [1] CRAN (R 4.4.0)
 DT                * 0.33    2024-04-04 [1] CRAN (R 4.4.0)
 fastmatch         * 1.1-4   2023-08-18 [1] CRAN (R 4.4.0)
 finalfit          * 1.0.7   2023-11-16 [1] CRAN (R 4.4.0)
 GGally            * 2.2.1   2024-02-14 [1] CRAN (R 4.4.0)
 ggdist            * 3.3.2   2024-03-05 [1] CRAN (R 4.4.0)
 ggnewscale        * 0.4.10  2024-02-08 [1] CRAN (R 4.4.0)
 ggplot2           * 3.5.1   2024-04-23 [1] CRAN (R 4.4.0)
 ggpmisc           * 0.5.6   2024-05-07 [1] CRAN (R 4.4.0)
 ggridges          * 0.5.6   2024-01-23 [1] CRAN (R 4.4.0)
 ggthemes          * 5.1.0   2024-02-10 [1] CRAN (R 4.4.0)
 ggtree            * 3.12.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
 ggtreeExtra       * 1.14.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
 HaplotypeRainbows * 1.0.0.0 2024-06-09 [1] Github (nickjhathaway/HaplotypeRainbows@5dc9b6f)
 heatmaply         * 1.5.0   2023-10-06 [1] CRAN (R 4.4.0)
 here              * 1.0.1   2020-12-13 [1] CRAN (R 4.4.0)
 knitr             * 1.47    2024-05-29 [1] CRAN (R 4.4.0)
 lubridate         * 1.9.3   2023-09-27 [1] CRAN (R 4.4.0)
 magrittr          * 2.0.3   2022-03-30 [1] CRAN (R 4.4.0)
 plotly            * 4.10.4  2024-01-13 [1] CRAN (R 4.4.0)
 rmarkdown         * 2.27    2024-05-17 [1] CRAN (R 4.4.0)
 rwantshue         * 0.0.3   2024-06-09 [1] Github (hoesler/rwantshue@07a58c7)
 stringr           * 1.5.1   2023-11-14 [1] CRAN (R 4.4.0)
 tidyverse         * 2.0.0   2023-02-22 [1] CRAN (R 4.4.0)

 [1] /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/library
Code
knitr::write_bib(c("ComplexHeatmap"), 'bibs/ComplexHeatmap.bib')
knitr::write_bib(c("ggplot2"),        'bibs/ggplot2.bib')
knitr::write_bib(c("tidyverse"),      'bibs/tidyverse.bib')

NJH tools

Elucidator

Version

1.1.1-dev

Current git commit

git@github.com:nickjhathaway/elucidator.git@9fe7174

PathWeaver

Version

1.0.0-dev

Current git commit

git@github.com:nickjhathaway/PathWeaver.git@13569fd
Source Code
---
title: R Session Info   
---


```{r setup, echo=FALSE, message=FALSE}
source("common.R")
```

## R code 

Common function used to help generate the analysis presented on this site 

```{r}
#| eval: false
#| output: false
#| file: common.R

```


## R Version{-} 

```{r, echo = F}
sessioninfo::platform_info()
```

## Package Versions{-}

The following packages were used in the analysis of the data  

```{r, echo = F}
sessioninfo::package_info(pkgs = packagesUsed) %>% filter(package %in% packagesUsed)

```


```{r}
knitr::write_bib(c("ComplexHeatmap"), 'bibs/ComplexHeatmap.bib')
knitr::write_bib(c("ggplot2"),        'bibs/ggplot2.bib')
knitr::write_bib(c("tidyverse"),      'bibs/tidyverse.bib')

```

## NJH tools  

### Elucidator  
#### Version  

```{bash, echo = F}
elucidator --dumpversion 
```

#### Current git commit  
```{bash, echo = F}
cd ~/hathaway/external/build/elucidator/develop/elucidator
echo $(git remote -v | egrep fetch  | sed 's/.*git@/git@/g'  | sed 's/ .*//g')"@"$(git rev-parse --short HEAD)
```

### PathWeaver  
#### Version  
```{bash, echo = F}
PathWeaver --dumpversion 
```

#### Current git commit  
```{bash, echo = F}
cd ~/hathaway/external/build/PathWeaver/develop/PathWeaver
echo $(git remote -v | egrep fetch  | sed 's/.*git@/git@/g'  | sed 's/ .*//g')"@"$(git rev-parse --short HEAD)
```