From eaccf736f431bdf80633bd05feb975c5b276b7df Mon Sep 17 00:00:00 2001 From: RubD Date: Sun, 7 Nov 2021 17:46:06 -0500 Subject: [PATCH] fix documentation warnings new HMRF code --- DESCRIPTION | 2 +- NAMESPACE | 3 +- R/python_hmrf.R | 79 ++++++++++++++++++++---------- man/addHMRF_V2.Rd | 2 +- man/checkAndFixSpatialGenes.Rd | 18 +++++++ man/chooseAvailableSpatialGenes.Rd | 14 ++++++ man/filterSpatialGenes.Rd | 10 +++- man/initHMRF_V2.Rd | 2 +- man/numPts_below_line.Rd | 19 +++++++ man/sampling_sp_genes.Rd | 8 ++- man/viewHMRFresults_V2.Rd | 12 ++++- 11 files changed, 135 insertions(+), 34 deletions(-) create mode 100644 man/checkAndFixSpatialGenes.Rd create mode 100644 man/chooseAvailableSpatialGenes.Rd create mode 100644 man/numPts_below_line.Rd diff --git a/DESCRIPTION b/DESCRIPTION index cd16a292f..a340048a4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: Giotto Title: Spatial Single-Cell Transcriptomics Toolbox -Version: 1.0.4.06 +Version: 1.1.0 Authors@R: c( person("Ruben", "Dries", email = "rubendries@gmail.com", role = c("aut", "cre")), diff --git a/NAMESPACE b/NAMESPACE index 21f2eb81c..34b017d79 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -35,7 +35,9 @@ export(cellProximitySpatPlot3D) export(cellProximityVisPlot) export(changeGiottoInstructions) export(changeImageBg) +export(checkAndFixSpatialGenes) export(checkGiottoEnvironment) +export(chooseAvailableSpatialGenes) export(clusterCells) export(clusterSpatialCorGenes) export(colMeans_giotto) @@ -185,7 +187,6 @@ export(runSpatialDeconv) export(runSpatialEnrich) export(runUMAP) export(runtSNE) -export(sampling_sp_genes) export(screePlot) export(selectPatternGenes) export(showClusterDendrogram) diff --git a/R/python_hmrf.R b/R/python_hmrf.R index 70d602d02..d1bc4dd8d 100644 --- a/R/python_hmrf.R +++ b/R/python_hmrf.R @@ -1,16 +1,16 @@ #' @title sampling_sp_genes -#' @param clust -#' @param sample_rate -#' @param target -#' @param seed -#' #' @name sampling_sp_genes +#' @param clust TBD +#' @param sample_rate TBD +#' @param target TBD +#' @param seed TBD #' @description function to select a set of spatial genes #' @keywords internal -#' -#' @export -sampling_sp_genes = function(clust, sample_rate=2, target=500, seed = 10){ +sampling_sp_genes = function(clust, + sample_rate=2, + target=500, + seed = 10){ # clust = spat_cor_netw_DT$cor_clusters$spat_netw_clus # sample_rate=2 # target=500 @@ -50,7 +50,15 @@ sampling_sp_genes = function(clust, sample_rate=2, target=500, seed = 10){ } -numPts_below_line <- function(myVector,slope,x){ + +#' @title numPts_below_line +#' @param myVector TBD +#' @param slope TBD +#' @param x TBD +#' @keywords internal +numPts_below_line <- function(myVector, + slope, + x){ yPt <- myVector[x] b <- yPt-(slope*x) xPts <- 1:length(myVector) @@ -59,13 +67,11 @@ numPts_below_line <- function(myVector,slope,x){ #' @title filterSpatialGenes -#' -#' @param gobject -#' @param spatial_genes -#' @param max -#' @param name -#' @param method -#' +#' @param gobject TBD +#' @param spatial_genes TBD +#' @param max TBD +#' @param name TBD +#' @param method TBD #' @export filterSpatialGenes <- function(gobject, spatial_genes, max=2500, name=c("binSpect", "silhouetteRank", "silhouetteRankTest"), method=c("none", "elbow")){ name = match.arg(name, unique(c("binSpect", "silhouetteRank", "silhouetteRankTest", name))) @@ -132,6 +138,11 @@ filterSpatialGenes <- function(gobject, spatial_genes, max=2500, name=c("binSpec return(list(genes=gx_sorted$gene_ID, num_genes_removed=num_genes_removed)) } + + +#' @title chooseAvailableSpatialGenes +#' @param gobject TBD +#' @export chooseAvailableSpatialGenes <- function(gobject){ eval1 = 'binSpect.pval' %in% names(gobject@gene_metadata) eval2 = 'silhouetteRankTest.pval' %in% names(gobject@gene_metadata) @@ -147,7 +158,15 @@ chooseAvailableSpatialGenes <- function(gobject){ } } -checkAndFixSpatialGenes <- function(gobject, use_spatial_genes, use_score=FALSE){ + +#' @title checkAndFixSpatialGenes +#' @param gobject TBD +#' @param use_spatial_genes TBD +#' @param use_score TBD +#' @export +checkAndFixSpatialGenes <- function(gobject, + use_spatial_genes, + use_score=FALSE){ if(use_spatial_genes=="silhouetteRank"){ if(use_score==TRUE){ use_spatial_genes = "silhouetteRank" @@ -183,8 +202,10 @@ checkAndFixSpatialGenes <- function(gobject, use_spatial_genes, use_score=FALSE) } } + + #' @name initHMRF_V2 -#' @title HMRF initialzation +#' @title initHMRF_V2 #' @description Run initialzation for HMRF model #' @param gobject giotto object #' @param expression_values expression values to use @@ -517,7 +538,7 @@ doHMRF_V2 = function (HMRF_init_obj, betas = c(0,10,5)) -#' @title add HMRF DT to cell meta data +#' @title addHMRF_V2 #' @name addHMRF_V2 #' @description function to add HMRF Domain Type to cell meta data #' @keywords external @@ -590,21 +611,25 @@ addHMRF_V2 = function (gobject, HMRFoutput } -#' @title view HMRF result +#' @title viewHMRFresults_V2 #' @name viewHMRFresults_V2 #' @description function to plot spatial location with HMRF cluster of k and betas -#' @param gobject -#' @param HMRFoutput -#' @param k -#' @param betas -#' @param third_dim +#' @param gobject TBD +#' @param HMRFoutput TBD +#' @param k TBD +#' @param betas TBD +#' @param third_dim TBD #' @param ... #' #' @keywords external #' #' @export -viewHMRFresults_V2 = function (gobject, HMRFoutput, k, betas, - third_dim = FALSE, ...) +viewHMRFresults_V2 = function (gobject, + HMRFoutput, + k, + betas, + third_dim = FALSE, + ...) { if (!"HMRFoutput" %in% class(HMRFoutput)) { stop("\n HMRFoutput needs to be output from doHMRFextend \n") diff --git a/man/addHMRF_V2.Rd b/man/addHMRF_V2.Rd index edb046bf2..01aff41d3 100644 --- a/man/addHMRF_V2.Rd +++ b/man/addHMRF_V2.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/python_hmrf.R \name{addHMRF_V2} \alias{addHMRF_V2} -\title{add HMRF DT to cell meta data} +\title{addHMRF_V2} \usage{ addHMRF_V2(gobject, HMRFoutput) } diff --git a/man/checkAndFixSpatialGenes.Rd b/man/checkAndFixSpatialGenes.Rd new file mode 100644 index 000000000..75ff12f77 --- /dev/null +++ b/man/checkAndFixSpatialGenes.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/python_hmrf.R +\name{checkAndFixSpatialGenes} +\alias{checkAndFixSpatialGenes} +\title{checkAndFixSpatialGenes} +\usage{ +checkAndFixSpatialGenes(gobject, use_spatial_genes, use_score = FALSE) +} +\arguments{ +\item{gobject}{TBD} + +\item{use_spatial_genes}{TBD} + +\item{use_score}{TBD} +} +\description{ +checkAndFixSpatialGenes +} diff --git a/man/chooseAvailableSpatialGenes.Rd b/man/chooseAvailableSpatialGenes.Rd new file mode 100644 index 000000000..5a1bf8734 --- /dev/null +++ b/man/chooseAvailableSpatialGenes.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/python_hmrf.R +\name{chooseAvailableSpatialGenes} +\alias{chooseAvailableSpatialGenes} +\title{chooseAvailableSpatialGenes} +\usage{ +chooseAvailableSpatialGenes(gobject) +} +\arguments{ +\item{gobject}{TBD} +} +\description{ +chooseAvailableSpatialGenes +} diff --git a/man/filterSpatialGenes.Rd b/man/filterSpatialGenes.Rd index efc538c9d..4082ebf4c 100644 --- a/man/filterSpatialGenes.Rd +++ b/man/filterSpatialGenes.Rd @@ -13,7 +13,15 @@ filterSpatialGenes( ) } \arguments{ -\item{method}{} +\item{gobject}{TBD} + +\item{spatial_genes}{TBD} + +\item{max}{TBD} + +\item{name}{TBD} + +\item{method}{TBD} } \description{ filterSpatialGenes diff --git a/man/initHMRF_V2.Rd b/man/initHMRF_V2.Rd index 7565ba70f..b6b8a47bc 100644 --- a/man/initHMRF_V2.Rd +++ b/man/initHMRF_V2.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/python_hmrf.R \name{initHMRF_V2} \alias{initHMRF_V2} -\title{HMRF initialzation} +\title{initHMRF_V2} \usage{ initHMRF_V2( gobject, diff --git a/man/numPts_below_line.Rd b/man/numPts_below_line.Rd new file mode 100644 index 000000000..0ae19bed7 --- /dev/null +++ b/man/numPts_below_line.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/python_hmrf.R +\name{numPts_below_line} +\alias{numPts_below_line} +\title{numPts_below_line} +\usage{ +numPts_below_line(myVector, slope, x) +} +\arguments{ +\item{myVector}{TBD} + +\item{slope}{TBD} + +\item{x}{TBD} +} +\description{ +numPts_below_line +} +\keyword{internal} diff --git a/man/sampling_sp_genes.Rd b/man/sampling_sp_genes.Rd index 86512895a..bdb299f62 100644 --- a/man/sampling_sp_genes.Rd +++ b/man/sampling_sp_genes.Rd @@ -7,7 +7,13 @@ sampling_sp_genes(clust, sample_rate = 2, target = 500, seed = 10) } \arguments{ -\item{seed}{} +\item{clust}{TBD} + +\item{sample_rate}{TBD} + +\item{target}{TBD} + +\item{seed}{TBD} } \description{ function to select a set of spatial genes diff --git a/man/viewHMRFresults_V2.Rd b/man/viewHMRFresults_V2.Rd index 977fea5fc..a6ca3c765 100644 --- a/man/viewHMRFresults_V2.Rd +++ b/man/viewHMRFresults_V2.Rd @@ -2,11 +2,21 @@ % Please edit documentation in R/python_hmrf.R \name{viewHMRFresults_V2} \alias{viewHMRFresults_V2} -\title{view HMRF result} +\title{viewHMRFresults_V2} \usage{ viewHMRFresults_V2(gobject, HMRFoutput, k, betas, third_dim = FALSE, ...) } \arguments{ +\item{gobject}{TBD} + +\item{HMRFoutput}{TBD} + +\item{k}{TBD} + +\item{betas}{TBD} + +\item{third_dim}{TBD} + \item{...}{} } \description{