diff --git a/content/projects/_index.md b/content/projects/_index.md new file mode 100644 index 0000000..867057c --- /dev/null +++ b/content/projects/_index.md @@ -0,0 +1,7 @@ +--- +title: Projects +view: 3 +--- + +- [planet](/planet): an R package for analysis of placental methylation data +- [Placental Methylome Browser](https://robinsonlab.shinyapps.io/Placental_Methylome_Browser/): A Robinson lab Shiny app that me and Yifan Yin created \ No newline at end of file diff --git a/content/projects/planet/404.html b/content/projects/planet/404.html new file mode 100644 index 0000000..dfc718f --- /dev/null +++ b/content/projects/planet/404.html @@ -0,0 +1,113 @@ + + + + + + + +Page not found (404) • planet + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ + +Content not found. Please use links in the navbar. + +
+ + + +
+ + + + +
+ + + + + + + + diff --git a/content/projects/planet/apple-touch-icon-120x120.png b/content/projects/planet/apple-touch-icon-120x120.png new file mode 100644 index 0000000..ed9fdd5 Binary files /dev/null and b/content/projects/planet/apple-touch-icon-120x120.png differ diff --git a/content/projects/planet/apple-touch-icon-152x152.png b/content/projects/planet/apple-touch-icon-152x152.png new file mode 100644 index 0000000..3418b33 Binary files /dev/null and b/content/projects/planet/apple-touch-icon-152x152.png differ diff --git a/content/projects/planet/apple-touch-icon-180x180.png b/content/projects/planet/apple-touch-icon-180x180.png new file mode 100644 index 0000000..65caae6 Binary files /dev/null and b/content/projects/planet/apple-touch-icon-180x180.png differ diff --git a/content/projects/planet/apple-touch-icon-60x60.png b/content/projects/planet/apple-touch-icon-60x60.png new file mode 100644 index 0000000..96b7f54 Binary files /dev/null and b/content/projects/planet/apple-touch-icon-60x60.png differ diff --git a/content/projects/planet/apple-touch-icon-76x76.png b/content/projects/planet/apple-touch-icon-76x76.png new file mode 100644 index 0000000..bffb3ae Binary files /dev/null and b/content/projects/planet/apple-touch-icon-76x76.png differ diff --git a/content/projects/planet/apple-touch-icon.png b/content/projects/planet/apple-touch-icon.png new file mode 100644 index 0000000..ebfc9ef Binary files /dev/null and b/content/projects/planet/apple-touch-icon.png differ diff --git a/content/projects/planet/articles/index.html b/content/projects/planet/articles/index.html new file mode 100644 index 0000000..edaa0ec --- /dev/null +++ b/content/projects/planet/articles/index.html @@ -0,0 +1,79 @@ + +Articles • planet + + +
+
+ + + +
+
+ + +
+

All vignettes

+

+ +
planet
+
+
+
+
+ + +
+ + + + + + + + diff --git a/content/projects/planet/articles/planet.html b/content/projects/planet/articles/planet.html new file mode 100644 index 0000000..8aae47a --- /dev/null +++ b/content/projects/planet/articles/planet.html @@ -0,0 +1,771 @@ + + + + + + + +planet • planet + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +
+

Installation +

+
+if(!requireNamespace("BiocManager", quietly = TRUE))
+    install.packages("BiocManager")
+BiocManager::install("planet")
+
+
+

Cell composition +

+

To infer cell composition on placental villi DNAm samples, we can +need to use placental reference cpgs (Yuan +2021). These are provided in this package as +plCellCpGsThird and plCellCpGsFirst for third +trimester (term) and first trimester samples, respectively.

+

In this example we are using term villi DNAm data, so we first load +the reference cpgs plCellCpGsThird. This is a data frame of +600 cpgs, with mean methylation levels for each cell type.

+
+# cell deconvolution packages
+library(minfi)
+library(EpiDISH)
+
+# data wrangling and plotting
+library(dplyr)
+library(ggplot2)
+library(tidyr)
+library(planet)
+
+# load example data
+data("plBetas")
+data("plCellCpGsThird")
+head(plCellCpGsThird)
+
##            Trophoblasts   Stromal  Hofbauer Endothelial      nRBC
+## cg10590657    0.1014098 0.9345796 0.8655285   0.8963641 0.8448382
+## cg14923398    0.1282030 0.8902107 0.9036769   0.9383641 0.9508709
+## cg05348366    0.1305697 0.9519820 0.8803082   0.9065136 0.9278057
+## cg17907628    0.1215249 0.9278777 0.8727841   0.8914412 0.9143601
+## cg26799656    0.1259953 0.9482014 0.8803863   0.8791004 0.9010419
+## cg11862144    0.1561991 0.9430855 0.9114967   0.9341671 0.9647331
+##            Syncytiotrophoblast
+## cg10590657          0.05460441
+## cg14923398          0.05383193
+## cg05348366          0.06546727
+## cg17907628          0.05325227
+## cg26799656          0.06823985
+## cg11862144          0.06044207
+

After our reference cpg data is loaded, we can estimate cell +composition by applying either the Constrained Projection approach +implemented by the R packages minfi or EpiDISH, or a non-constrained +approach by EpiDish. I demonstrate how to do both.

+
+

Minfi +

+
+houseman_estimates <- minfi:::projectCellType(
+    plBetas[rownames(plCellCpGsThird), ],
+    plCellCpGsThird,
+    lessThanOne = FALSE
+)
+
+head(houseman_estimates)
+
##            Trophoblasts    Stromal      Hofbauer Endothelial       nRBC
+## GSM1944936    0.1091279 0.04891919  0.000000e+00  0.08983998 0.05294062
+## GSM1944939    0.2299918 0.00000000 -1.806592e-19  0.07888007 0.03374149
+## GSM1944942    0.1934287 0.03483540  0.000000e+00  0.09260353 0.02929310
+## GSM1944944    0.2239896 0.06249135  1.608645e-03  0.11040693 0.04447951
+## GSM1944946    0.1894152 0.07935955  0.000000e+00  0.10587439 0.05407587
+## GSM1944948    0.2045124 0.07657717  0.000000e+00  0.09871149 0.02269798
+##            Syncytiotrophoblast
+## GSM1944936           0.6979477
+## GSM1944939           0.6377822
+## GSM1944942           0.6350506
+## GSM1944944           0.5467642
+## GSM1944946           0.6022329
+## GSM1944948           0.6085825
+
+
+

EpiDISH +

+
+# robust partial correlations
+epidish_RPC <- epidish(
+    beta.m = plBetas[rownames(plCellCpGsThird), ],
+    ref.m = plCellCpGsThird,
+    method = "RPC"
+)
+
+# CIBERSORT
+epidish_CBS <- epidish(
+    beta.m = plBetas[rownames(plCellCpGsThird), ],
+    ref.m = plCellCpGsThird,
+    method = "CBS"
+)
+
## 1
+
## 2
+
## 3
+
+# constrained projection (houseman 2012)
+epidish_CP <- epidish(
+    beta.m = plBetas[rownames(plCellCpGsThird), ],
+    ref.m = plCellCpGsThird,
+    method = "CP"
+)
+
## 1
+
## 2
+
## 3
+
## 4
+
## 5
+
## 6
+
## 7
+
## 8
+
## 9
+
## 10
+
## 11
+
## 12
+
## 13
+
## 14
+
## 15
+
## 16
+
## 17
+
## 18
+
## 19
+
## 20
+
## 21
+
## 22
+
## 23
+
## 24
+
+
+

Compare +

+

Below, I demonstrate how we can visually compare the different cell +composition estimates.

+
+data("plColors")
+
+# bind estimate data frames and reshape for plotting
+bind_rows(
+    houseman_estimates %>% as.data.frame() %>% mutate(algorithm = "CP (Houseman)"),
+    epidish_RPC$estF %>% as.data.frame() %>% mutate(algorithm = "RPC"),
+    epidish_CBS$estF %>% as.data.frame() %>% mutate(algorithm = "CBS"),
+    epidish_CP$estF %>% as.data.frame() %>% mutate(algorithm = "CP (EpiDISH)")
+) %>%
+    mutate(sample = rep(rownames(houseman_estimates), 4)) %>%
+    as_tibble() %>%
+    pivot_longer(
+        cols = -c(algorithm, sample),
+        names_to = "component",
+        values_to = "estimate"
+    ) %>%
+
+    # relevel for plot
+    mutate(component = factor(component,
+        levels = c(
+            "nRBC", "Endothelial", "Hofbauer",
+            "Stromal", "Trophoblasts",
+            "Syncytiotrophoblast"
+        )
+    )) %>%
+
+    # plot
+    ggplot(aes(x = sample, y = estimate, fill = component)) +
+    geom_bar(stat = "identity") +
+    facet_wrap(~algorithm, ncol = 1) +
+    scale_fill_manual(values = plColors) +
+    scale_y_continuous(
+        limits = c(-0.1, 1.1), breaks = c(0, 0.5, 1),
+        labels = scales::percent
+    ) +
+    theme(axis.text.x = element_text(angle = 90, vjust = 0.5)) +
+    coord_cartesian(ylim = c(0, 1)) +
+    labs(x = "", fill = "")
+

+

Some notes:

+
    +
  • Normalize your data with minfi::preprocessNoob and +BMIQ
  • +
  • Use all cell CpGs - if some are missing, estimates may vary
  • +
  • If your samples have been processed in a particular manner, +(e.g. sampling from maternal side) expect cell composition to reflect +that
  • +
+
+
+
+

Gestational age +

+
+

Example Data +

+

For demonstration, I use 24 samples from a placental DNAm dataset +from GEO, (GSE7519), +which contains samples collected in an Australian population. The DNA +methylation data (in betas) can be accessed with +data(plBetas) and corresponding sample information from +data(plPhenoData). Note that for demonstration purposes, +the cpgs have been filtered to a random ~10,000 CpGs, plus the CpGs used +in all of the functions from this package.

+
+# load example data
+data(plBetas)
+data(plPhenoData)
+
+dim(plBetas)
+
## [1] 13918    24
+
+#> [1] 13918    24
+head(plPhenoData)
+
+ +++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
sample_idsexdiseasegestation_wkga_RPCga_CPCga_RRPC
GSM1944936Malepreeclampsia3638.4652838.7286738.65396
GSM1944939Malepreeclampsia3233.0968034.2125232.62763
GSM1944942Femalepreeclampsia3234.3252035.0956533.32502
GSM1944944Malepreeclampsia3535.5093736.7151235.51295
GSM1944946Femalepreeclampsia3837.6391037.5793136.61721
GSM1944948Femalepreeclampsia3636.7705138.4263236.72150
+
+
+#> # A tibble: 6 x 7
+#>   sample_id  sex   disease   gestation_wk ga_RPC ga_CPC ga_RRPC
+#>   <fct>      <chr> <chr>            <dbl>  <dbl>  <dbl>   <dbl>
+#> 1 GSM1944936 Male  preeclam~           36   38.5   38.7    38.7
+#> 2 GSM1944939 Male  preeclam~           32   33.1   34.2    32.6
+#> 3 GSM1944942 Fema~ preeclam~           32   34.3   35.1    33.3
+#> 4 GSM1944944 Male  preeclam~           35   35.5   36.7    35.5
+#> 5 GSM1944946 Fema~ preeclam~           38   37.6   37.6    36.6
+#> 6 GSM1944948 Fema~ preeclam~           36   36.8   38.4    36.7
+

There are 3 gestational age clocks for placental DNA methylation data +from (Lee +2019):

+
    +
  1. Robust Placental Clock (RPC)
  2. +
  3. Control Placental Clock (CPC)
  4. +
  5. Refined Robust Placental Clock (RRPC)
  6. +
+

To predict gestational, we load the example data:

+
    +
  • +plBetas - DNAm data for 24 placental samples
  • +
  • +plPhenoData - Matching sample information
  • +
+
+
+

Predict Gestational Age +

+

To select the type of clock, we can specify the type +argument in predictAge.

+

We will apply all three clocks on this data, and add the predicted +age to the sample information data.frame, plPhenoData.

+
+plPhenoData <- plPhenoData %>%
+    mutate(
+        ga_RPC = predictAge(plBetas, type = "RPC"),
+        ga_CPC = predictAge(plBetas, type = "CPC"),
+        ga_RRPC = predictAge(plBetas, type = "RRPC")
+    )
+
## 558 of 558 predictors present.
+
## 546 of 546 predictors present.
+
## 395 of 395 predictors present.
+

Note that the number of predictors (CpGs) that were used in our data +are printed. It’s important to take note if a significant number of +predictive CpGs are missing in your data, as this can affect the +predicted gestational age accuracy.

+

Next, I plot the difference between predicted and reported +gestational age, for each of the 3 gestational age predictors.

+
+plPhenoData %>%
+  
+    # reshape, to plot
+    pivot_longer(
+        cols = contains("ga"),
+        names_to = "clock_type",
+        names_prefix = "ga_",
+        values_to = "ga"
+    ) %>%
+
+    # plot code
+    ggplot(aes(x = gestation_wk, y = ga, col = disease)) +
+    geom_point() +
+    geom_smooth(method = "lm", se = FALSE) +
+    facet_wrap(~clock_type) +
+    theme(legend.position = "top") +
+    labs(x = "Reported GA (weeks)", y = "Inferred GA (weeks)", col = "")
+
## `geom_smooth()` using formula = 'y ~ x'
+

+
+
+
+

Ethnicity +

+

Before predicting ethnicity You can ensure that you have all features +using the ethnicityCpGs vector:

+
+data(ethnicityCpGs)
+all(ethnicityCpGs %in% rownames(plBetas))
+
## [1] TRUE
+
+results <- predictEthnicity(plBetas)
+
## 1860 of 1860 predictors present.
+
+results %>%
+    tail(8)
+
+ +++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Sample_IDPredicted_ethnicity_nothreshPredicted_ethnicityProb_AfricanProb_AsianProb_CaucasianHighest_Prob
GSM1944959AsianAsian0.01230730.95235440.03533830.9523544
GSM1944960CaucasianCaucasian0.01569610.15952130.82478270.8247827
GSM1944961AsianAsian0.02084210.89545180.08370610.8954518
GSM1944962CaucasianCaucasian0.00092760.00088010.99819230.9981923
GSM1944963CaucasianCaucasian0.00226350.00280070.99493580.9949358
GSM1944964CaucasianCaucasian0.00659730.01120130.98220140.9822014
GSM1944965CaucasianCaucasian0.00215780.00241960.99542260.9954226
GSM1944966CaucasianCaucasian0.00113970.00176510.99709520.9970952
+
+

predictEthnicity returns probabilities corresponding to +each ethnicity for each sample (e.g Prob_Caucasian, +Prob_African, Prob_Asian). This applies a +glmnet model described in (Yuan +2019). A final classification is determined in two ways:

+
    +
  1. Predicted_ethnicity_nothresh - returns a +classification corresponding to the highest class-specific +probability.

  2. +
  3. Predicted_ethnicity - if the highest class-specific +probability is below 0.75, then the the sample is assigned +an Amibiguous label. This threshold can be adjusted with +the threshold argument. Samples with this label might +require special attention in downstream analyses.

  4. +
+
+results %>%
+    ggplot(aes(
+        x = Prob_Caucasian, y = Prob_African,
+        col = Predicted_ethnicity
+    )) +
+    geom_point(alpha = 0.7) +
+    coord_cartesian(xlim = c(0, 1), ylim = c(0, 1)) +
+    scale_x_continuous(labels = scales::percent) +
+    scale_y_continuous(labels = scales::percent) +
+    labs(x = "P(Caucasian)", y = "P(African)")
+

+
+results %>%
+    ggplot(aes(
+        x = Prob_Caucasian, y = Prob_Asian,
+        col = Predicted_ethnicity
+    )) +
+    geom_point(alpha = 0.7) +
+    coord_cartesian(xlim = c(0, 1), ylim = c(0, 1)) +
+    scale_x_continuous(labels = scales::percent) +
+    scale_y_continuous(labels = scales::percent) +
+    labs(x = "P(Caucasian)", y = "P(Asian)")
+

+

We can’t compare this to self-reported ethnicity as it is +unavailable. But we know these samples were collected in Sydney, +Australia, and are therefore likely mostly European with some East Asian +participants.

+
+table(results$Predicted_ethnicity)
+
## 
+##     Asian Caucasian 
+##         2        22
+

A note on adjustment in differential methylation +analysis

+

Because ‘Ambiguous’ samples might have different mixtures of +ancestries, it might be inadequate to adjust for them as one group in an +analysis of admixed populations (e.g. 50/50 Asian/African should not be +considered the same group as 50/50 Caucasian/African). One solution +would be to simply remove these samples. Another would be to adjust for +the raw probabilities-in this case, use only two of the three +probabilities, since the third will be redundant (probabilities sum to +1). If sample numbers are large enough in each group, stratifying +downstream analyses by ethnicity might also be a valid option.

+
+ +
+

Session Info +

+ +
## R version 4.3.2 (2023-10-31 ucrt)
+## Platform: x86_64-w64-mingw32/x64 (64-bit)
+## Running under: Windows 11 x64 (build 22631)
+## 
+## Matrix products: default
+## 
+## 
+## locale:
+## [1] LC_COLLATE=English_United States.utf8 
+## [2] LC_CTYPE=English_United States.utf8   
+## [3] LC_MONETARY=English_United States.utf8
+## [4] LC_NUMERIC=C                          
+## [5] LC_TIME=English_United States.utf8    
+## 
+## time zone: America/Los_Angeles
+## tzcode source: internal
+## 
+## attached base packages:
+## [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
+## [8] methods   base     
+## 
+## other attached packages:
+##  [1] planet_1.9.4                tidyr_1.3.1                
+##  [3] ggplot2_3.4.4               dplyr_1.1.4                
+##  [5] EpiDISH_2.18.0              minfi_1.48.0               
+##  [7] bumphunter_1.44.0           locfit_1.5-9.8             
+##  [9] iterators_1.0.14            foreach_1.5.2              
+## [11] Biostrings_2.70.2           XVector_0.42.0             
+## [13] SummarizedExperiment_1.32.0 Biobase_2.62.0             
+## [15] MatrixGenerics_1.14.0       matrixStats_1.2.0          
+## [17] GenomicRanges_1.54.1        GenomeInfoDb_1.38.6        
+## [19] IRanges_2.36.0              S4Vectors_0.40.2           
+## [21] BiocGenerics_0.48.1        
+## 
+## loaded via a namespace (and not attached):
+##   [1] RColorBrewer_1.1-3        rstudioapi_0.15.0        
+##   [3] jsonlite_1.8.8            magrittr_2.0.3           
+##   [5] GenomicFeatures_1.54.3    farver_2.1.1             
+##   [7] rmarkdown_2.25            BiocIO_1.12.0            
+##   [9] zlibbioc_1.48.0           vctrs_0.6.5              
+##  [11] locfdr_1.1-8              multtest_2.58.0          
+##  [13] memoise_2.0.1             Rsamtools_2.18.0         
+##  [15] DelayedMatrixStats_1.24.0 RCurl_1.98-1.14          
+##  [17] askpass_1.2.0             htmltools_0.5.7          
+##  [19] S4Arrays_1.2.0            progress_1.2.3           
+##  [21] curl_5.2.0                Rhdf5lib_1.24.2          
+##  [23] SparseArray_1.2.4         rhdf5_2.46.1             
+##  [25] sass_0.4.8                nor1mix_1.3-2            
+##  [27] bslib_0.6.1               plyr_1.8.9               
+##  [29] cachem_1.0.8              GenomicAlignments_1.38.2 
+##  [31] lifecycle_1.0.4           pkgconfig_2.0.3          
+##  [33] Matrix_1.6-1.1            R6_2.5.1                 
+##  [35] fastmap_1.1.1             GenomeInfoDbData_1.2.11  
+##  [37] digest_0.6.34             colorspace_2.1-0         
+##  [39] siggenes_1.76.0           reshape_0.8.9            
+##  [41] AnnotationDbi_1.64.1      RSQLite_2.3.5            
+##  [43] base64_2.0.1              labeling_0.4.3           
+##  [45] filelock_1.0.3            fansi_1.0.6              
+##  [47] mgcv_1.9-0                httr_1.4.7               
+##  [49] abind_1.4-5               compiler_4.3.2           
+##  [51] beanplot_1.3.1            proxy_0.4-27             
+##  [53] rngtools_1.5.2            withr_3.0.0              
+##  [55] bit64_4.0.5               BiocParallel_1.36.0      
+##  [57] DBI_1.2.2                 highr_0.10               
+##  [59] HDF5Array_1.30.1          biomaRt_2.58.2           
+##  [61] MASS_7.3-60               openssl_2.1.1            
+##  [63] rappdirs_0.3.3            DelayedArray_0.28.0      
+##  [65] rjson_0.2.21              tools_4.3.2              
+##  [67] glue_1.7.0                quadprog_1.5-8           
+##  [69] restfulr_0.0.15           nlme_3.1-163             
+##  [71] rhdf5filters_1.14.1       grid_4.3.2               
+##  [73] generics_0.1.3            gtable_0.3.4             
+##  [75] tzdb_0.4.0                class_7.3-22             
+##  [77] preprocessCore_1.64.0     data.table_1.15.0        
+##  [79] hms_1.1.3                 xml2_1.3.6               
+##  [81] utf8_1.2.4                pillar_1.9.0             
+##  [83] stringr_1.5.1             limma_3.58.1             
+##  [85] genefilter_1.84.0         splines_4.3.2            
+##  [87] BiocFileCache_2.10.1      lattice_0.21-9           
+##  [89] survival_3.5-7            rtracklayer_1.62.0       
+##  [91] bit_4.0.5                 GEOquery_2.70.0          
+##  [93] annotate_1.80.0           tidyselect_1.2.0         
+##  [95] knitr_1.45                xfun_0.42                
+##  [97] scrime_1.3.5              statmod_1.5.0            
+##  [99] stringi_1.8.3             yaml_2.3.8               
+## [101] evaluate_0.23             codetools_0.2-19         
+## [103] tibble_3.2.1              cli_3.6.2                
+## [105] xtable_1.8-4              munsell_0.5.0            
+## [107] jquerylib_0.1.4           Rcpp_1.0.12              
+## [109] dbplyr_2.4.0              png_0.1-8                
+## [111] XML_3.99-0.16.1           readr_2.1.5              
+## [113] blob_1.2.4                prettyunits_1.2.0        
+## [115] mclust_6.0.1              doRNG_1.8.6              
+## [117] sparseMatrixStats_1.14.0  bitops_1.0-7             
+## [119] scales_1.3.0              e1071_1.7-14             
+## [121] illuminaio_0.44.0         purrr_1.0.2              
+## [123] crayon_1.5.2              rlang_1.1.2              
+## [125] KEGGREST_1.42.0
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-10-1.png b/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-10-1.png new file mode 100644 index 0000000..4d7259e Binary files /dev/null and b/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-10-2.png b/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-10-2.png new file mode 100644 index 0000000..e57bd8c Binary files /dev/null and b/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-10-2.png differ diff --git a/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-5-1.png b/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..ca9f92e Binary files /dev/null and b/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-8-1.png b/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-8-1.png new file mode 100644 index 0000000..ce9e7e2 Binary files /dev/null and b/content/projects/planet/articles/planet_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/content/projects/planet/articles/planet_files/header-attrs-2.25/header-attrs.js b/content/projects/planet/articles/planet_files/header-attrs-2.25/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/content/projects/planet/articles/planet_files/header-attrs-2.25/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/content/projects/planet/authors.html b/content/projects/planet/authors.html new file mode 100644 index 0000000..d797a09 --- /dev/null +++ b/content/projects/planet/authors.html @@ -0,0 +1,145 @@ + +Authors and Citation • planet + + +
+
+ + + +
+
+
+ + + +
  • +

    Victor Yuan. Author, maintainer. +

    +
  • +
  • +

    Wendy P. Robinson. Contributor. +

    +
  • +
+
+
+

Citation

+ Source: inst/CITATION +
+
+ + +

Yuan V (2024). +Placental DNA methylation analysis tools. +doi:10.18129/B9.bioc.planet, https://github.com/wvictor14/planet - R package version 1.9.4, http://www.bioconductor.org/packages/planet. +

+
@Manual{,
+  title = {Placental DNA methylation analysis tools},
+  author = {Victor Yuan},
+  year = {2024},
+  url = {http://www.bioconductor.org/packages/planet},
+  note = {https://github.com/wvictor14/planet - R package version 1.9.4},
+  doi = {10.18129/B9.bioc.planet},
+}
+

Yuan V, Price M, Del Gobbo G, Mostafavi S, Cox B, Binder A, Michels K, Marsit C, Robinson W (2019). +“Accurate ethnicity prediction from placental DNA methylation data.” +BMC Epigenetics & Chromatin. +doi:10.1186/s13072-019-0296-3, https://epigeneticsandchromatin.biomedcentral.com/articles/10.1186/s13072-019-0296-3. +

+
@Article{,
+  title = {Accurate ethnicity prediction from placental DNA methylation data},
+  author = {Victor Yuan and Magda E. Price and Giulia {Del Gobbo} and Sara Mostafavi and Brian Cox and Alexandra M. Binder and Karin B. Michels and Carmen Marsit and Wendy P. Robinson},
+  year = {2019},
+  journal = {BMC Epigenetics & Chromatin},
+  doi = {10.1186/s13072-019-0296-3},
+  url = {https://epigeneticsandchromatin.biomedcentral.com/articles/10.1186/s13072-019-0296-3},
+}
+

Lee Y, Choufani S, Weksberg R, Wilson S, Yuan V, Burt A, Marsit C, Lu A, Ritz B, Bohlin J, Gjessing H, Harris J, Magnus P, Binder A, Robinson W, Jugessur A, Horvath S (2019). +“Placental epigenetic clocks: estimating gestational age using placental DNA methylation levels.” +Aging (Albany NY). +doi:10.18632/aging.102049, https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6628997/. +

+
@Article{,
+  title = {Placental epigenetic clocks: estimating gestational age using placental DNA methylation levels},
+  author = {Yunsung Lee and Sanaa Choufani and Rosanna Weksberg and Samantha L. Wilson and Victor Yuan and Amber Burt and Carmen Marsit and Ake T. Lu and Beate Ritz and Jon Bohlin and Hakon K. Gjessing and Jennifer R. Harris and Per Magnus and Alexandra M. Binder and Wendy P. Robinson and Astanand Jugessur and Steve Horvath},
+  year = {2019},
+  journal = {Aging (Albany NY)},
+  doi = {10.18632/aging.102049},
+  url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6628997/},
+}
+

Yuan V, Hui D, Penaherrera M, Beristain A, Robinson W (2021). +“Cell-specific characterization of the placental methylome.” +BMC Genomics. +doi:10.1186/s12864-020-07186-6, https://bmcgenomics.biomedcentral.com/articles/10.1186/s12864-020-07186-6. +

+
@Article{,
+  title = {Cell-specific characterization of the placental methylome},
+  author = {Victor Yuan and Desmond Hui and Maria S. Penaherrera and Alexander G. Beristain and Wendy P. Robinson},
+  year = {2021},
+  journal = {BMC Genomics},
+  doi = {10.1186/s12864-020-07186-6},
+  url = {https://bmcgenomics.biomedcentral.com/articles/10.1186/s12864-020-07186-6},
+}
+ +
+ +
+ + + +
+ + + + + + + + diff --git a/content/projects/planet/bootstrap-toc.css b/content/projects/planet/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/content/projects/planet/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/content/projects/planet/bootstrap-toc.js b/content/projects/planet/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/content/projects/planet/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/content/projects/planet/docsearch.css b/content/projects/planet/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/content/projects/planet/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/content/projects/planet/docsearch.js b/content/projects/planet/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/content/projects/planet/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/content/projects/planet/favicon-16x16.png b/content/projects/planet/favicon-16x16.png new file mode 100644 index 0000000..4114e1d Binary files /dev/null and b/content/projects/planet/favicon-16x16.png differ diff --git a/content/projects/planet/favicon-32x32.png b/content/projects/planet/favicon-32x32.png new file mode 100644 index 0000000..0417849 Binary files /dev/null and b/content/projects/planet/favicon-32x32.png differ diff --git a/content/projects/planet/favicon.ico b/content/projects/planet/favicon.ico new file mode 100644 index 0000000..92dc883 Binary files /dev/null and b/content/projects/planet/favicon.ico differ diff --git a/content/projects/planet/index.html b/content/projects/planet/index.html new file mode 100644 index 0000000..dbbabc2 --- /dev/null +++ b/content/projects/planet/index.html @@ -0,0 +1,258 @@ + + + + + + + +Placental DNA methylation analysis tools • planet + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    +
    +
    + + + +

    planet is an R package for inferring ethnicity (1), gestational age (2), and cell composition (3) from placental DNA methylation data.

    +

    See full documentation at https://victor.rbind.io/planet

    +
    +

    Installation +

    +

    Latest Bioconductor release

    +
    +if(!requireNamespace("BiocManager", quietly = TRUE))
    +    install.packages("BiocManager")
    +BiocManager::install("planet")
    +

    Or the development version of planet:

    +
    +devtools::install_github('wvictor14/planet')
    +
    +
    +

    Usage +

    +

    See vignettes for more detailed usage.

    +
    +

    Example Data +

    +

    All functions in this package take as input DNAm data the 450k and EPIC DNAm microarray. For best performance I suggest providing unfiltered data normalized with noob and BMIQ. A processed example dataset, plBetas, is provided to show the format that this data should be in. The output of all planet functions is a data.frame.

    +

    A quick example of each major function is illustrated with this example data:

    +
    +library(minfi)
    +library(planet)
    +
    +#load example data
    +data(plBetas)
    +data(plPhenoData) # sample information
    +
    +
    +

    Predict Ethnicity +

    +
    +predictEthnicity(plBetas) %>%
    +  head()
    +#> 1860 of 1860 predictors present.
    +#> # A tibble: 6 × 7
    +#>   Sample_ID  Predicted_ethnicity_n…¹ Predicted_ethnicity Prob_African Prob_Asian
    +#>   <chr>      <chr>                   <chr>                      <dbl>      <dbl>
    +#> 1 GSM1944936 Caucasian               Caucasian               0.00331    0.0164  
    +#> 2 GSM1944939 Caucasian               Caucasian               0.000772   0.000514
    +#> 3 GSM1944942 Caucasian               Caucasian               0.000806   0.000699
    +#> 4 GSM1944944 Caucasian               Caucasian               0.000883   0.000792
    +#> 5 GSM1944946 Caucasian               Caucasian               0.000885   0.00130 
    +#> 6 GSM1944948 Caucasian               Caucasian               0.000852   0.000973
    +#> # ℹ abbreviated name: ¹​Predicted_ethnicity_nothresh
    +#> # ℹ 2 more variables: Prob_Caucasian <dbl>, Highest_Prob <dbl>
    +
    +
    +

    Predict Gestational Age +

    +

    There are 3 gestational age clocks for placental DNA methylation data from Lee Y. et al. 2019 (2). To use a specific one, we can use the type argument in predictAge:

    +
    +predictAge(plBetas, type = 'RPC') %>%
    +  head()
    +#> 558 of 558 predictors present.
    +#> [1] 38.46528 33.09680 34.32520 35.50937 37.63910 36.77051
    +
    +
    +

    Predict Cell Composition +

    +

    Reference data to infer cell composition on placental villi DNAm samples (3) can be used with cell deconvolution from minfi or EpiDISH. These are provided in this package as plCellCpGsThird and plCellCpGsFirst for third trimester (term) and first trimester samples, respectively.

    +
    +data('plCellCpGsThird')
    +
    +minfi:::projectCellType(
    +  
    +  # subset your data to cell cpgs
    +  plBetas[rownames(plCellCpGsThird),], 
    +  
    +  # input the reference cpg matrix
    +  plCellCpGsThird,
    +  
    +  lessThanOne = FALSE) %>%
    +  
    +  head()
    +#>            Trophoblasts    Stromal      Hofbauer Endothelial       nRBC
    +#> GSM1944936    0.1091279 0.04891919  0.000000e+00  0.08983998 0.05294062
    +#> GSM1944939    0.2299918 0.00000000 -1.806592e-19  0.07888007 0.03374149
    +#> GSM1944942    0.1934287 0.03483540  0.000000e+00  0.09260353 0.02929310
    +#> GSM1944944    0.2239896 0.06249135  1.608645e-03  0.11040693 0.04447951
    +#> GSM1944946    0.1894152 0.07935955  0.000000e+00  0.10587439 0.05407587
    +#> GSM1944948    0.2045124 0.07657717  0.000000e+00  0.09871149 0.02269798
    +#>            Syncytiotrophoblast
    +#> GSM1944936           0.6979477
    +#> GSM1944939           0.6377822
    +#> GSM1944942           0.6350506
    +#> GSM1944944           0.5467642
    +#> GSM1944946           0.6022329
    +#> GSM1944948           0.6085825
    +
    +
    + +
    +
    + + +
    + + +
    + +
    +

    +

    Site built with pkgdown 2.0.7.

    +
    + +
    +
    + + + + + + + + diff --git a/content/projects/planet/link.svg b/content/projects/planet/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/content/projects/planet/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/content/projects/planet/logo.png b/content/projects/planet/logo.png new file mode 100644 index 0000000..04d271f Binary files /dev/null and b/content/projects/planet/logo.png differ diff --git a/content/projects/planet/news/index.html b/content/projects/planet/news/index.html new file mode 100644 index 0000000..4835a11 --- /dev/null +++ b/content/projects/planet/news/index.html @@ -0,0 +1,207 @@ + +Changelog • planet + + +
    +
    + + + +
    +
    + + +
    + +
    +
    + +
    • add stop controls to predictEthnicity +
    • +
    • added some tests
    • +
    • Bioconductor version bump
    • +
    +
    + +
    • Bioconductor version bump
    • +
    +
    + +
    • Bioconductor version bump
    • +
    +
    + +
    • Combined vignettes into a single one
    • +
    • Updated references
    • +
    +
    + +
    • Update reference for cell composition
    • +
    • Accepted into bioconductor, will be released in next cycle
    • +
    +
    + +
    • Vignettes updated with new function names
    • +
    • Removed minfi from examples since installation fails on some R versions
    • +
    • Moved .orig files to inst/script +
    • +
    • Moved data-raw/ contents to inst/script +
    • +
    • Moved man/figures/logo.png to inst/figures/logo.png, updated README
    • +
    • Lazydata set to false
    • +
    +
    + +
    • Improved vignette figure quality
    • +
    • Using github-actions check from biocthis +
    • +
    • Removed viridis from suggests
    • +
    • Rewrote many data man pages
    • +
    +
    + +
    • Final preparations for Bioconductor submission
    • +
    • Changed license to => GPL-2
    • +
    • More detailed attribution to glmnet
    • +
    • Renamed all functions to camel case convention, including functions, data, tests, documentation, vignettes
    • +
    • Added planet-deprecated.R +
    • +
    • +pl_infer_ethnicity() and pl_infer_age() now deprecated, replaced with predictEthnicity and predictAge, respectively.
    • +
    +
    + +
    • Removed minfi dependency
    • +
    • Addressed all fixable >line80 and 4 space indent notes from BiocCheck
    • +
    • Precompiling vignettes.
    • +
    +
    + +
    • added hexsticker
    • +
    • updated zenodo doi
    • +
    • added github actions
    • +
    • added cells color palette
    • +
    • favicons
    • +
    • Fixed in-text citations in README
    • +
    +
    + +
    • Reduced nbeta from 4 mb to 30 kb
    • +
    • Removed Matrix dependency from imports
    • +
    +
    + +
    +
    + +
    • Added vignettes
    • +
    • Reduced README significantly
    • +
    • Format documentation for Bioconductor style +
      • Added BiocViews to DESCRIPTION
      • +
      • Wrap lines max 80 characters
      • +
    • +
    • Create CITATION
    • +
    • Add Wendy Robinson to authors
    • +
    +
    + +
    • Fixes data export error on linux. See #6 +
    • +
    +
    + +
    • Export nbeta, instead of keeping internal
    • +
    • This fixes the install errors
    • +
    • On linux, data objects are not properly exported. See #2 +
    • +
    +
    + +
    • added syncytiotrophoblast reference cpgs
    • +
    +
    + +
    • added pl_cell_cpgs_first and pl_cell_cpgs_third for cell composition inference
    • +
    +
    + +
    • copied glmnet:::glment_softmax code to be compatible with new glmnet version
    • +
    +
    + +
    • Added pl_infer_age to infer gestational age using Lee Y et al. placental DNAm clock.
    • +
    • Modified example data to contain less probes and more samples, to save space but still be useful in the examples.
    • +
    +
    + +
    • Added a NEWS.md file to track changes to the package.
    • +
    +
    + + + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/pkgdown.css b/content/projects/planet/pkgdown.css new file mode 100644 index 0000000..80ea5b8 --- /dev/null +++ b/content/projects/planet/pkgdown.css @@ -0,0 +1,384 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body { + position: relative; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +/* Ensure in-page images don't run outside their container */ +.contents img { + max-width: 100%; + height: auto; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +dd { + margin-left: 3em; +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + display: none; + margin-left: 5px; + width: 20px; + height: 20px; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +h1:hover .anchor, +h2:hover .anchor, +h3:hover .anchor, +h4:hover .anchor, +h5:hover .anchor, +h6:hover .anchor { + display: inline-block; +} + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top; min-width: 100px} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre, code, pre code { + background-color: #f8f8f8; + color: #333; +} +pre, pre code { + white-space: pre-wrap; + word-break: break-all; + overflow-wrap: break-word; +} + +pre { + border: 1px solid #eee; +} + +pre .img, pre .r-plt { + margin: 5px 0; +} + +pre .img img, pre .r-plt img { + background-color: #fff; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.error {font-weight: bolder;} +.warning {font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} + +/* Section anchors --------------------------------- + Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 +*/ + +div.csl-bib-body { } +div.csl-entry { + clear: both; +} +.hanging-indent div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} diff --git a/content/projects/planet/pkgdown.js b/content/projects/planet/pkgdown.js new file mode 100644 index 0000000..6f0eee4 --- /dev/null +++ b/content/projects/planet/pkgdown.js @@ -0,0 +1,108 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $("div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/content/projects/planet/pkgdown.yml b/content/projects/planet/pkgdown.yml new file mode 100644 index 0000000..c803435 --- /dev/null +++ b/content/projects/planet/pkgdown.yml @@ -0,0 +1,7 @@ +pandoc: 3.1.1 +pkgdown: 2.0.7 +pkgdown_sha: ~ +articles: + planet: planet.html +last_built: 2024-02-21T19:23Z + diff --git a/content/projects/planet/reference/Rplot001.png b/content/projects/planet/reference/Rplot001.png new file mode 100644 index 0000000..17a3580 Binary files /dev/null and b/content/projects/planet/reference/Rplot001.png differ diff --git a/content/projects/planet/reference/ageCpGs.html b/content/projects/planet/reference/ageCpGs.html new file mode 100644 index 0000000..6a12d34 --- /dev/null +++ b/content/projects/planet/reference/ageCpGs.html @@ -0,0 +1,101 @@ + +Placental gestational age CpGs — ageCpGs • planet + + +
    +
    + + + +
    +
    + + +
    +

    Coefficients from the three placental gestational age clocks +from Lee Y et al. 2019.

    +

    Reference: Lee Y, Choufani S, Weksberg R, et al. Placental epigenetic +clocks: estimating gestational age using placental DNA methylation levels. +Aging (Albany NY). 2019;11(12):4238–4253. doi:10.18632/aging.102049. PMID: +31235674

    +
    + +
    +
    data(ageCpGs)
    +
    + +
    +

    Format

    +

    A tibble with coefficients for the RPC, +CPC, and refined RPC.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/ethnicityCpGs.html b/content/projects/planet/reference/ethnicityCpGs.html new file mode 100644 index 0000000..abec489 --- /dev/null +++ b/content/projects/planet/reference/ethnicityCpGs.html @@ -0,0 +1,98 @@ + +CpGs to predict ethnicity — ethnicityCpGs • planet + + +
    +
    + + + +
    +
    + + +
    +

    1860 CpGs used to predict ethnicity.

    +

    See Yuan et al. 2019 for +details.

    +
    + +
    +
    data(ethnicityCpGs)
    +
    + +
    +

    Format

    +

    A character vector of length 1860

    +
    + + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/figures/logo.png b/content/projects/planet/reference/figures/logo.png new file mode 100644 index 0000000..04d271f Binary files /dev/null and b/content/projects/planet/reference/figures/logo.png differ diff --git a/content/projects/planet/reference/index.html b/content/projects/planet/reference/index.html new file mode 100644 index 0000000..7a19467 --- /dev/null +++ b/content/projects/planet/reference/index.html @@ -0,0 +1,121 @@ + +Function reference • planet + + +
    +
    + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    ageCpGs

    +

    Placental gestational age CpGs

    +

    ethnicityCpGs

    +

    CpGs to predict ethnicity

    +

    planet-deprecated

    +

    Deprecated functions in planet

    +

    plBetas

    +

    Example placental DNA methylation data

    +

    plCellCpGsFirst

    +

    First trimester placental cell type coefficients

    +

    plCellCpGsThird

    +

    Third trimester placental cell type coefficients

    +

    plColors

    +

    A color palette for placental cell types

    +

    plPhenoData

    +

    Sample information accompanying pl_betas

    +

    predictAge()

    +

    Predicts gestational age using placental DNA methylation microarray +data

    +

    predictEthnicity()

    +

    Predicts ethnicity using placental DNA methylation microarray data

    + + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/pipe.html b/content/projects/planet/reference/pipe.html new file mode 100644 index 0000000..a988eba --- /dev/null +++ b/content/projects/planet/reference/pipe.html @@ -0,0 +1,99 @@ + +Pipe operator — %>% • planet + + +
    +
    + + + +
    +
    + + +
    +

    See magrittr::%>% for details.

    +
    + +
    +
    lhs %>% rhs
    +
    + +
    +

    Value

    + + +

    lhs

    +
    + +
    +

    Examples

    +
    
    +c(1, 2, 3) %>% sum()
    +#> [1] 6
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/plBetas.html b/content/projects/planet/reference/plBetas.html new file mode 100644 index 0000000..be329e2 --- /dev/null +++ b/content/projects/planet/reference/plBetas.html @@ -0,0 +1,129 @@ + +Example placental DNA methylation data — plBetas • planet + + +
    +
    + + + +
    +
    + + +
    +

    6 DNA methylation profiles from preeclampsia and healthy +control placentas. This data was downloaded from:

    "Genome wide DNA methylation profiling of normal and +preeclampsia placental samples. Illumina Infinium HumanMethylation450 +BeadChip (450K array) was used to obtain DNA methylation profiles in +placental samples. Samples included 16 samples from healthy uncomplicated +pregnancies and 8 samples from pregnancies affected by preeclampsia." - +from Yeung et al.

    +

    The DNA methylation data for 24 placental samples were downloaded from +GSE75196. +After normalizing using minfi::preprocessNoob and wateRmelon::BMIQ, +the data were filtered to 6/24 samples and 10,000 random CpGs + those CpGs +used in the gestational age clock and ethnicity classifier.

    +

    Reference: Yeung KR, Chiu CL, Pidsley R, Makris A et al. DNA methylation +profiles in preeclampsia and healthy control placentas. Am J Physiol Heart +Circ Physiol 2016 May 15;310(10):H1295-303. +PMID:26968548

    +
    + +
    +
    data(plBetas)
    +
    + +
    +

    Format

    +

    A matrix

    +
    + + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/plCellCpGsFirst.html b/content/projects/planet/reference/plCellCpGsFirst.html new file mode 100644 index 0000000..80b9c62 --- /dev/null +++ b/content/projects/planet/reference/plCellCpGsFirst.html @@ -0,0 +1,97 @@ + +First trimester placental cell type coefficients — plCellCpGsFirst • planet + + +
    +
    + + + +
    +
    + + +
    +

    First trimester coefficients for placental cellular +deconvolution from Yuan V et al. 2020.

    +

    Reference: to be edited +PMID: to be edited

    +
    + +
    +
    data(plCellCpGsFirst)
    +
    + +
    +

    Format

    +

    A matrix with coefficients for Trophoblasts, Stromal, +Endothelial, Hofbauer cells, nRBCs, and Syncytiotrophoblasts.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/plCellCpGsThird.html b/content/projects/planet/reference/plCellCpGsThird.html new file mode 100644 index 0000000..2436f2a --- /dev/null +++ b/content/projects/planet/reference/plCellCpGsThird.html @@ -0,0 +1,97 @@ + +Third trimester placental cell type coefficients — plCellCpGsThird • planet + + +
    +
    + + + +
    +
    + + +
    +

    Third trimester coefficients for placental cellular +deconvolution from Yuan V et al. 2020.

    +

    Reference: to be edited +PMID: to be edited

    +
    + +
    +
    data(plCellCpGsThird)
    +
    + +
    +

    Format

    +

    A matrix with coefficients for Trophoblasts, Stromal, +Endothelial, Hofbauer cells, nRBCs, and Syncytiotrophoblasts.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/plColors.html b/content/projects/planet/reference/plColors.html new file mode 100644 index 0000000..2634197 --- /dev/null +++ b/content/projects/planet/reference/plColors.html @@ -0,0 +1,107 @@ + +A color palette for placental cell types — plColors • planet + + +
    +
    + + + +
    +
    + + +
    +

    A nice color palette for placental cell types.

    +

    Used in Yuan V et al. 2020.

    +

    Contains colors for:

    • Syncytiotrophoblast

    • +
    • Trophoblast

    • +
    • Stromal

    • +
    • Hofbauer

    • +
    • Endothelial

    • +
    • nRBCs

    • +
    + +
    +
    data(plColors)
    +
    + +
    +

    Format

    +

    An object of class character of length 6.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/plPhenoData.html b/content/projects/planet/reference/plPhenoData.html new file mode 100644 index 0000000..3b76925 --- /dev/null +++ b/content/projects/planet/reference/plPhenoData.html @@ -0,0 +1,109 @@ + +Sample information accompanying pl_betas — plPhenoData • planet + + +
    +
    + + + +
    +
    + + +
    +

    Sex, disease, and gestational age information associated with +pl_betas.

    +

    Downloaded from the GEO accession:

    Reference: Yeung KR, Chiu CL, Pidsley R, Makris A et al. DNA methylation +profiles in preeclampsia and healthy control placentas. Am J Physiol Heart +Circ Physiol 2016 May 15;310(10):H1295-303. +PMID: 26968548

    +
    + +
    +
    data(plPhenoData)
    +
    + +
    +

    Format

    +

    A tibble

    +
    + + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/planet-deprecated.html b/content/projects/planet/reference/planet-deprecated.html new file mode 100644 index 0000000..84c7176 --- /dev/null +++ b/content/projects/planet/reference/planet-deprecated.html @@ -0,0 +1,91 @@ + +Deprecated functions in planet — planet-deprecated • planet + + +
    +
    + + + +
    +
    + + +
    +

    These functions still work but will be removed (defunct) in the next version.

    +
    + + +
    +

    Details

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/planet-package.html b/content/projects/planet/reference/planet-package.html new file mode 100644 index 0000000..3dedddf --- /dev/null +++ b/content/projects/planet/reference/planet-package.html @@ -0,0 +1,97 @@ + +planet: Placental DNA methylation analysis tools — planet-package • planet + + +
    +
    + + + +
    +
    + + +
    +

    +

    This package contains R functions to predict biological variables to from placnetal DNA methylation data generated from infinium arrays. This includes inferring ethnicity/ancestry, gestational age, and cell composition from placental DNA methylation array (450k/850k) data.

    +
    + + + +
    +

    Author

    +

    Maintainer: Victor Yuan victor.2wy@gmail.com

    +

    Other contributors:

    • Wendy P. Robinson [contributor]

    • +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/predictAge.html b/content/projects/planet/reference/predictAge.html new file mode 100644 index 0000000..b8867e3 --- /dev/null +++ b/content/projects/planet/reference/predictAge.html @@ -0,0 +1,157 @@ + +Predicts gestational age using placental DNA methylation microarray +data — predictAge • planet + + +
    +
    + + + +
    +
    + + +
    +

    predictAge Multiplies the coefficients from one of three +epigenetic gestational age clocks, by the corresponding CpGs in a supplied +betas data.frame.

    +
    + +
    +
    predictAge(betas, type = "RPC")
    +
    + +
    +

    Arguments

    +
    betas
    +

    An n by m dataframe of methylation values on the beta scale (0, +1), where the CpGs are arranged in rows, and samples in columns. Should +contain all CpGs used in each clock

    + + +
    type
    +

    One of the following: "RPC" (Robust), "CPC", (Control) or "RRPC" +(Refined Robust).

    + +
    +
    +

    Value

    + + +

    A vector of length m, containing inferred gestational age.

    +
    +
    +

    Details

    +

    Predicts gestational age using one of 3 placental gestational age +clocks: RPC, CPC, or refined RPC. Requires placental DNA methylation measured +on the Infinium 27K/450k/EPIC methylation array. Ensure as many predictive +CpGs are present in your data, otherwise accuracy may be impacted.

    +

    It's recommended that you have all predictive CpGs, otherwise accuracy may +vary.

    +
    + +
    +

    Examples

    +
    
    +# Load placenta DNAm data
    +library(dplyr)
    +#> 
    +#> Attaching package: 'dplyr'
    +#> The following objects are masked from 'package:stats':
    +#> 
    +#>     filter, lag
    +#> The following objects are masked from 'package:base':
    +#> 
    +#>     intersect, setdiff, setequal, union
    +data(plBetas)
    +data(plPhenoData)
    +
    +plPhenoData %>%
    +    mutate(inferred_ga = predictAge(plBetas, type = "RPC"))
    +#> 558 of 558 predictors present.
    +#> # A tibble: 24 × 8
    +#>    sample_id  sex    disease      gestation_wk ga_RPC ga_CPC ga_RRPC inferred_ga
    +#>    <fct>      <chr>  <chr>               <dbl>  <dbl>  <dbl>   <dbl>       <dbl>
    +#>  1 GSM1944936 Male   preeclampsia           36   38.5   38.7    38.7        38.5
    +#>  2 GSM1944939 Male   preeclampsia           32   33.1   34.2    32.6        33.1
    +#>  3 GSM1944942 Female preeclampsia           32   34.3   35.1    33.3        34.3
    +#>  4 GSM1944944 Male   preeclampsia           35   35.5   36.7    35.5        35.5
    +#>  5 GSM1944946 Female preeclampsia           38   37.6   37.6    36.6        37.6
    +#>  6 GSM1944948 Female preeclampsia           36   36.8   38.4    36.7        36.8
    +#>  7 GSM1944949 Female preeclampsia           37   38.2   38.1    37.7        38.2
    +#>  8 GSM1944950 Male   preeclampsia           35   35.9   38.0    35.1        35.9
    +#>  9 GSM1944951 Female normal/heal…           39   40.2   41.0    39.6        40.2
    +#> 10 GSM1944952 Male   normal/heal…           38   39.7   39.6    39.5        39.7
    +#> # ℹ 14 more rows
    +    
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/reference/predictEthnicity.html b/content/projects/planet/reference/predictEthnicity.html new file mode 100644 index 0000000..c006a91 --- /dev/null +++ b/content/projects/planet/reference/predictEthnicity.html @@ -0,0 +1,151 @@ + +Predicts ethnicity using placental DNA methylation microarray data — predictEthnicity • planet + + +
    +
    + + + +
    +
    + + +
    +

    Uses 1860 CpGs to predict self-reported ethnicity on placental +microarray data.

    +
    + +
    +
    predictEthnicity(betas, threshold = 0.75, force = FALSE)
    +
    + +
    +

    Arguments

    +
    betas
    +

    n x m dataframe of methylation values on the beta scale (0, 1), +where the variables are arranged in rows, and samples in columns. Should +contain all 1860 predictors and be normalized with NOOB and BMIQ.

    + + +
    threshold
    +

    A probability threshold ranging from (0, 1) to call samples +'ambiguous'. Defaults to 0.75.

    + + +
    force
    +

    run even if missing predictors. Default is FALSE.

    + +
    +
    +

    Value

    + + +

    a tibble

    + + +
    +
    +

    Details

    +

    Predicts self-reported ethnicity from 3 classes: Africans, Asians, +and Caucasians, using placental DNA methylation data measured on the Infinium +450k/EPIC methylation array. Will return membership probabilities that often +reflect genetic ancestry composition.

    +

    The input data should contain all 1860 predictors (cpgs) of the final GLMNET +model.

    +

    It's recommended to use the same normalization methods used on the training +data: NOOB and BMIQ.

    +
    + +
    +

    Examples

    +
    ## To predict ethnicity on 450k/850k samples
    +
    +# Load placenta DNAm data
    +data(plBetas)
    +predictEthnicity(plBetas)
    +#> 1860 of 1860 predictors present.
    +#> # A tibble: 24 × 7
    +#>    Sample_ID  Predicted_ethnicity_…¹ Predicted_ethnicity Prob_African Prob_Asian
    +#>    <chr>      <chr>                  <chr>                      <dbl>      <dbl>
    +#>  1 GSM1944936 Caucasian              Caucasian               0.00331    0.0164  
    +#>  2 GSM1944939 Caucasian              Caucasian               0.000772   0.000514
    +#>  3 GSM1944942 Caucasian              Caucasian               0.000806   0.000699
    +#>  4 GSM1944944 Caucasian              Caucasian               0.000883   0.000792
    +#>  5 GSM1944946 Caucasian              Caucasian               0.000885   0.00130 
    +#>  6 GSM1944948 Caucasian              Caucasian               0.000852   0.000973
    +#>  7 GSM1944949 Caucasian              Caucasian               0.000902   0.00176 
    +#>  8 GSM1944950 Caucasian              Caucasian               0.00174    0.00223 
    +#>  9 GSM1944951 Caucasian              Caucasian               0.000962   0.00231 
    +#> 10 GSM1944952 Caucasian              Caucasian               0.00287    0.00356 
    +#> # ℹ 14 more rows
    +#> # ℹ abbreviated name: ¹​Predicted_ethnicity_nothresh
    +#> # ℹ 2 more variables: Prob_Caucasian <dbl>, Highest_Prob <dbl>
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/content/projects/planet/sitemap.xml b/content/projects/planet/sitemap.xml new file mode 100644 index 0000000..b549599 --- /dev/null +++ b/content/projects/planet/sitemap.xml @@ -0,0 +1,60 @@ + + + + /404.html + + + /articles/index.html + + + /articles/planet.html + + + /authors.html + + + /index.html + + + /news/index.html + + + /reference/ageCpGs.html + + + /reference/ethnicityCpGs.html + + + /reference/index.html + + + /reference/pipe.html + + + /reference/planet-deprecated.html + + + /reference/planet-package.html + + + /reference/plBetas.html + + + /reference/plCellCpGsFirst.html + + + /reference/plCellCpGsThird.html + + + /reference/plColors.html + + + /reference/plPhenoData.html + + + /reference/predictAge.html + + + /reference/predictEthnicity.html + +