R 패키지 메타데이터와 수집 신호를 모아 봅니다.
첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.
DESCRIPTION에서 감지한 backend 관련 package입니다.
기본 메타데이터를 작은 카드와 토큰으로 압축합니다.
| Package | Type | Spec |
|---|---|---|
| ape CRAN · 1.0.7 · 2026-05-30 | Depends | ape |
| methods CRAN · 1.0.7 · 2026-05-30 | Depends | methods |
| phangorn CRAN · 1.0.7 · 2026-05-30 | Depends | phangorn |
| adegenet CRAN · 1.0.7 · 2026-05-30 | Imports | adegenet |
| graphics CRAN · 1.0.7 · 2026-05-30 | Imports | graphics |
| stats CRAN · 1.0.7 · 2026-05-30 | Imports | stats |
| utils CRAN · 1.0.7 · 2026-05-30 | Imports | utils |
| knitr CRAN · 1.0.7 · 2026-05-30 | Suggests | knitr |
| rmarkdown CRAN · 1.0.7 · 2026-05-30 | Suggests | rmarkdown |
| testthat CRAN · 1.0.7 · 2026-05-30 | Suggests | testthat |
| 검색 결과가 없습니다. | ||
| Type | Packages |
|---|---|
| Suggests | 1 |
CHANGES IN APEX VERSION 1.0.7
BUG FIXES
- fix Rd cross-references
CHANGES IN APEX VERSION 1.0.5
BUG FIXES
- fixed maintainer email.
NEW MANAGEMENT
- Klaus Schliep is now the acting maintainer of the package.
BUG FIXES
- small changes to be compatible with R 4.0README code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { color: #008000; } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { color: #008000; font-weight: bold; } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ apex : Phylogenetic Methods for Multiple Gene Data apex implements new classes and methods for analysing DNA sequences from multiple genes. It implements new classes extending object classes from ape and phangorn to store multiple gene data, and some useful wrappers mimicking existing functionalities of these packages for multiple genes. This document provides an overview of the package’s content. Installing apex To install the development version from github: library (devtools) install_github ( "thibautjombart/apex" ) The stable version can be installed from CRAN using: install.packages ( "apex" ) Then, to load the package, use: library ( "apex" ) Importing data ape wrappers Two simple functions permit to import data from multiple alignements into multidna objects: * read.multidna: reads multiple DNA alignments with various formats * read.multiFASTA: same for FASTA files Both functions rely on the single-gene counterparts in ape and accept the same arguments. Each file should contain data from a given gene, where sequences should be named after individual labels only. Here is an example using a dataset from apex : ## get address of the file within apex files <- dir ( system.file ( package= "apex" ), patter= "patr" , full= TRUE ) ## read these files x <- read.multiFASTA (files) x ## === multidna === ## [ 32 DNA sequences in 4 genes ] ## ## @n.ind: 8 individuals ## @n.seq: 32 sequences in total ## @n.seq.miss: 8 gap-only (missing) sequences ## @labels: 2340_50156.ab1 2340_50149.ab1 2340_50674.ab1 2370_45312.ab1 2340_50406.ab1 2370_45424.ab1 ... ## ## @dna: (list of DNAbin matrices) ## $patr_poat43 ## 8 DNA sequences in binary format stored in a matrix. ## ## All sequences of same length: 764 ## ## Labels: ## 2340_50156.ab1 ## 2340_50149.ab1 ## 2340_50674.ab1 ## 2370_45312.ab1 ## 2340_50406.ab1 ## 2370_45424.ab1 ## ... ## ## Base composition: ## a c g t ## 0.320 0.158 0.166 0.356 ## (Total: 6.11 kb) ## ## $patr_poat47 ## 8 DNA sequences in binary format stored in a matrix. ## ## All sequences of same length: 626 ## ## Labels: ## 2340_50156.ab1 ## 2340_50149.ab1 ## 2340_50674.ab1 ## 2370_45312.ab1 ## 2340_50406.ab1 ## 2370_45424.ab1 ## ... ## ## Base composition: ## a c g t ## 0.227 0.252 0.256 0.266 ## (Total: 5.01 kb) ## ## $patr_poat48 ## 8 DNA sequences in binary format stored in a matrix. ## ## All sequences of same length: 560 ## ## Labels: ## 2340_50156.ab1 ## 2340_50149.ab1 ## 2340_50674.ab1 ## 2370_45312.ab1 ## 2340_50406.ab1 ## 2370_45424.ab1 ## ... ## ## Base composition: ## a c g t ## 0.305 0.185 0.182 0.327 ## (Total: 4.48 kb) ## ## $patr_poat49 ## 8 DNA sequences in binary format stored in a matrix. ## ## All sequences of same length: 556 ## ## Labels: ## 2340_50156.ab1 ## 2340_50149.ab1 ## 2340_50674.ab1 ## 2370_45312.ab1 ## 2340_50406.ab1 ## 2370_45424.ab1 ## ... ## ## Base composition: ## a c g t ## 0.344 0.149 0.187 0.320 ## (Total: 4.45 kb) names (x @ dna) # names of the genes ## [1] "patr_poat43" "patr_poat47" "patr_poat48" "patr_poat49" oldpar <- par ( mar= c ( 6 , 11 , 4 , 1 )) plot (x) plot of chunk readfiles par (oldpar) phangorn wrappers In addition to the above functions for importing data: * read.multiphyDat: reads multiple DNA alignments with various formats. The arguments are the same as the single-gene read.phyDat in phangorn : z <- read.multiphyDat (files, format= "fasta" ) z ## === multiphyDat === ## [ 32 DNA sequences in 4 genes ] ## ## @type: ## @n.ind: 8 individuals ## @n.seq: 32 sequences in total ## @n.seq.miss: 8 gap-only (missing) sequences ## @labels: 2340_50156.ab1 2340_50149.ab1 2340_50674.ab1 2370_45312.ab1 2340_50406.ab1 2370_45424.ab1 ... ## ## @seq: (list of phyDat objects) ## $patr_poat43 ## 8 sequences with 764 character and 8 different site patterns. ## The states are a c g t ## ## $patr_poat47 ## 8 sequences with 626 character and 29 different site patterns. ## The states are a c g t ## ## $patr_poat48 ## 8 sequences with 560 character and 24 different site patterns. ## The states are a c g t ## ## $patr_poat49 ## 8 sequences with 556 character and 8 different site patterns. ## The states are a c g t New object classes Two new classes of object extend existing data structures for multiple genes: * multidna: based on ape ’s DNAbin class, useful for distance-based trees. * multiphyDat: based on phangorn ’s phyDat class, useful for likelihood-based and parsimony trees. Conversion between these classes can be done using multidna2multiPhydat and multiPhydat2multidna . multidna This formal (S4) class can be seen as a multi-gene extension of ape ’s DNAbin class. Data is stored as a list of DNAbin objects, with additional slots for extra information. The class definition can be obtained by: getClassDHelp for package apex const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {apex} Contents apex-package [,multidna,ANY,ANY,ANY-method accessors add.gaps concatenate dist.multidna getTree initialize,multidna-method initialize,multiphyDat-method multidna-class multidna2alignment multidna2genind multidna2multiphyDat multiphyDat-class plot,multidna-method read.multidna rm.gaps show,multidna-method show,multiphyDat-method Title: Phylogenetic Methods for Multiple Gene Data Version: 1.0.7 Description: Toolkit for the analysis of multiple gene data (Jombart et al. 2017) < doi:10.1111/1755-0998.12567 >. 'apex' implements the new S4 classes 'multidna', 'multiphyDat' and associated methods to handle aligned DNA sequences from multiple genes. Depends: R (≥ 3.1.3), methods, ape, phangorn Imports: utils, graphics, stats, adegenet License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] URL: https://github.com/thibautjombart/apex BugReports: https://github.com/thibautjombart/apex/issues Collate: doc.R internal.R multidna.class.R multiphyDat.class.R add.gaps.R rm.gaps.R show.R multidna.constructor.R multiphyDat.constructor.R accessors.R subset.R concatenate.R plot.R readfiles.R datasets.R dist.R getTree.R exports.R VignetteBuilder: knitr Suggests: testthat, knitr, rmarkdown Encoding: UTF-8 RoxygenNote: 7.3.2 NeedsCompilation: no Packaged: 2025-07-24 11:58:32 UTC; klaus Author: Klaus Schliep [aut, cre], Thibaut Jombart [aut], Zhian Namir Kamvar [aut], Eric Archer [aut], Rebecca Harris [aut] Maintainer: Klaus Schliep <klaus.schliep@gmail.com> Repository: CRAN Date/Publication: 2025-07-24 14:10:02 UTC apex: Phylogenetic Methods for Multiple Gene Data Description Toolkit for the analysis of multiple gene data (Jombart et al. 2017) doi:10.1111/1755-0998.12567 . 'apex' implements the new S4 classes 'multidna', 'multiphyDat' and associated methods to handle aligned DNA sequences from multiple genes. Author(s) Maintainer : Klaus Schliep klaus.schliep@gmail.com ( ORCID ) Authors: Thibaut Jombart t.jombart@imperial.ac.uk Zhian Namir Kamvar kamvarz@science.oregonstate.edu Eric Archer eric.archer@noaa.gov Rebecca Harris rbharris@uw.edu See Also Useful links: https://github.com/thibautjombart/apex Report bugs at https://github.com/thibautjombart/apex/issues Subset multidna objects Description Individuals in a multidna or multiphyDat object can be subsetted like the rows of a matrix, with the form x[i,]. Genes can be subsetted like the columns of a matrix, i.e. with the form x[,j]. Usage ## S4 method for signature 'multidna,ANY,ANY,ANY' x[i, j, ..., drop = TRUE] ## S4 method for signature 'multiphyDat,ANY,ANY,ANY' x[i, j, ..., drop = TRUE] Arguments x the multidna object to subset. i a vector of logical, integers or characters to subset data by individuals; characters will be matched against individual labels. j a vector of logical, integers or characters to subset data by genes; characters will be matched against gene names labels. ... further arguments to be passed to other methods; currently ignored. drop present for compatibility with the generic; currently not used. Author(s) Thibaut Jombart t.jombart@imperial.ac.uk Examples data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x plot(x) ## keep only the first 5 individuals x[1:5,] plot(x[1:5,]) ## keep individuals 2,4,6 and the second gene x[c(2,4,6),2] plot(x[c(2,4,6),2]) multidna Accessors Description Accessors for slots in multidna and multiphyDat objects. Usage getNumInd(x, ...) ## S4 method for signature 'multidna' getNumInd(x, ...) ## S4 method for signature 'multiphyDat' getNumInd(x, ...) getNumLoci(x, ...) ## S4 method for signature 'multidna' getNumLoci(x, ...) ## S4 method for signature 'multiphyDat' getNumLoci(x, ...) getLocusNames(x, ...) ## S4 method for signature 'multidna' getLocusNames(x, ...) ## S4 method for signature 'multiphyDat' getLocusNames(x, ...) setLocusNames(x) <- value ## S4 replacement method for signature 'multidna' setLocusNames(x) <- value ## S4 replacement method for signature 'multiphyDat' setLocusNames(x) <- value getNumSequences(x, ...) ## S4 method for signature 'multidna' getNumSequences(x, exclude.gap.only = TRUE, loci = NULL, ...) ## S4 method for signature 'multiphyDat' getNumSequences(x, exclude.gap.only = TRUE, loci = NULL, ...) getSequenceNames(x, ...) ## S4 method for signature 'multidna' getSequenceNames(x, exclude.gap.only = TRUE, loci = NULL, ...) ## S4 method for signature 'multiphyDat' getSequenceNames(x, exclude.gap.only = TRUE, loci = NULL, ...) getSequences(x, ...) ## S4 method for signature 'multidna' getSequences(x, loci = NULL, ids = NULL, simplify = TRUE, exclude.gap.only = TRUE, ...) ## S4 method for signature 'multiphyDat' getSequences(x, loci = NULL, ids = NULL, simplify = TRUE, exclude.gap.only = TRUE, ...) Arguments x a multidna or multiphyDat object. ... further arguments passed on to other functions. value a replacement value for the slot. exclude.gap.only logical. Remove or ignore sequences containing all gaps? loci a character, numeric, or logical vector identifying which loci to return. ids a character, numeric, or logical vector identifying which sequences to return within a locus. simplify logical. If FALSE , always return a list of DNAbin sequences. If TRUE and only one locus has been requested, return a single DNAbin object. Details getNumInd Returns the number of individuals. getNumLoci Returns the number of loci. getLocusNames Returns the names of each locus. setLocusNames Sets the names of each locus. getNumSequences Returns the number of sequences in each locus. getSequenceNames Returns the names of individual sequences at each locus. getSequences Returns sequences of specified loci and individuals. Value returns the information stored in a slot, see details. Add gap-only sequences for missing data Description In multidna and multiphyDat , some individuals may not be sequenced for all genes. The generic function add.gaps has method for both objects; it identifies the missing sequences, and adds gap-only sequences to the alignments wherever needed. Usage add.gaps(x, ...) ## S4 method for signature 'multidna' add.gaps(x, ...) ## S4 method for signature 'multiphyDat' add.gaps(x, ...) Arguments x a multidna or multiphyDat object. ... further arguments passed to other methods (currently not used). Concatenate genes into a single matrix Description These functions concatenate separate DNA alignments into a single alignement matrix. concatenate is a generic with methods for: multidna : returns a DNAbin matrix multiphyDat : returns a phyDat object Usage concatenate(x, ...) ## S4 method for signature 'multidna' concatenate(x, genes = TRUE, ...) ## S4 method for signature 'multiphyDat' concatenate(x, genes = TRUE, ...) Arguments x a multidna or a multiphyDat object. ... further arguments passed to other methods (currently not used). genes an optional vector indicating the genes to retain for the concatenation; any way to subset the list in x@dna is acceptable; by default, all genes are used. Author(s) Thibaut Jombart t.jombart@imperial.ac.uk Examples ## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x plot(x) image(concatenate(x)) Pairwise distances for multiple gene data Description This function computes pairwise genetic distances between individuals using genes in a multidna object. By default, one distance matrix (dist object) is created for each each, but a single distance can be derived by pooling all genes (argument pool=TRUE ) Usage dist.multidna(x, pool = FALSE, genes = TRUE, ...) Arguments x a multidna object. pool a logical indicating if all genes should be pooled (concatenated) toIndividuals in a 4classmultidna or 4classmultiphyDat object can be subsetted like the rows of a matrix, with the form x[i,]. Genes can be subsetted like the columns of a matrix, i.e. with the form x[,j].
4method[multidna,ANY,ANY,ANY(x, i, j, ..., drop = TRUE) 4method[multiphyDat,ANY,ANY,ANY(x, i, j, ..., drop = TRUE)data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x plot(x) ## keep only the first 5 individuals x[1:5,] plot(x[1:5,]) ## keep individuals 2,4,6 and the second gene x[c(2,4,6),2] plot(x[c(2,4,6),2])Accessors for slots in 4classmultidna and 4classmultiphyDat objects.
getNumInd(x, ...) 4methodgetNumIndmultidna(x, ...) 4methodgetNumIndmultiphyDat(x, ...) getNumLoci(x, ...) 4methodgetNumLocimultidna(x, ...) 4methodgetNumLocimultiphyDat(x, ...) getLocusNames(x, ...) 4methodgetLocusNamesmultidna(x, ...) 4methodgetLocusNamesmultiphyDat(x, ...) setLocusNames(x) <- value 4methodsetLocusNamesmultidna(x) <- value 4methodsetLocusNamesmultiphyDat(x) <- value getNumSequences(x, ...) 4methodgetNumSequencesmultidna(x, exclude.gap.only = TRUE, loci = NULL, ...) 4methodgetNumSequencesmultiphyDat(x, exclude.gap.only = TRUE, loci = NULL, ...) getSequenceNames(x, ...) 4methodgetSequenceNamesmultidna(x, exclude.gap.only = TRUE, loci = NULL, ...) 4methodgetSequenceNamesmultiphyDat(x, exclude.gap.only = TRUE, loci = NULL, ...) getSequences(x, ...) 4methodgetSequencesmultidna(x, loci = NULL, ids = NULL, simplify = TRUE, exclude.gap.only = TRUE, ...) 4methodgetSequencesmultiphyDat(x, loci = NULL, ids = NULL, simplify = TRUE, exclude.gap.only = TRUE, ...)In 4classmultidna and 4classmultiphyDat, some individuals may not be sequenced for all genes. The generic function add.gaps has method for both objects; it identifies the missing sequences, and adds gap-only sequences to the alignments wherever needed.
add.gaps(x, ...) 4methodadd.gapsmultidna(x, ...) 4methodadd.gapsmultiphyDat(x, ...)Toolkit for the analysis of multiple gene data (Jombart et al. 2017) 10.1111/1755-0998.12567. 'apex' implements the new S4 classes 'multidna', 'multiphyDat' and associated methods to handle aligned DNA sequences from multiple genes.
These functions concatenate separate DNA alignments into a single alignement matrix. concatenate is a generic with methods for: multidna: returns a DNAbin matrix multiphyDat: returns a phyDat object
concatenate(x, ...) 4methodconcatenatemultidna(x, genes = TRUE, ...) 4methodconcatenatemultiphyDat(x, genes = TRUE, ...)## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x plot(x) image(concatenate(x))This function computes pairwise genetic distances between individuals using genes in a 4classmultidna object. By default, one distance matrix (dist object) is created for each each, but a single distance can be derived by pooling all genes (argument pool=TRUE)
dist.multidna(x, pool = FALSE, genes = TRUE, ...)## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x plot(x) ## get separate distance matrix and pooled one lD <- dist.multidna(x) D <- dist.multidna(x, pool=TRUE) ## get corresponding NJ trees ltrees <- lapply(lD, nj) tree <- nj(D) opar <- par(no.readonly=TRUE) par(mfrow=c(3,1)) for(i in 1:2) plot(ltrees[[i]], main=names(ltrees)[i]) plot(tree, main="Pooled distances") par(opar)This function builds separate phylogenetic trees for each gene in a 4classmultidna object, specifying a method for computing pairwise distances between individuals, and a method to build the tree from the distance matrix. By default, procedures from ape are used.
getTree(x, pool = FALSE, genes = TRUE, model = "N", pairwise.deletion = TRUE, method = nj, ladderize = TRUE, negative.branch.length = FALSE, ...)## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x plot(x) ## make trees, default parameters trees <- getTree(x) trees plot(trees, type="unrooted") ## make one single tree based on concatenated genes tree <- getTree(x, pool=TRUE) tree plot(tree, type="unrooted")New 4classmultidna objects can be created using new("multidna", ...) where "..." are arguments documented below. The main input is a list of DNAbin matrices. The constructor ensures that all matrices will be reordered in the same way, and as an option (setting add.gaps=TRUE, gap-only sequences ("...-----...") will be added wherever sequences are missing.
4methodinitializemultidna(.Object, dna = NULL, ind.info = NULL, gene.info = NULL, add.gaps = TRUE, quiet = FALSE, ...)## empty object new("multidna") ## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x image(woodmouse) image(x@dna[[1]]) image(x@dna[[2]]) ## trickier conversion with missing sequences / wrong order genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[c(5:1,14:15),501:965]) x <- new("multidna", genes) x image(x@dna[[1]]) image(x@dna[[2]])New 4classmultiphyDat objects can be created using new("multiphyDat", ...) where "..." are arguments documented below. The main input is a list of phyDat matrices. The constructor ensures that all matrices will be reordered in the same way, and genes with missing individuals will be filled by sequences of gaps ("-").
4methodinitializemultiphyDat(.Object, seq = NULL, type = character(0), ind.info = NULL, gene.info = NULL, add.gaps = TRUE, quiet = FALSE, ...)data(Laurasiatherian) #' ## empty object new("multiphyDat") ## simple conversion with nicely ordered output genes <- list(gene1=Laurasiatherian[, 1:1600], gene2=Laurasiatherian[, 1601:3179]) x <- new("multiphyDat", genes) x ## trickier conversion with missing sequences / wrong order genes <- list(gene1=Laurasiatherian[1:40,], gene2=Laurasiatherian[8:47, ]) x <- new("multiphyDat", genes) xThis formal (S4) class is used to store multiple DNA alignments. Sequences are stored as a (possibly named) list, with each element of the list being a separate DNA alignment stored as a DNAbin matrix. The rows of the separate matrices all correspond to the same individuals, ordered identically.
## empty object new("multidna") ## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x image(woodmouse) image(x@dna[[1]]) image(x@dna[[2]]) ## trickier conversion with missing sequences / wrong order genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[c(5:1,14:15),501:965]) x <- new("multidna", genes) x image(x@dna[[1]]) image(x@dna[[2]])The functions multidna2alignment and multiphyDat2alignment concatenates separate sequences and return an alignment object of the seqinr package.
multidna2alignment(x, genes = TRUE) multiphyDat2alignment(x, genes = TRUE)## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x y <- multidna2alignment(x) y x2 <- multidna2multiphyDat(x) z <- multiphyDat2alignment(x2)The functions multidna2genind and multiphyDat2genind concatenates separate DNA alignments, and then extracts SNPs of the resulting alignment into a [adegenet:genind-class]genind object.
multidna2genind(x, genes = TRUE, mlst = FALSE, gapIsNA = FALSE) multiphyDat2genind(x, genes = TRUE, mlst = FALSE, gapIsNA = FALSE)## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x y <- multidna2multiphyDat(x) y z1 <- multidna2genind(x) z1 z2 <- multiphyDat2genind(y) all.equal(z1, z2)The functions multidna2multiphyDat and multiphyDat2multidna are used to convert data between 4classmultidna and 4classmultiphyDat classes.
multidna2multiphyDat(x) multiphyDat2multidna(x)## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x ## conversion multidna -> multiphyDat y <- multidna2multiphyDat(x) y ## check round trip identical(x, multiphyDat2multidna(y))This formal (S4) class is identical to 4classmultidna, except that DNA sequences are stored using phyDat objects from the phangorn package. Sequences are stored as a (possibly named) list, with each element of the list being a separate DNA alignment stored as a phyDat object. The rows of the separate matrices all correspond to the same individuals, ordered identically.
data(Laurasiatherian) ## empty object new("multiphyDat") ## simple conversion with nicely ordered output data(Laurasiatherian) genes <- list(gene1=Laurasiatherian[, 1:1600], gene2=Laurasiatherian[, 1601:3179]) x <- new("multiphyDat", genes) x ## trickier conversion with missing sequences / wrong order genes <- list(gene1=Laurasiatherian[1:40,], gene2=Laurasiatherian[8:47,]) x <- new("multiphyDat", genes) xDefault printing for multidna objects
4methodplotmultidna(x, y, rows = TRUE, ask = FALSE, ...)## simple conversion with nicely ordered output data(woodmouse) genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965]) x <- new("multidna", genes) x plot(x)These functions read multiple DNA alignments and store the output in a 4classmultidna object. They are relying on ape's original functions [ape]read.dna and [ape]read.FASTA.
read.multidna(files, add.gaps = TRUE, ...) read.multiFASTA(files, add.gaps = TRUE) read.multiphyDat(files, add.gaps = TRUE, ...)## get path to the files files <- dir(system.file(package="apex"),patter="patr", full=TRUE) files ## read files x <- read.multiFASTA(files) x opar <- par(no.readonly=TRUE) par(mfrow=c(2,2)) plot(x, row=FALSE) par(opar) y <- read.multiphyDat(files, format="fasta") yIn 4classmultidna and 4classmultiphyDat, some individuals may not be sequenced for all genes, resulting in gap-only sequences for missing data. The generic function rm.gaps has method for both objects; it identifies the missing sequences, and removes gap-only sequences from the alignments wherever needed.
rm.gaps(x, ...) 4methodrm.gapsmultidna(x, ...) 4methodrm.gapsmultiphyDat(x, ...)Default printing for multidna objects
4methodshowmultidna(object)Default printing for multiphyDat objects
4methodshowmultiphyDat(object)| Repository | Version | Published | First seen | Last seen | Docs |
|---|---|---|---|---|---|
| CRAN | 1.0.7 | 2026-05-29 | 2026-05-30 |
표시할 OSV 데이터가 없습니다.
표시할 OpenAlex 데이터가 없습니다.