From 8954f542889b3d9eaa8e8aa8666b065bd773ea64 Mon Sep 17 00:00:00 2001 From: e24kara <68812669+e24kara@users.noreply.github.com> Date: Tue, 4 Aug 2020 23:24:31 +0430 Subject: [PATCH 1/6] Create blank.yml --- .github/workflows/blank.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/blank.yml diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml new file mode 100644 index 0000000..d6783e2 --- /dev/null +++ b/.github/workflows/blank.yml @@ -0,0 +1,33 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. From d48e10d437574f886cb86cb87bd624e5ed91d6be Mon Sep 17 00:00:00 2001 From: e24kara <68812669+e24kara@users.noreply.github.com> Date: Wed, 5 Aug 2020 00:17:14 +0430 Subject: [PATCH 2/6] Delete blank.yml --- .github/workflows/blank.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .github/workflows/blank.yml diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml deleted file mode 100644 index d6783e2..0000000 --- a/.github/workflows/blank.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. From 7ad8c1d859f9cfb771bcbb882cc345bfd7127fd6 Mon Sep 17 00:00:00 2001 From: EhsanKA Date: Wed, 5 Aug 2020 02:11:18 +0430 Subject: [PATCH 3/6] R CMD check succeeded --- DESCRIPTION | 23 ++++++++++++++++------- LICENSE | 0 NAMESPACE | 9 ++++++++- R/cleaning.R | 1 + R/colours.R | 6 +++++- R/plotting.R | 6 +++++- R/utils.R | 9 +++++++++ man/astir_paper_theme.Rd | 11 +++++++++++ man/cohort_colours.Rd | 11 +++++++++++ man/get_celltypes.Rd | 5 +++++ man/imc_exclusive_marker_score.Rd | 2 ++ man/patient_clinSubtype_colours.Rd | 13 +++++++++++++ man/patient_clinSubtype_colours_wagner.Rd | 11 +++++++++++ man/patient_response_colours.Rd | 11 +++++++++++ man/plotSpatial.Rd | 6 ++++++ man/to_csv.Rd | 2 ++ man/winsorize.Rd | 7 +++++++ vignettes/.gitignore | 2 ++ vignettes/taproom.Rmd | 19 +++++++++++++++++++ 19 files changed, 144 insertions(+), 10 deletions(-) create mode 100644 LICENSE create mode 100644 man/astir_paper_theme.Rd create mode 100644 man/cohort_colours.Rd create mode 100644 man/patient_clinSubtype_colours.Rd create mode 100644 man/patient_clinSubtype_colours_wagner.Rd create mode 100644 man/patient_response_colours.Rd create mode 100644 vignettes/.gitignore create mode 100644 vignettes/taproom.Rmd diff --git a/DESCRIPTION b/DESCRIPTION index 7c94981..3ae7e90 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,13 +3,13 @@ Title: Tools for spAtial PROteOmics Version: 0.1.0 Depends: R (>= 3.6) Authors@R: - person(given = "First", - family = "Last", + person(given = "Ehsan", + family = "Karimiara", role = c("aut", "cre"), - email = "first.last@example.com", + email = "e.karimiara@gmail.com", comment = c(ORCID = "YOUR-ORCID-ID")) Description: What the package does (one paragraph). -License: What license it uses +License: file LICENSE Encoding: UTF-8 LazyData: true Imports: @@ -23,7 +23,16 @@ Imports: MASS, broom, dplyr, - tibble + tibble, + utils, + cowplot, + stats, + viridis, + ComplexHeatmap Suggests: - crayon -RoxygenNote: 7.1.0 + crayon, + knitr, + rmarkdown +RoxygenNote: 7.1.1 +biocViews: Proteomics, CellBiology, Software +VignetteBuilder: knitr diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/NAMESPACE b/NAMESPACE index 88497b9..c9c1591 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,9 +1,12 @@ # Generated by roxygen2: do not edit by hand +export(astir_paper_theme) +export(cohort_colours) +export(createHeatmap) export(get_celltypes) export(imc_exclusive_marker_score) export(jackson_basel_colours) -export(patient_clinSubtype_colours) +export(patient_clinSubtype_colours_wagner) export(patient_response_colours) export(plotSpatial) export(print_marker_info) @@ -15,6 +18,8 @@ importFrom(BiocGenerics,rownames) importFrom(ComplexHeatmap,Heatmap) importFrom(ComplexHeatmap,HeatmapAnnotation) importFrom(MASS,rlm) +importFrom(SummarizedExperiment,"assay<-") +importFrom(SummarizedExperiment,"colData<-") importFrom(SummarizedExperiment,assay) importFrom(SummarizedExperiment,colData) importFrom(broom,tidy) @@ -24,9 +29,11 @@ importFrom(dplyr,left_join) importFrom(dplyr,mutate) importFrom(plyr,mapvalues) importFrom(scater,plotColData) +importFrom(stats,quantile) importFrom(stringr,str_locate) importFrom(stringr,str_sub) importFrom(tibble,tibble) importFrom(utils,data) +importFrom(utils,write.csv) importFrom(viridis,viridis) importFrom(yaml,read_yaml) diff --git a/R/cleaning.R b/R/cleaning.R index 29aa0f2..36baa22 100644 --- a/R/cleaning.R +++ b/R/cleaning.R @@ -9,6 +9,7 @@ #' @param sce An input \code{SummarizedExperiment} or \code{SingleCellExperiment} #' @param marker_1 The name of the first marker (normally keratin) #' @param marker_2 The name of the second marker (normally CD45/PTPRC) +#' @param assay_name Type of SingleCellExperiment #' #' @importFrom MASS rlm #' @importFrom SummarizedExperiment assay diff --git a/R/colours.R b/R/colours.R index 07eafca..8e6e43a 100644 --- a/R/colours.R +++ b/R/colours.R @@ -22,7 +22,8 @@ jackson_basel_colours <- function() { celltype_colours } -#' @export +#' Color maps of patient clinical subtypes +#' @export patient_clinSubtype_colours <- function(){ pal <- c("#648FFF", "#785EF0", "#DC267F", "#FE6100", "#FFB000") @@ -35,6 +36,7 @@ patient_clinSubtype_colours <- function(){ clinSubtype_colours } +#' Set Wagner colour maps to patient clinical subtypes #' @export patient_clinSubtype_colours_wagner <- function(){ pal <- c("#648FFF", "#785EF0", "#DC267F", "#FE6100", "#FFB000") @@ -49,6 +51,7 @@ patient_clinSubtype_colours_wagner <- function(){ clinSubtype_colours } +#' Colour maps of patient responses #' @export patient_response_colours <- function(){ pal <- c("#648FFF", "#785EF0", "#DC267F", "#FE6100", "#FFB000") @@ -61,6 +64,7 @@ patient_response_colours <- function(){ clinSubtype_colours } +#' Group colors #' @export cohort_colours <- function(){ pal <- wes_palette("Darjeeling2", 4, type = c("discrete")) diff --git a/R/plotting.R b/R/plotting.R index 45f8f38..477ebea 100644 --- a/R/plotting.R +++ b/R/plotting.R @@ -6,10 +6,14 @@ #' @param colour_by Either a feature name or column of \code{colData(sce)} #' @param x_str The column of \code{colData(sce)} that codes for the x coordinate #' @param y_str The column of \code{colData(sce)} that codes for the Y coordinate +#' @param winsorize IDK ???? +#' @param w_limits Range of probabilities to use in quantile() +#' @param exprs_values Type of SingleCellExperiment #' @param ... Additional arguments to pass to \code{plotColData} #' #' @importFrom scater plotColData -#' @importFrom SummarizedExperiment colData +#' @importFrom SummarizedExperiment assay colData colData<- +#' @importFrom stats quantile #' #' @export plotSpatial <- function(sce, diff --git a/R/utils.R b/R/utils.R index 07ed3b2..2d9564b 100644 --- a/R/utils.R +++ b/R/utils.R @@ -12,6 +12,10 @@ winsorize_one <- function(y, } #' Winsorize the (log) counts +#' @param sce An input \code{SummarizedExperiment} or \code{SingleCellExperiment} +#' @param exprs_values Type of input? +#' @param w_limits cut off limits? +#' @importFrom SummarizedExperiment assay<- assay #' #' @export winsorize <- function(sce, @@ -40,6 +44,9 @@ winsorize <- function(sce, #' @param file The output file to write to #' @param include_xy Logical: should spatial location be written as first two #' columns? +#' @param exprs_values The type of the SingleCellExperiment? +#' +#' @importFrom utils write.csv #' #' @export to_csv <- function(sce, @@ -64,6 +71,8 @@ to_csv <- function(sce, } #' Get cell type assignments given probability matrix +#' @param prob_mat A probability matrix? +#' @param thresh A measure for cell type assignment? #' #' @export get_celltypes <- function(prob_mat, thresh = 0.7) { diff --git a/man/astir_paper_theme.Rd b/man/astir_paper_theme.Rd new file mode 100644 index 0000000..8f8557e --- /dev/null +++ b/man/astir_paper_theme.Rd @@ -0,0 +1,11 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/theme.R +\name{astir_paper_theme} +\alias{astir_paper_theme} +\title{Create a theme for all plot for the astir paper} +\usage{ +astir_paper_theme() +} +\description{ +Create a theme for all plot for the astir paper +} diff --git a/man/cohort_colours.Rd b/man/cohort_colours.Rd new file mode 100644 index 0000000..2ed5c2b --- /dev/null +++ b/man/cohort_colours.Rd @@ -0,0 +1,11 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/colours.R +\name{cohort_colours} +\alias{cohort_colours} +\title{Group colors} +\usage{ +cohort_colours() +} +\description{ +Group colors +} diff --git a/man/get_celltypes.Rd b/man/get_celltypes.Rd index 707ff31..18e004c 100644 --- a/man/get_celltypes.Rd +++ b/man/get_celltypes.Rd @@ -6,6 +6,11 @@ \usage{ get_celltypes(prob_mat, thresh = 0.7) } +\arguments{ +\item{prob_mat}{A probability matrix?} + +\item{thresh}{A measure for cell type assignment?} +} \description{ Get cell type assignments given probability matrix } diff --git a/man/imc_exclusive_marker_score.Rd b/man/imc_exclusive_marker_score.Rd index 6c0b3e2..b9025f4 100644 --- a/man/imc_exclusive_marker_score.Rd +++ b/man/imc_exclusive_marker_score.Rd @@ -17,6 +17,8 @@ imc_exclusive_marker_score( \item{marker_1}{The name of the first marker (normally keratin)} \item{marker_2}{The name of the second marker (normally CD45/PTPRC)} + +\item{assay_name}{Type of SingleCellExperiment} } \description{ Implements a very basic QC test: CD45 and keratin should exhibit mutually diff --git a/man/patient_clinSubtype_colours.Rd b/man/patient_clinSubtype_colours.Rd new file mode 100644 index 0000000..5c714bc --- /dev/null +++ b/man/patient_clinSubtype_colours.Rd @@ -0,0 +1,13 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/colours.R +\name{patient_clinSubtype_colours} +\alias{patient_clinSubtype_colours} +\title{Color maps of patient clinical subtypes + @export} +\usage{ +patient_clinSubtype_colours() +} +\description{ +Color maps of patient clinical subtypes + @export +} diff --git a/man/patient_clinSubtype_colours_wagner.Rd b/man/patient_clinSubtype_colours_wagner.Rd new file mode 100644 index 0000000..8bca74d --- /dev/null +++ b/man/patient_clinSubtype_colours_wagner.Rd @@ -0,0 +1,11 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/colours.R +\name{patient_clinSubtype_colours_wagner} +\alias{patient_clinSubtype_colours_wagner} +\title{Set Wagner colour maps to patient clinical subtypes} +\usage{ +patient_clinSubtype_colours_wagner() +} +\description{ +Set Wagner colour maps to patient clinical subtypes +} diff --git a/man/patient_response_colours.Rd b/man/patient_response_colours.Rd new file mode 100644 index 0000000..942ca5f --- /dev/null +++ b/man/patient_response_colours.Rd @@ -0,0 +1,11 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/colours.R +\name{patient_response_colours} +\alias{patient_response_colours} +\title{Colour maps of patient responses} +\usage{ +patient_response_colours() +} +\description{ +Colour maps of patient responses +} diff --git a/man/plotSpatial.Rd b/man/plotSpatial.Rd index 1c8706b..adfc063 100644 --- a/man/plotSpatial.Rd +++ b/man/plotSpatial.Rd @@ -24,6 +24,12 @@ plotSpatial( \item{y_str}{The column of \code{colData(sce)} that codes for the Y coordinate} +\item{winsorize}{IDK ????} + +\item{w_limits}{Range of probabilities to use in quantile()} + +\item{exprs_values}{Type of SingleCellExperiment} + \item{...}{Additional arguments to pass to \code{plotColData}} } \description{ diff --git a/man/to_csv.Rd b/man/to_csv.Rd index f324d68..ecfa3f3 100644 --- a/man/to_csv.Rd +++ b/man/to_csv.Rd @@ -24,6 +24,8 @@ columns?} \item{x_str}{The column of \code{colData(sce)} that codes for the x coordinate} \item{y_str}{The column of \code{colData(sce)} that codes for the Y coordinate} + +\item{exprs_values}{The type of the SingleCellExperiment?} } \description{ Writes the cell names as row names, and the (X,Y) co-ordinates diff --git a/man/winsorize.Rd b/man/winsorize.Rd index 8011636..a164909 100644 --- a/man/winsorize.Rd +++ b/man/winsorize.Rd @@ -6,6 +6,13 @@ \usage{ winsorize(sce, exprs_values = "logcounts", w_limits = c(0.05, 0.95)) } +\arguments{ +\item{sce}{An input \code{SummarizedExperiment} or \code{SingleCellExperiment}} + +\item{exprs_values}{Type of input?} + +\item{w_limits}{cut off limits?} +} \description{ Winsorize the (log) counts } diff --git a/vignettes/.gitignore b/vignettes/.gitignore new file mode 100644 index 0000000..097b241 --- /dev/null +++ b/vignettes/.gitignore @@ -0,0 +1,2 @@ +*.html +*.R diff --git a/vignettes/taproom.Rmd b/vignettes/taproom.Rmd new file mode 100644 index 0000000..accd64f --- /dev/null +++ b/vignettes/taproom.Rmd @@ -0,0 +1,19 @@ +--- +title: "taproom" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{taproom} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>" +) +``` + +```{r setup} +library(taproom) +``` From e918b324d3f140151a3966300c8d203b7b28eb7a Mon Sep 17 00:00:00 2001 From: EhsanKA Date: Wed, 5 Aug 2020 02:13:07 +0430 Subject: [PATCH 4/6] Update the gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cd67eac..c8484f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .Rproj.user +*.Rproj \ No newline at end of file From ec1b6e48b8ca75868b4e5cc13df2ca056092d008 Mon Sep 17 00:00:00 2001 From: EhsanKA Date: Wed, 5 Aug 2020 21:50:06 +0430 Subject: [PATCH 5/6] Check and BiocCheck passes with no error! ps. many examples are not relevant yet! --- .gitignore | 3 ++- DESCRIPTION | 5 +++-- NAMESPACE | 4 ++++ R/cleaning.R | 1 + R/colours.R | 11 +++++++++-- R/jackson.R | 1 + R/markers.R | 4 ++++ R/plotting.R | 8 ++++++-- R/theme.R | 4 ++++ R/utils.R | 5 ++++- man/astir_paper_theme.Rd | 3 +++ man/cohort_colours.Rd | 3 +++ man/createHeatmap.Rd | 3 +++ man/get_celltypes.Rd | 3 +++ man/imc_exclusive_marker_score.Rd | 3 +++ man/jackson_basel_colours.Rd | 3 +++ man/patient_clinSubtype_colours.Rd | 7 ++++--- man/patient_clinSubtype_colours_wagner.Rd | 3 +++ man/patient_response_colours.Rd | 3 +++ man/plotSpatial.Rd | 3 +++ man/print_marker_info.Rd | 3 +++ man/read_markers.Rd | 3 +++ man/tidy_rownames_jackson.Rd | 3 +++ man/to_csv.Rd | 3 +++ man/winsorize.Rd | 3 +++ 25 files changed, 84 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index c8484f1..a619a9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .Rproj.user -*.Rproj \ No newline at end of file +*.Rproj +*.Rhistory \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 3ae7e90..c1d3133 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -15,7 +15,6 @@ LazyData: true Imports: yaml, scater, - SingleCellExperiment, BiocGenerics, SummarizedExperiment, plyr, @@ -28,7 +27,9 @@ Imports: cowplot, stats, viridis, - ComplexHeatmap + ComplexHeatmap, + ggplot2, + wesanderson, Suggests: crayon, knitr, diff --git a/NAMESPACE b/NAMESPACE index c9c1591..001733f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,6 +6,7 @@ export(createHeatmap) export(get_celltypes) export(imc_exclusive_marker_score) export(jackson_basel_colours) +export(patient_clinSubtype_colours) export(patient_clinSubtype_colours_wagner) export(patient_response_colours) export(plotSpatial) @@ -14,6 +15,8 @@ export(read_markers) export(tidy_rownames_jackson) export(to_csv) export(winsorize) +import(cowplot) +import(ggplot2) importFrom(BiocGenerics,rownames) importFrom(ComplexHeatmap,Heatmap) importFrom(ComplexHeatmap,HeatmapAnnotation) @@ -36,4 +39,5 @@ importFrom(tibble,tibble) importFrom(utils,data) importFrom(utils,write.csv) importFrom(viridis,viridis) +importFrom(wesanderson,wes_palette) importFrom(yaml,read_yaml) diff --git a/R/cleaning.R b/R/cleaning.R index 36baa22..6e36789 100644 --- a/R/cleaning.R +++ b/R/cleaning.R @@ -15,6 +15,7 @@ #' @importFrom SummarizedExperiment assay #' @importFrom broom tidy #' +#' @examples counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) #' @export imc_exclusive_marker_score <- function(sce, marker_1 = "pan Cytokeratin", diff --git a/R/colours.R b/R/colours.R index 8e6e43a..8be34fd 100644 --- a/R/colours.R +++ b/R/colours.R @@ -1,5 +1,6 @@ #' Celltype colours for Jackson Basel 2020 +#' @examples colors <-jackson_basel_colours() #' @export jackson_basel_colours <- function() { pal <- c("#8B5B42", "#AF4EA9", "#FFB60A", "#0AC694", "#0024DD", "#6CC1FF", @@ -23,7 +24,9 @@ jackson_basel_colours <- function() { } #' Color maps of patient clinical subtypes -#' @export +#' +#' @examples patient_clinSubtype_colours() +#' @export patient_clinSubtype_colours <- function(){ pal <- c("#648FFF", "#785EF0", "#DC267F", "#FE6100", "#FFB000") @@ -37,6 +40,7 @@ patient_clinSubtype_colours <- function(){ } #' Set Wagner colour maps to patient clinical subtypes +#' @examples patient_clinSubtype_colours_wagner() #' @export patient_clinSubtype_colours_wagner <- function(){ pal <- c("#648FFF", "#785EF0", "#DC267F", "#FE6100", "#FFB000") @@ -52,6 +56,7 @@ patient_clinSubtype_colours_wagner <- function(){ } #' Colour maps of patient responses +#' @examples patient_response_colours() #' @export patient_response_colours <- function(){ pal <- c("#648FFF", "#785EF0", "#DC267F", "#FE6100", "#FFB000") @@ -65,7 +70,9 @@ patient_response_colours <- function(){ } #' Group colors -#' @export +#' @importFrom wesanderson wes_palette +#' @examples counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +#' @export cohort_colours <- function(){ pal <- wes_palette("Darjeeling2", 4, type = c("discrete")) diff --git a/R/jackson.R b/R/jackson.R index 047e7b5..347a94b 100644 --- a/R/jackson.R +++ b/R/jackson.R @@ -12,6 +12,7 @@ #' @importFrom dplyr left_join mutate case_when filter #' @importFrom tibble tibble #' +#' @examples counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) #' @export tidy_rownames_jackson <- function(sce) { diff --git a/R/markers.R b/R/markers.R index 378a42a..46bbd13 100644 --- a/R/markers.R +++ b/R/markers.R @@ -4,6 +4,8 @@ #' #' @param path Input file path (yaml file) #' +#' @examples +#' counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) #' @export #' #' @return A marker list including cell type and state markers @@ -37,6 +39,8 @@ read_markers <- function(path) { #' #' @return Prints marker information #' +#' @examples +#' counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) #' @export #' print_marker_info <- function(markers) { diff --git a/R/plotting.R b/R/plotting.R index 477ebea..eefd097 100644 --- a/R/plotting.R +++ b/R/plotting.R @@ -14,7 +14,9 @@ #' @importFrom scater plotColData #' @importFrom SummarizedExperiment assay colData colData<- #' @importFrom stats quantile -#' +#' +#' @examples +#' counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) #' @export plotSpatial <- function(sce, colour_by = NULL, @@ -65,7 +67,9 @@ plotSpatial <- function(sce, #' @param thresh The threshold to winsorize expression values at #' #' @return A heatmap of class \code{ComplexHeatmap::Heatmap} -#' +#' +#' @examples +#' counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) #' @export #' #' @importFrom SummarizedExperiment assay colData diff --git a/R/theme.R b/R/theme.R index b3e90b6..c054b2a 100644 --- a/R/theme.R +++ b/R/theme.R @@ -1,4 +1,8 @@ #' Create a theme for all plot for the astir paper +#' +#' @import cowplot +#' @import ggplot2 +#' @examples astir_paper_theme() #' @export astir_paper_theme <- function() { cowplot::theme_cowplot(font_size = 12) + diff --git a/R/utils.R b/R/utils.R index 2d9564b..e5f81fc 100644 --- a/R/utils.R +++ b/R/utils.R @@ -17,6 +17,7 @@ winsorize_one <- function(y, #' @param w_limits cut off limits? #' @importFrom SummarizedExperiment assay<- assay #' +#' @examples counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) #' @export winsorize <- function(sce, exprs_values = "logcounts", @@ -47,7 +48,8 @@ winsorize <- function(sce, #' @param exprs_values The type of the SingleCellExperiment? #' #' @importFrom utils write.csv -#' +#' +#' @examples counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) #' @export to_csv <- function(sce, file, @@ -74,6 +76,7 @@ to_csv <- function(sce, #' @param prob_mat A probability matrix? #' @param thresh A measure for cell type assignment? #' +#' @examples counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) #' @export get_celltypes <- function(prob_mat, thresh = 0.7) { if(is.data.frame(prob_mat)) { diff --git a/man/astir_paper_theme.Rd b/man/astir_paper_theme.Rd index 8f8557e..01f1822 100644 --- a/man/astir_paper_theme.Rd +++ b/man/astir_paper_theme.Rd @@ -9,3 +9,6 @@ astir_paper_theme() \description{ Create a theme for all plot for the astir paper } +\examples{ +astir_paper_theme() +} diff --git a/man/cohort_colours.Rd b/man/cohort_colours.Rd index 2ed5c2b..4678f14 100644 --- a/man/cohort_colours.Rd +++ b/man/cohort_colours.Rd @@ -9,3 +9,6 @@ cohort_colours() \description{ Group colors } +\examples{ +counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} diff --git a/man/createHeatmap.Rd b/man/createHeatmap.Rd index b1c3520..ffa23f6 100644 --- a/man/createHeatmap.Rd +++ b/man/createHeatmap.Rd @@ -28,3 +28,6 @@ A heatmap of class \code{ComplexHeatmap::Heatmap} Note that this creates a \code{Heatmap} object. To plot, call \code{draw(...)} on the returned object. } +\examples{ + counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} diff --git a/man/get_celltypes.Rd b/man/get_celltypes.Rd index 18e004c..0e0650d 100644 --- a/man/get_celltypes.Rd +++ b/man/get_celltypes.Rd @@ -14,3 +14,6 @@ get_celltypes(prob_mat, thresh = 0.7) \description{ Get cell type assignments given probability matrix } +\examples{ +counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} diff --git a/man/imc_exclusive_marker_score.Rd b/man/imc_exclusive_marker_score.Rd index b9025f4..40e66f9 100644 --- a/man/imc_exclusive_marker_score.Rd +++ b/man/imc_exclusive_marker_score.Rd @@ -26,3 +26,6 @@ exclusive expression, so performs a robust regression to check this trend, and reports the z-statistic. The more negative this is, the better the mutually-exclusive expression (to a first approximation). } +\examples{ +counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} diff --git a/man/jackson_basel_colours.Rd b/man/jackson_basel_colours.Rd index 6f7b0b2..f45822b 100644 --- a/man/jackson_basel_colours.Rd +++ b/man/jackson_basel_colours.Rd @@ -9,3 +9,6 @@ jackson_basel_colours() \description{ Celltype colours for Jackson Basel 2020 } +\examples{ +colors <-jackson_basel_colours() +} diff --git a/man/patient_clinSubtype_colours.Rd b/man/patient_clinSubtype_colours.Rd index 5c714bc..fe74f3a 100644 --- a/man/patient_clinSubtype_colours.Rd +++ b/man/patient_clinSubtype_colours.Rd @@ -2,12 +2,13 @@ % Please edit documentation in R/colours.R \name{patient_clinSubtype_colours} \alias{patient_clinSubtype_colours} -\title{Color maps of patient clinical subtypes - @export} +\title{Color maps of patient clinical subtypes} \usage{ patient_clinSubtype_colours() } \description{ Color maps of patient clinical subtypes - @export +} +\examples{ +patient_clinSubtype_colours() } diff --git a/man/patient_clinSubtype_colours_wagner.Rd b/man/patient_clinSubtype_colours_wagner.Rd index 8bca74d..11363a2 100644 --- a/man/patient_clinSubtype_colours_wagner.Rd +++ b/man/patient_clinSubtype_colours_wagner.Rd @@ -9,3 +9,6 @@ patient_clinSubtype_colours_wagner() \description{ Set Wagner colour maps to patient clinical subtypes } +\examples{ +patient_clinSubtype_colours_wagner() +} diff --git a/man/patient_response_colours.Rd b/man/patient_response_colours.Rd index 942ca5f..e1902a7 100644 --- a/man/patient_response_colours.Rd +++ b/man/patient_response_colours.Rd @@ -9,3 +9,6 @@ patient_response_colours() \description{ Colour maps of patient responses } +\examples{ +patient_response_colours() +} diff --git a/man/plotSpatial.Rd b/man/plotSpatial.Rd index adfc063..b3ab09c 100644 --- a/man/plotSpatial.Rd +++ b/man/plotSpatial.Rd @@ -35,3 +35,6 @@ plotSpatial( \description{ Plot the spatial variation in gene expression or colData } +\examples{ + counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} diff --git a/man/print_marker_info.Rd b/man/print_marker_info.Rd index ae0f187..0aa10a9 100644 --- a/man/print_marker_info.Rd +++ b/man/print_marker_info.Rd @@ -15,3 +15,6 @@ Prints marker information \description{ Print cell type and cell state marker info } +\examples{ + counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} diff --git a/man/read_markers.Rd b/man/read_markers.Rd index 63cb8d0..7a4075a 100644 --- a/man/read_markers.Rd +++ b/man/read_markers.Rd @@ -15,3 +15,6 @@ A marker list including cell type and state markers \description{ Read a marker yaml file } +\examples{ + counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} diff --git a/man/tidy_rownames_jackson.Rd b/man/tidy_rownames_jackson.Rd index 9a27135..b183b0d 100644 --- a/man/tidy_rownames_jackson.Rd +++ b/man/tidy_rownames_jackson.Rd @@ -12,3 +12,6 @@ tidy_rownames_jackson(sce) \description{ Convert from original SC_Dat.csv rownames to understandable ones } +\examples{ + counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} diff --git a/man/to_csv.Rd b/man/to_csv.Rd index ecfa3f3..d22aa8c 100644 --- a/man/to_csv.Rd +++ b/man/to_csv.Rd @@ -31,3 +31,6 @@ columns?} Writes the cell names as row names, and the (X,Y) co-ordinates as the first two columns (named \code{X} and \code{Y}). } +\examples{ +counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} diff --git a/man/winsorize.Rd b/man/winsorize.Rd index a164909..e6e3803 100644 --- a/man/winsorize.Rd +++ b/man/winsorize.Rd @@ -16,3 +16,6 @@ winsorize(sce, exprs_values = "logcounts", w_limits = c(0.05, 0.95)) \description{ Winsorize the (log) counts } +\examples{ +counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10) +} From f990841c2851162f0cd9f38738092ec16619c436 Mon Sep 17 00:00:00 2001 From: EhsanKA Date: Wed, 5 Aug 2020 22:05:54 +0430 Subject: [PATCH 6/6] Added for automatic building. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f73dfc2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,2 @@ +language: r +bioc_check: true