From e808430b2cdd920f1b9abd8b6b59993fde8754a7 Mon Sep 17 00:00:00 2001 From: Yu Wan Date: Mon, 8 Aug 2022 11:01:02 +0100 Subject: [PATCH] Fixed a bug in heatMapPAM --- DESCRIPTION | 4 +-- R/func__visualisation__heatMapPAM.R | 11 +++--- man/allelicCoMatrix.Rd | 8 +++-- man/betaSignCongruence.Rd | 3 +- man/calcAllelicDiveristyPerCountry.Rd | 10 ++++-- man/comparePvalues.Rd | 39 ++++++++++++++++------ man/corCladeProj.Rd | 8 +++-- man/countAllelesPerCountry.Rd | 10 ++++-- man/countAllelesPerYear.Rd | 11 ++++-- man/drawHeatMap.Rd | 32 ++++++++++++++---- man/evalPL.Rd | 10 ++++-- man/findMinIncClade.Rd | 10 ++++-- man/findMinIncCladeOfStrains.Rd | 3 +- man/findPhysLink.Rd | 47 ++++++++++++++++++++------ man/findSeq.Rd | 12 +++++-- man/getClusterMemberCooccurrence.Rd | 13 ++++++-- man/heatMapPAM.Rd | 34 ++++++++++++++----- man/importAllelicPAM.Rd | 13 ++++++-- man/importCoreGenomeSNPs.Rd | 16 +++++++-- man/importGeneticPAM.Rd | 10 ++++-- man/importPhysicalDists.Rd | 8 +++-- man/lmm.Rd | 34 ++++++++++++++----- man/mergeIddAlleles.Rd | 8 +++-- man/mkCoocurNetwork.Rd | 12 +++++-- man/mkFilterTSV.Rd | 7 ++-- man/mkNetwork.Rd | 13 ++++++-- man/plr.Rd | 3 +- man/projectSamples.Rd | 14 ++++++-- man/retrieveAlleleSetInfo.Rd | 12 +++++-- man/ringPlotPAM.Rd | 48 ++++++++++++++++++++------- man/showGeneContent.Rd | 35 ++++++++++++++----- man/summariseDist.Rd | 16 +++++++-- man/summariseDistsForEdges.Rd | 13 ++++++-- man/summarisePhysDistForClusters.Rd | 14 ++++++-- man/tempNet.Rd | 29 ++++++++++++---- man/vertexAttr2Size.Rd | 9 +++-- 36 files changed, 438 insertions(+), 141 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 17b253c..041cb6c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: GeneMates Type: Package Title: Analysing association and physical linkage between bacterial genes -Version: 0.2.2 +Version: 0.2.3 Author: Yu Wan Maintainer: Yu Wan Description: Applies univariate linear mixed models (LMMs) to bacterial genotype @@ -24,4 +24,4 @@ Imports: networkDynamic (>= 0.9.0), vegan (>= 2.4-4), reshape2 (>= 1.4) -RoxygenNote: 6.1.1 +RoxygenNote: 7.2.0 diff --git a/R/func__visualisation__heatMapPAM.R b/R/func__visualisation__heatMapPAM.R index 598cca5..b7bd4be 100644 --- a/R/func__visualisation__heatMapPAM.R +++ b/R/func__visualisation__heatMapPAM.R @@ -53,7 +53,7 @@ #' @export #' @author Guangchuang Yu, Yu Wan (\email{wanyuac@@126.com}) # -# First edition of this function: 5 Sep 2018; the latest edition: 28 Aug 2019 +# First edition of this function: 5 Sep 2018; the latest edition: 8 Aug 2022 # Licence: Artistic License 2.0 (follow the licence of the package ggtree) heatMapPAM <- function(p, data, col_colours = "black", null_colour = "grey90", @@ -213,10 +213,11 @@ heatMapPAM <- function(p, data, col_colours = "black", null_colour = "grey90", # scale_fill_manual sets tile colours; scale_colour_manual sets label colours p2 <- p2 + scale_fill_manual(name = "Class", breaks = c("0", as.character(colour_codes)), - values = colours_uniq, na.value = NA) + - scale_colour_manual(name = "Class", - breaks = c("0", as.character(colour_codes)), - values = colours_uniq, na.value = NA) + values = colours_uniq, na.value = NA) + # Bug identified (8/8/2022): loss of tip labels after scalling colours + # + scale_colour_manual(name = "Class", + # breaks = c("0", as.character(colour_codes)), + # values = colours_uniq, na.value = NA) } else { p2 <- p2 + scale_fill_manual(name = "Class", breaks = c("1", "0"), values = c("1" = col_colours, "0" = null_colour), diff --git a/man/allelicCoMatrix.Rd b/man/allelicCoMatrix.Rd index 56d1cc2..beec922 100644 --- a/man/allelicCoMatrix.Rd +++ b/man/allelicCoMatrix.Rd @@ -4,8 +4,12 @@ \alias{allelicCoMatrix} \title{Create a co-occurrence matrix from allelic PAM} \usage{ -allelicCoMatrix(clusters = NULL, pam = NULL, hclust.method = NULL, - hclust.dist = "binary") +allelicCoMatrix( + clusters = NULL, + pam = NULL, + hclust.method = NULL, + hclust.dist = "binary" +) } \arguments{ \item{clusters}{A named or unnamed list of allele name vectors that define diff --git a/man/betaSignCongruence.Rd b/man/betaSignCongruence.Rd index 315b758..d09aea7 100644 --- a/man/betaSignCongruence.Rd +++ b/man/betaSignCongruence.Rd @@ -5,8 +5,7 @@ \title{Calculate sign congruence of fixed effects (betas) between linear mixed models (LMMs) and penalised logistic models (PLMs)} \usage{ -betaSignCongruence(lmms, plms, p.max = 1, step = 5e-04, - nevLog = TRUE) +betaSignCongruence(lmms, plms, p.max = 1, step = 5e-04, nevLog = TRUE) } \arguments{ \item{lmms}{A data frame from the function lmm for association status between diff --git a/man/calcAllelicDiveristyPerCountry.Rd b/man/calcAllelicDiveristyPerCountry.Rd index 16a7ffe..7bbc4f1 100644 --- a/man/calcAllelicDiveristyPerCountry.Rd +++ b/man/calcAllelicDiveristyPerCountry.Rd @@ -5,8 +5,14 @@ \alias{calcAllelicDiveristyPerCountry} \title{Allelic diversity per country or any kind of regions} \usage{ -calcAllelicDiveristyPerCountry(sam, pam, alleles = NULL, - countries = NULL, method = "simpson", shannon_base = exp(1)) +calcAllelicDiveristyPerCountry( + sam, + pam, + alleles = NULL, + countries = NULL, + method = "simpson", + shannon_base = exp(1) +) } \arguments{ \item{sam}{A data frame whose first and second columns are strain and country diff --git a/man/comparePvalues.Rd b/man/comparePvalues.Rd index 374fdae..dfc9849 100644 --- a/man/comparePvalues.Rd +++ b/man/comparePvalues.Rd @@ -5,17 +5,34 @@ \title{Draw a scatter plot and histograms to compare p-values from linear mixed models (LMMs) and penalised logistic models (PLMs).} \usage{ -comparePvalues(p.lmm, p.plm, lmm.h0 = NULL, p.min = 2.2e-16, - p.adj.max = 0.05, L.weak = 0, bks = seq(0, 16, by = 2), - show.p.adj.max = TRUE, cols = c(`0` = "grey50", `1` = "blue", `2` = - "red", `3` = "purple"), panel.num = 3, panel.titles = c("a", "b", - "c"), boxplot.show.group = TRUE, boxplot.default.fill = "grey80", - plot.title.size = 10, axis.title.size = 10, - axis.title.size.panelB = 3, axis.text.size = 8, - img = "pvalue_comparison.png", img.w = 150, img.h = 150, - img.r = 300, img.u = "mm", img.oma = c(0.1, 0.1, 0.1, 0.1), - img.mar = c(3, 2.6, 1, 0.5), img.mgp = c(1.8, 0.6, -0.2), - p.prev = NULL) +comparePvalues( + p.lmm, + p.plm, + lmm.h0 = NULL, + p.min = 2.2e-16, + p.adj.max = 0.05, + L.weak = 0, + bks = seq(0, 16, by = 2), + show.p.adj.max = TRUE, + cols = c(`0` = "grey50", `1` = "blue", `2` = "red", `3` = "purple"), + panel.num = 3, + panel.titles = c("a", "b", "c"), + boxplot.show.group = TRUE, + boxplot.default.fill = "grey80", + plot.title.size = 10, + axis.title.size = 10, + axis.title.size.panelB = 3, + axis.text.size = 8, + img = "pvalue_comparison.png", + img.w = 150, + img.h = 150, + img.r = 300, + img.u = "mm", + img.oma = c(0.1, 0.1, 0.1, 0.1), + img.mar = c(3, 2.6, 1, 0.5), + img.mgp = c(1.8, 0.6, -0.2), + p.prev = NULL +) } \arguments{ \item{p.lmm}{A data frame from the function lmm for association status between diff --git a/man/corCladeProj.Rd b/man/corCladeProj.Rd index 97e00e6..7d90eff 100644 --- a/man/corCladeProj.Rd +++ b/man/corCladeProj.Rd @@ -4,8 +4,12 @@ \alias{corCladeProj} \title{Estimating correlations between clades and projections of samples} \usage{ -corCladeProj(clades = NULL, projections = NULL, clade.sizes = NULL, - n.cores = -1) +corCladeProj( + clades = NULL, + projections = NULL, + clade.sizes = NULL, + n.cores = -1 +) } \arguments{ \item{clades}{A presence/absence matrix of samples in every clade. It can be generated with the function tree2Clades.} diff --git a/man/countAllelesPerCountry.Rd b/man/countAllelesPerCountry.Rd index 598650b..5d40af0 100644 --- a/man/countAllelesPerCountry.Rd +++ b/man/countAllelesPerCountry.Rd @@ -4,8 +4,14 @@ \alias{countAllelesPerCountry} \title{Count alleles per country} \usage{ -countAllelesPerCountry(alleles = NULL, sam, mapping, apam, nul = NA, - freq = FALSE) +countAllelesPerCountry( + alleles = NULL, + sam, + mapping, + apam, + nul = NA, + freq = FALSE +) } \arguments{ \item{alleles}{A character vector of allele names.} diff --git a/man/countAllelesPerYear.Rd b/man/countAllelesPerYear.Rd index e0d9994..71197a7 100644 --- a/man/countAllelesPerYear.Rd +++ b/man/countAllelesPerYear.Rd @@ -4,8 +4,15 @@ \alias{countAllelesPerYear} \title{Count alleles per year} \usage{ -countAllelesPerYear(alleles = NULL, sam, mapping, apam, nul_count = NA, - nul_freq = NA, combine = NULL) +countAllelesPerYear( + alleles = NULL, + sam, + mapping, + apam, + nul_count = NA, + nul_freq = NA, + combine = NULL +) } \arguments{ \item{alleles}{A character vector of allele names.} diff --git a/man/drawHeatMap.Rd b/man/drawHeatMap.Rd index 28535ce..e63a19b 100644 --- a/man/drawHeatMap.Rd +++ b/man/drawHeatMap.Rd @@ -4,13 +4,31 @@ \alias{drawHeatMap} \title{Draw a heat map for a given variable} \usage{ -drawHeatMap(data = NULL, x = "x", y = "y", val = "val", diag = 1, - replace.na = 0, cluster.row = TRUE, cluster.col = TRUE, - cluster.method = "complete", dist.row = "euclidean", - dist.col = "euclidean", colour.low = "white", colour.mid = NULL, - colour.high = "red", colour.grad = 50, colour.breaks, - display.val = FALSE, font.size = 10, filename = "heatmap.png", - res = 72, width = 800, height = 800, unit = "px") +drawHeatMap( + data = NULL, + x = "x", + y = "y", + val = "val", + diag = 1, + replace.na = 0, + cluster.row = TRUE, + cluster.col = TRUE, + cluster.method = "complete", + dist.row = "euclidean", + dist.col = "euclidean", + colour.low = "white", + colour.mid = NULL, + colour.high = "red", + colour.grad = 50, + colour.breaks, + display.val = FALSE, + font.size = 10, + filename = "heatmap.png", + res = 72, + width = 800, + height = 800, + unit = "px" +) } \arguments{ \item{data}{A data frame of at least three columns, such as x, y and z, or a matrix to be plotted directly as a heat map.} diff --git a/man/evalPL.Rd b/man/evalPL.Rd index 59f9dc6..52d114c 100644 --- a/man/evalPL.Rd +++ b/man/evalPL.Rd @@ -4,8 +4,14 @@ \alias{evalPL} \title{Evaluate evidence of physical linkage for positive associations with summary statistics of distance measurements} \usage{ -evalPL(lmms, min.beta = 0, max.p = 0.05, max.range = 2000, - min.pIBD = 0.9, score.dist = FALSE) +evalPL( + lmms, + min.beta = 0, + max.p = 0.05, + max.range = 2000, + min.pIBD = 0.9, + score.dist = FALSE +) } \arguments{ \item{lmms}{This argument can be a list produced by the function summariseDist, diff --git a/man/findMinIncClade.Rd b/man/findMinIncClade.Rd index 70389c5..25821f0 100644 --- a/man/findMinIncClade.Rd +++ b/man/findMinIncClade.Rd @@ -5,8 +5,14 @@ \title{Determine the minimal inclusive clades and calculate its frequency of co-occurrence events of every pair of alleles.} \usage{ -findMinIncClade(lmms, allele.pam, clade.pam, clade.sizes = NULL, - sample.dists, n.cores = -1) +findMinIncClade( + lmms, + allele.pam, + clade.pam, + clade.sizes = NULL, + sample.dists, + n.cores = -1 +) } \arguments{ \item{lmms}{Allele-level results from linear mixed models, generated by the diff --git a/man/findMinIncCladeOfStrains.Rd b/man/findMinIncCladeOfStrains.Rd index 5597e7d..943e385 100644 --- a/man/findMinIncCladeOfStrains.Rd +++ b/man/findMinIncCladeOfStrains.Rd @@ -4,8 +4,7 @@ \alias{findMinIncCladeOfStrains} \title{Finding out and summarising the minimal inclusive clade containing all given strains} \usage{ -findMinIncCladeOfStrains(strains = NULL, clade.pam = NULL, - clade.sizes = NULL) +findMinIncCladeOfStrains(strains = NULL, clade.pam = NULL, clade.sizes = NULL) } \arguments{ \item{strains}{a vector of strain names} diff --git a/man/findPhysLink.Rd b/man/findPhysLink.Rd index 0f708b4..30df2ea 100644 --- a/man/findPhysLink.Rd +++ b/man/findPhysLink.Rd @@ -5,17 +5,42 @@ \title{Testing for associations and physical linkage between every pair of bacterial genes at the allele level} \usage{ -findPhysLink(assoc.out = NULL, snps = NULL, snps.delim = ",", - pos.col = "Pos", ref.col = "Ref", min.mac = 1, - genetic.pam = NULL, genetic.pam.delim = "\\t", genes.excl = NULL, - allelic.pam = NULL, allelic.pam.delim = "\\t", min.count = 2, - min.co = 2, mapping = NULL, phys.dists = NULL, - dist.delim = "\\t", max.node.num = NULL, max.dist = NULL, - ingroup = NULL, outliers = NULL, ref = NULL, tree = NULL, - sample.dists = NULL, d.qs = c(0, 0.25, 0.5, 0.75, 1), max.p = 0.05, - max.range = 2000, min.pIBD = 0.9, output.dir = "output", - prefix = NULL, gemma.path = "gemma", n.cores = -1, - save.stages = TRUE, del.temp = TRUE, skip = TRUE) +findPhysLink( + assoc.out = NULL, + snps = NULL, + snps.delim = ",", + pos.col = "Pos", + ref.col = "Ref", + min.mac = 1, + genetic.pam = NULL, + genetic.pam.delim = "\\t", + genes.excl = NULL, + allelic.pam = NULL, + allelic.pam.delim = "\\t", + min.count = 2, + min.co = 2, + mapping = NULL, + phys.dists = NULL, + dist.delim = "\\t", + max.node.num = NULL, + max.dist = NULL, + ingroup = NULL, + outliers = NULL, + ref = NULL, + tree = NULL, + sample.dists = NULL, + d.qs = c(0, 0.25, 0.5, 0.75, 1), + max.p = 0.05, + max.range = 2000, + min.pIBD = 0.9, + output.dir = "output", + prefix = NULL, + gemma.path = "gemma", + n.cores = -1, + save.stages = TRUE, + del.temp = TRUE, + skip = TRUE +) } \arguments{ \item{assoc.out}{A previous output of findPhysLink when it was used only for diff --git a/man/findSeq.Rd b/man/findSeq.Rd index 4baf5b0..3db6a8a 100644 --- a/man/findSeq.Rd +++ b/man/findSeq.Rd @@ -4,10 +4,16 @@ \alias{findSeq} \title{Search for a query sequence against a list of assemblies} \usage{ -findSeq(query = NULL, assemblies = NULL, bandage.path = "./bandage", +findSeq( + query = NULL, + assemblies = NULL, + bandage.path = "./bandage", blast.params = "-task megablast", - bandage.params = "--ifilter 95 --evfilter 1e-3 --pathnodes 6 --minhitcov 0.98 --minpatlen 0.98 --maxpatlen 1.02", - n.cores = -1, del.temp = TRUE) + + bandage.params = "--ifilter 95 --evfilter 1e-3 --pathnodes 6 --minhitcov 0.98 --minpatlen 0.98 --maxpatlen 1.02", + n.cores = -1, + del.temp = TRUE +) } \arguments{ \item{query}{Path to a FASTA file, which may contain multiple query sequences.} diff --git a/man/getClusterMemberCooccurrence.Rd b/man/getClusterMemberCooccurrence.Rd index d3990cb..e003e6b 100644 --- a/man/getClusterMemberCooccurrence.Rd +++ b/man/getClusterMemberCooccurrence.Rd @@ -6,9 +6,16 @@ \title{Retrieving member allele co-occurrence status and strain distributions for clusters of alleles} \usage{ -getClusterMemberCooccurrence(clstr, cluster.colname = "cluster", - allele.colname = "allele", pam, clade.pam = NULL, - clade.sizes = NULL, sample.dists = NULL, n.cores = -1) +getClusterMemberCooccurrence( + clstr, + cluster.colname = "cluster", + allele.colname = "allele", + pam, + clade.pam = NULL, + clade.sizes = NULL, + sample.dists = NULL, + n.cores = -1 +) } \arguments{ \item{clstr}{a data frame consisting of at least two columns: one for cluster diff --git a/man/heatMapPAM.Rd b/man/heatMapPAM.Rd index 47362cc..ff33d97 100644 --- a/man/heatMapPAM.Rd +++ b/man/heatMapPAM.Rd @@ -5,15 +5,31 @@ \title{An expansion of ggtree's gheatmap function for displaying an allelic presence-absence matrix.} \usage{ -heatMapPAM(p, data, col_colours = "black", null_colour = "grey90", - presence_label = "Presence", absence_label = "Absence", - border_colour = "white", cluster_cols = FALSE, - cluster_method = "single", cluster_distance = "binary", - rev_cols = FALSE, colnames = TRUE, colnames_position = "bottom", - colnames_angle = 0, colnames_level = NULL, - set_label_colours = FALSE, colnames_offset_x = 0, - colnames_offset_y = 0, font.size = 4, hjust = 0.5, offset = 0, - width = 1, show_legend = FALSE) +heatMapPAM( + p, + data, + col_colours = "black", + null_colour = "grey90", + presence_label = "Presence", + absence_label = "Absence", + border_colour = "white", + cluster_cols = FALSE, + cluster_method = "single", + cluster_distance = "binary", + rev_cols = FALSE, + colnames = TRUE, + colnames_position = "bottom", + colnames_angle = 0, + colnames_level = NULL, + set_label_colours = FALSE, + colnames_offset_x = 0, + colnames_offset_y = 0, + font.size = 4, + hjust = 0.5, + offset = 0, + width = 1, + show_legend = FALSE +) } \arguments{ \item{p}{A tree view from the function ggtree in the package ggtree} diff --git a/man/importAllelicPAM.Rd b/man/importAllelicPAM.Rd index c69d5dd..75efb4f 100644 --- a/man/importAllelicPAM.Rd +++ b/man/importAllelicPAM.Rd @@ -4,9 +4,16 @@ \alias{importAllelicPAM} \title{Import the allelic presence-absence matrix (PAM) of bacterial genes.} \usage{ -importAllelicPAM(pam, pam.delim = "\\t", outliers = NULL, - min.count = 1, alleles.inc = NULL, output.y = "", - sample.order = NULL, skip = TRUE) +importAllelicPAM( + pam, + pam.delim = "\\t", + outliers = NULL, + min.count = 1, + alleles.inc = NULL, + output.y = "", + sample.order = NULL, + skip = TRUE +) } \arguments{ \item{pam}{either the final PAM or the file name of a raw PAM created by the PAMmaker pipeline. diff --git a/man/importCoreGenomeSNPs.Rd b/man/importCoreGenomeSNPs.Rd index ebfad5a..8221999 100644 --- a/man/importCoreGenomeSNPs.Rd +++ b/man/importCoreGenomeSNPs.Rd @@ -4,9 +4,19 @@ \alias{importCoreGenomeSNPs} \title{Import genotypes of core-genome SNPs} \usage{ -importCoreGenomeSNPs(snps, snps.delim = ",", pos.col = "Pos", - ref.col = "Ref", replace.ref = NULL, min.mac = 1, ingroup = NULL, - outliers = NULL, G.file = "", annots.file = "", skip = TRUE) +importCoreGenomeSNPs( + snps, + snps.delim = ",", + pos.col = "Pos", + ref.col = "Ref", + replace.ref = NULL, + min.mac = 1, + ingroup = NULL, + outliers = NULL, + G.file = "", + annots.file = "", + skip = TRUE +) } \arguments{ \item{snps}{either a path to the SNP table or a list generated by this function previously} diff --git a/man/importGeneticPAM.Rd b/man/importGeneticPAM.Rd index 469d8ee..7bcf136 100644 --- a/man/importGeneticPAM.Rd +++ b/man/importGeneticPAM.Rd @@ -4,8 +4,14 @@ \alias{importGeneticPAM} \title{Import the genetic presence/absence (p/a) matrix} \usage{ -importGeneticPAM(pam, pam.delim = "\\t", outliers = NULL, - min.count = 1, genes.rm = NULL, sample.order = NULL) +importGeneticPAM( + pam, + pam.delim = "\\t", + outliers = NULL, + min.count = 1, + genes.rm = NULL, + sample.order = NULL +) } \arguments{ \item{pam}{Expect pam to be "modified_allele_matrix.txt" produced by the cdhitFormatter pipeline. diff --git a/man/importPhysicalDists.Rd b/man/importPhysicalDists.Rd index 093d20b..69ba564 100644 --- a/man/importPhysicalDists.Rd +++ b/man/importPhysicalDists.Rd @@ -4,8 +4,12 @@ \alias{importPhysicalDists} \title{Importing a table of physical distances as a data frame} \usage{ -importPhysicalDists(dists = NULL, delim = "\\t", ingroup = NULL, - outgroup = NULL) +importPhysicalDists( + dists = NULL, + delim = "\\t", + ingroup = NULL, + outgroup = NULL +) } \arguments{ \item{dists}{The distance table to be imported.} diff --git a/man/lmm.Rd b/man/lmm.Rd index 1b15394..c35f2b5 100644 --- a/man/lmm.Rd +++ b/man/lmm.Rd @@ -4,14 +4,32 @@ \alias{lmm} \title{Testing for associations between occurrence of bacterial genes/alleles with linear mixed model} \usage{ -lmm(snps = NULL, snps.delim = ",", pos.col = "Pos", - ref.col = "Ref", min.mac = 1, genetic.pam = NULL, - genetic.pam.delim = "\\t", genes.excl = NULL, allelic.pam = NULL, - allelic.pam.delim = "\\t", mapping = NULL, min.count = 2, - min.co = 2, ingroup = NULL, outliers = NULL, ref = NULL, - tree = NULL, sample.dists = NULL, output.dir = "output", - prefix = NULL, gemma.path = "gemma", n.cores = -1, - save.stages = TRUE, skip = TRUE) +lmm( + snps = NULL, + snps.delim = ",", + pos.col = "Pos", + ref.col = "Ref", + min.mac = 1, + genetic.pam = NULL, + genetic.pam.delim = "\\t", + genes.excl = NULL, + allelic.pam = NULL, + allelic.pam.delim = "\\t", + mapping = NULL, + min.count = 2, + min.co = 2, + ingroup = NULL, + outliers = NULL, + ref = NULL, + tree = NULL, + sample.dists = NULL, + output.dir = "output", + prefix = NULL, + gemma.path = "gemma", + n.cores = -1, + save.stages = TRUE, + skip = TRUE +) } \arguments{ \item{snps}{Core-genome SNPs used for estimating the relatedness matrix.} diff --git a/man/mergeIddAlleles.Rd b/man/mergeIddAlleles.Rd index eeee02b..cf53d78 100644 --- a/man/mergeIddAlleles.Rd +++ b/man/mergeIddAlleles.Rd @@ -5,8 +5,12 @@ \title{Merging nodes representing identically distributed alleles into a single node in an output network of findPhysLink.} \usage{ -mergeIddAlleles(assoc, other.cols = NULL, lmms.only = FALSE, - replace.names = TRUE) +mergeIddAlleles( + assoc, + other.cols = NULL, + lmms.only = FALSE, + replace.names = TRUE +) } \arguments{ \item{assoc}{The data frame named assoc in findPhysLink's output. By design, alleles are all diff --git a/man/mkCoocurNetwork.Rd b/man/mkCoocurNetwork.Rd index d608753..c587e38 100644 --- a/man/mkCoocurNetwork.Rd +++ b/man/mkCoocurNetwork.Rd @@ -4,8 +4,16 @@ \alias{mkCoocurNetwork} \title{Converting a given network into a co-occurrence network} \usage{ -mkCoocurNetwork(alleles = NULL, net = NULL, pam = NULL, sam = NULL, - name.col = 1, years = 0, ds = NULL, use.ingroup.d = FALSE) +mkCoocurNetwork( + alleles = NULL, + net = NULL, + pam = NULL, + sam = NULL, + name.col = 1, + years = 0, + ds = NULL, + use.ingroup.d = FALSE +) } \arguments{ \item{alleles}{A vector of alleles for which pairwise co-occurrence counts diff --git a/man/mkFilterTSV.Rd b/man/mkFilterTSV.Rd index 5fc5aa2..ee79709 100644 --- a/man/mkFilterTSV.Rd +++ b/man/mkFilterTSV.Rd @@ -4,8 +4,11 @@ \alias{mkFilterTSV} \title{Making a guidance TSV file as an input for the physDist pipeline} \usage{ -mkFilterTSV(allele.mat = NULL, pam.a = NULL, - output = "targeted_isolates_alleles.tsv") +mkFilterTSV( + allele.mat = NULL, + pam.a = NULL, + output = "targeted_isolates_alleles.tsv" +) } \arguments{ \item{allele.mat}{A matrix in the output format of SRST2, which shows an allele per gene for each sample. diff --git a/man/mkNetwork.Rd b/man/mkNetwork.Rd index c2bcd65..45db16a 100644 --- a/man/mkNetwork.Rd +++ b/man/mkNetwork.Rd @@ -4,9 +4,16 @@ \alias{mkNetwork} \title{Create network data from association results.} \usage{ -mkNetwork(assoc = NULL, name.x = "x", name.y = "y", - edge.attr = NULL, node.x.attr = NULL, node.y.attr = NULL, - node.attr.names = "node", id = "") +mkNetwork( + assoc = NULL, + name.x = "x", + name.y = "y", + edge.attr = NULL, + node.x.attr = NULL, + node.y.attr = NULL, + node.attr.names = "node", + id = "" +) } \arguments{ \item{assoc}{A data frame from which the network is created. It may be pre-filtered diff --git a/man/plr.Rd b/man/plr.Rd index 225690a..b0d5d82 100644 --- a/man/plr.Rd +++ b/man/plr.Rd @@ -4,8 +4,7 @@ \alias{plr} \title{Firth's penalised logistic regression} \usage{ -plr(pat, tests.pat, tests.allele, n.cores = -1, - p.adj.method = "bonferroni") +plr(pat, tests.pat, tests.allele, n.cores = -1, p.adj.method = "bonferroni") } \arguments{ \item{pat}{An uncentred matrix of patterns of the allelic presence/absence status diff --git a/man/projectSamples.Rd b/man/projectSamples.Rd index 1b213d1..45102a7 100644 --- a/man/projectSamples.Rd +++ b/man/projectSamples.Rd @@ -4,8 +4,18 @@ \alias{projectSamples} \title{Project samples onto eigenvectors (of positive eigenvalues) of the semi-positive definite matrix t(S) * S} \usage{ -projectSamples(K, G, Y, L, samples, prefix = "S", get.dists = TRUE, - dist.method = "euclidean", get.tree = TRUE, gemma.path) +projectSamples( + K, + G, + Y, + L, + samples, + prefix = "S", + get.dists = TRUE, + dist.method = "euclidean", + get.tree = TRUE, + gemma.path +) } \arguments{ \item{K}{a string specifying the path to a file of the relatedness matrix produced using GEMMA} diff --git a/man/retrieveAlleleSetInfo.Rd b/man/retrieveAlleleSetInfo.Rd index f143893..ced7d52 100644 --- a/man/retrieveAlleleSetInfo.Rd +++ b/man/retrieveAlleleSetInfo.Rd @@ -4,9 +4,15 @@ \alias{retrieveAlleleSetInfo} \title{Retrive allelic presence-absence information given a vector of allele names} \usage{ -retrieveAlleleSetInfo(targets, assoc, allelic.pam, min.count = 2, - phylo.dists = NULL, dist.method = "binary", - clust.method = "single") +retrieveAlleleSetInfo( + targets, + assoc, + allelic.pam, + min.count = 2, + phylo.dists = NULL, + dist.method = "binary", + clust.method = "single" +) } \arguments{ \item{targets}{A character vector of allele names whose co-occurrence information is to be retrieved} diff --git a/man/ringPlotPAM.Rd b/man/ringPlotPAM.Rd index 66e47a2..87e5b97 100644 --- a/man/ringPlotPAM.Rd +++ b/man/ringPlotPAM.Rd @@ -4,18 +4,42 @@ \alias{ringPlotPAM} \title{Make a ring plot to show presence-absence of genotypes and allelic co-occurrence} \usage{ -ringPlotPAM(pam, genotypes, tree, y = NULL, y.pat = NULL, - struc.eff = NULL, clade.cor = NULL, clade.sizes = NULL, - struc.pmax = 0.05, struc.nmax = 10, genotype.cluster = TRUE, - genotype.dist = "binary", cluster.method = "single", - x.colours = "grey50", co.colours = "red", null.colour = "grey90", - y.colour = "grey10", highlight.tips = NULL, - highlight.tip.colour = "red", highlight.tip.shape = 16, - highlight.tip.size = 1, highlight.tip.alpha = 0.75, - clade.colours = rainbow(10), output = "ringPlot.png", res = 72, - width = 1600, height = 1600, unit = "px", htmap.width = 0.5, - offset = -0.001, branch.width = 0.25, font.size = 2, - print.colnames = TRUE, show.legend = FALSE) +ringPlotPAM( + pam, + genotypes, + tree, + y = NULL, + y.pat = NULL, + struc.eff = NULL, + clade.cor = NULL, + clade.sizes = NULL, + struc.pmax = 0.05, + struc.nmax = 10, + genotype.cluster = TRUE, + genotype.dist = "binary", + cluster.method = "single", + x.colours = "grey50", + co.colours = "red", + null.colour = "grey90", + y.colour = "grey10", + highlight.tips = NULL, + highlight.tip.colour = "red", + highlight.tip.shape = 16, + highlight.tip.size = 1, + highlight.tip.alpha = 0.75, + clade.colours = rainbow(10), + output = "ringPlot.png", + res = 72, + width = 1600, + height = 1600, + unit = "px", + htmap.width = 0.5, + offset = -0.001, + branch.width = 0.25, + font.size = 2, + print.colnames = TRUE, + show.legend = FALSE +) } \arguments{ \item{pam}{A presence/absence matrix (PAM) of genotypes (either alleles or genes)} diff --git a/man/showGeneContent.Rd b/man/showGeneContent.Rd index 3fccb29..7c701ab 100644 --- a/man/showGeneContent.Rd +++ b/man/showGeneContent.Rd @@ -4,14 +4,33 @@ \alias{showGeneContent} \title{Draw a bubble plot and two bar plots to summarise gene and allele frequencies.} \usage{ -showGeneContent(af, gf, pam.g, d.min = 2, d.max = 20, fill.colour, - border.colour = "grey90", core.genes = NULL, bar.acc = FALSE, - panel.names = c("a", "b", "c"), panelA.xmax = 120, - panelB.xinterv = 5, panelB.yinterv = 20, panelB.col = "grey50", - panelC.lwd = 1, panelC.xinterv = 20, prev.out = NULL, - f = "gene_content.png", w = 170, h = 200, r = 300, u = "mm", - img.oma = c(0.1, 0.1, 0.1, 0.1), img.mar = c(3, 2.6, 1, 0.5), - img.mgp = c(1.8, 0.6, -0.2)) +showGeneContent( + af, + gf, + pam.g, + d.min = 2, + d.max = 20, + fill.colour, + border.colour = "grey90", + core.genes = NULL, + bar.acc = FALSE, + panel.names = c("a", "b", "c"), + panelA.xmax = 120, + panelB.xinterv = 5, + panelB.yinterv = 20, + panelB.col = "grey50", + panelC.lwd = 1, + panelC.xinterv = 20, + prev.out = NULL, + f = "gene_content.png", + w = 170, + h = 200, + r = 300, + u = "mm", + img.oma = c(0.1, 0.1, 0.1, 0.1), + img.mar = c(3, 2.6, 1, 0.5), + img.mgp = c(1.8, 0.6, -0.2) +) } \arguments{ \item{af}{A table of allele frequencies, produced by the function countAlleles.} diff --git a/man/summariseDist.Rd b/man/summariseDist.Rd index 7ca7c8e..01db6bb 100644 --- a/man/summariseDist.Rd +++ b/man/summariseDist.Rd @@ -4,9 +4,19 @@ \alias{summariseDist} \title{Attach new columns summarising distance measurements to LMM results (lmms)} \usage{ -summariseDist(lmms, lmms.ds, tree, clades, allele.pam, max.nodes = -1, - max.dist = Inf, colname.pair = "pair", colname.co = "n_xy", - qs = c(0, 0.25, 0.5, 0.75, 1), n.cores = n.cores) +summariseDist( + lmms, + lmms.ds, + tree, + clades, + allele.pam, + max.nodes = -1, + max.dist = Inf, + colname.pair = "pair", + colname.co = "n_xy", + qs = c(0, 0.25, 0.5, 0.75, 1), + n.cores = n.cores +) } \arguments{ \item{lmms}{a data frame that must contain two columns x and y for allele names.} diff --git a/man/summariseDistsForEdges.Rd b/man/summariseDistsForEdges.Rd index a0d00a1..37b170c 100644 --- a/man/summariseDistsForEdges.Rd +++ b/man/summariseDistsForEdges.Rd @@ -5,9 +5,16 @@ \alias{summariseDistsForEdges} \title{Summarise allelic physical distances for edges in an association network} \usage{ -summariseDistsForEdges(E, ds, d.max = 250000, n.max = 2, - source.graph = "graph", source.contig = "contig", - source.complete = "complete", sort.output = TRUE) +summariseDistsForEdges( + E, + ds, + d.max = 250000, + n.max = 2, + source.graph = "graph", + source.contig = "contig", + source.complete = "complete", + sort.output = TRUE +) } \arguments{ \item{E}{An edge list having columns in the order: allele_1, allele_2, co-occurrence diff --git a/man/summarisePhysDistForClusters.Rd b/man/summarisePhysDistForClusters.Rd index a581388..7d39741 100644 --- a/man/summarisePhysDistForClusters.Rd +++ b/man/summarisePhysDistForClusters.Rd @@ -5,9 +5,17 @@ \alias{summarisePhysDistForClusters} \title{Summarising physical distances involving clusters of alleles} \usage{ -summarisePhysDistForClusters(cls.distr, cls.col = 1, allele.col = 2, - cls, ds, bidirectional = TRUE, sample.dists = NULL, - clade.pam = NULL, clade.sizes = NULL) +summarisePhysDistForClusters( + cls.distr, + cls.col = 1, + allele.col = 2, + cls, + ds, + bidirectional = TRUE, + sample.dists = NULL, + clade.pam = NULL, + clade.sizes = NULL +) } \arguments{ \item{cls.distr}{A data frame produced by the function getClusterMemberCooccurrence for cluster distributions. diff --git a/man/tempNet.Rd b/man/tempNet.Rd index d99e9c4..55456b7 100644 --- a/man/tempNet.Rd +++ b/man/tempNet.Rd @@ -4,13 +4,28 @@ \alias{tempNet} \title{Creating a temporal network from graphs} \usage{ -tempNet(gs, v.label = "allele", e.tail = "node1", e.head = "node2", - directed = FALSE, t.gap = 1, v.value = "count", v.value.base = 0, - v.size.min = 1, v.size.max = 25, v.colour = "red", - e.weight = "n_xy", e.weight.base = 1, e.weight.cutoff = 0, - e.width.min = 1, e.width.max = 10, e.colour = "m", - e.colour.low = "#FFA0A0", e.colour.high = "#FF0000", - e.colour.num = 9) +tempNet( + gs, + v.label = "allele", + e.tail = "node1", + e.head = "node2", + directed = FALSE, + t.gap = 1, + v.value = "count", + v.value.base = 0, + v.size.min = 1, + v.size.max = 25, + v.colour = "red", + e.weight = "n_xy", + e.weight.base = 1, + e.weight.cutoff = 0, + e.width.min = 1, + e.width.max = 10, + e.colour = "m", + e.colour.low = "#FFA0A0", + e.colour.high = "#FF0000", + e.colour.num = 9 +) } \arguments{ \item{gs}{A GraphSet object with years as graph IDs.} diff --git a/man/vertexAttr2Size.Rd b/man/vertexAttr2Size.Rd index 34dc7bc..7c176e9 100644 --- a/man/vertexAttr2Size.Rd +++ b/man/vertexAttr2Size.Rd @@ -4,8 +4,13 @@ \alias{vertexAttr2Size} \title{Mapping a numeric vector to vertex sizes through a linear transformation} \usage{ -vertexAttr2Size(x, x.min = min(x), x.max = max(x), size.min = 15, - size.max = 60) +vertexAttr2Size( + x, + x.min = min(x), + x.max = max(x), + size.min = 15, + size.max = 60 +) } \arguments{ \item{x}{Input numeric vector to be transformed.}