1
\name{GenomeInfoDb-helpers}
3
\alias{GenomeInfoDb-helpers}
5
\alias{extractSeqlevels}
6
\alias{extractSeqlevelsByGroup}
9
\alias{seqlevelsInGroup}
10
\alias{seqlevelsStyle}
11
\alias{seqlevelsStyle,character-method}
12
\alias{seqlevelsStyle<-}
13
\alias{seqlevelsStyle<-,character-method}
17
List the supported seqname styles for all supported organisms
20
List the supported seqname styles for all supported organisms
24
extractSeqlevels(species, style)
25
extractSeqlevelsByGroup(species, style, group)
26
orderSeqlevels(seqnames, X.is.sexchrom = NA)
27
mapSeqlevels(seqnames, style, best.only=TRUE, drop=TRUE)
28
seqlevelsInGroup(seqnames, group, species, style)
30
seqlevelsStyle(x) <- value
35
The genus and species of the organism in question
36
separated by a single space. Don't forget to capitalize the genus.}
38
a character vector with a single element to specify the style.}
40
Group can be 'auto' for autosomes, 'sex' for
41
sex chromosomes/allosomes, 'circular' for circular chromosomes. The
42
default is 'all' which returns all the chromosomes.}
44
if \code{TRUE} (the default), then only the "best"
45
sequence renaming maps (i.e. the rows with less NAs) are returned.}
47
if \code{TRUE} (the default), then a vector is returned
48
instead of a matrix when the matrix has only 1 row.}
50
a character vector containing the labels attached to the
51
chromosomes in a given genome for a given style. For example : For
52
\emph{Homo sapiens}, NCBI style - they are
53
"1","2","3",...,"X","Y","MT"}
55
A logical indicating whether X refers to the sexual chromosome or
56
to chromosome with Roman Numeral X. If \code{NA},
57
\code{makeSeqnameIds} does its best to "guess".
60
The object from/on which to get/set the sequence information.}
62
A single character string that sets the seqnameStyle for \code{x}.}
65
For \code{extractSeqlevels} , \code{extractSeqlevelsByGroup} and
66
\code{seqlevelsInGroup} returns a character vector of seqlevels
67
for given supported species and group.
69
For \code{mapSeqlevels} returns a matrix with 1 column per supplied sequence
70
name and 1 row per sequence renaming map compatible with the specified style
72
For \code{seqlevelsStyle} returns a single character string containing the
73
style of the seqlevels supplied. Note that this information is not stored in
74
\code{x} but inferred by looking up a seqlevel style database stored inside
77
For \code{genomeStyle} : If species is specified returns a data.frame
78
containg the seqlevel style and its mapping for a given organism. If species
79
is not specified, a list is returned with one list per species containing
80
the seqlevel style with the corresponding mappings.
82
For \code{orderSeqlevels} returns an integer vector with indices of seqlevels
83
in their natural order.
87
Different organizations have different naming conventions for how they
88
name the biologically defined sequence elements (usually chromosomes)
89
for each organism they support. The Seqnames package contains a
90
database that defines these different conventions.
92
genomeStyles() returns the list of all supported seqname mappings,
93
one per supported organism. Each mapping is represented as a data frame
94
with 1 column per seqname style and 1 row per chromosome name
95
(not all chromosomes of a given organism necessarily belong to the mapping).
97
genomeStyles(species) returns a data.frame only for the given organism
98
with all its supported seqname mappings.
100
\code{extractSeqlevels}:
101
Returns a character vector of the seqnames for a single style and species.
103
\code{extractSeqlevelsByGroup}:
104
Returns a character vector of the seqnames for a single style and species
105
by group. Group can be 'auto' for autosomes, 'sex' for sex chromosomes/
106
allosomes, 'circular' for circular chromosomes. The default is 'all' which
107
returns all the chromosomes.
109
\code{orderSeqlevels}:
110
Returns an integer vector while attempting to provide the \dQuote{natural}
111
order of seqnames, e.g.,\code{chr1}, \code{chr2}, \code{chr3}, \ldots
114
Returns a matrix with 1 column per supplied sequence name and 1 row
115
per sequence renaming map compatible with the specified style.
116
If \code{best.only} is \code{TRUE} (the default), only the "best"
117
renaming maps (i.e. the rows with less NAs) are returned.
119
\code{seqlevelsInGroup}:
120
It takes a character vector along with a group and optional style and
121
species.If group is not specified , it returns "all" or standard/top level
123
Returns a character vector of seqnames after subsetting for the group
124
specified by the user. See examples for more details.
126
\code{seqlevelsStyle(x)}: finds the seqlevelsStyle for a given character
130
Sonali Arora \email{sarora@fhcrc.org}, Martin Morgan , Marc Carlson,
135
names(genomeStyles())
136
genomeStyles("Homo_sapiens")
137
"UCSC" \%in\% names(genomeStyles("Homo_sapiens"))
139
## List the supported seqname style for the given species and the given
141
extractSeqlevels(species="Drosophila_melanogaster" , style="Ensembl")
143
## List all sex chromosomes for Homo sapiens using style UCSC
144
## 3 groups are supported: 'auto' for autosomes, 'sex' for allosomes
145
## and 'circular' for circular chromosomes
146
extractSeqlevelsByGroup(species="Homo_sapiens", style="UCSC", group="sex")
148
## find whether the seqnames belong to a given group
149
newchr <- paste0("chr",c(1:22,"X","Y","M","1_gl000192_random","4_ctg9"))
150
seqlevelsInGroup(newchr, group="sex")
152
newchr <- as.character(c(1:22,"X","Y","MT"))
153
seqlevelsInGroup(newchr, group="all","Homo_sapiens","NCBI")
155
## find the seqname Style for a given character vector
156
seqlevelsStyle(paste0("chr",c(1:30)))
158
## order a character vector of seqnames
159
seqnames <- c("chr1","chr9", "chr2", "chr3", "chr10")
160
seqnames[orderSeqlevels(seqnames)]
162
## if we have a vector conatining seqnames and we want to verify the
163
## species and style for them , we can use:
164
all(seqnames \%in\% extractSeqlevels("Homo_sapiens", "UCSC"))
166
## find mapped seqlevelsStyles for exsiting seqnames
167
mapSeqlevels(c("chrII", "chrIII", "chrM"), "NCBI")
168
mapSeqlevels(c("chrII", "chrIII", "chrM"), "Ensembl")