~ubuntu-branches/ubuntu/wily/r-bioc-genomeinfodb/wily-proposed

« back to all changes in this revision

Viewing changes to man/GenomeInfoDb-helpers.Rd

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2014-06-08 18:33:04 UTC
  • Revision ID: package-import@ubuntu.com-20140608183304-mid40gs3cnaz8j3v
Tags: upstream-1.0.2
ImportĀ upstreamĀ versionĀ 1.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\name{GenomeInfoDb-helpers}
 
2
 
 
3
\alias{GenomeInfoDb-helpers}
 
4
\alias{genomeStyles}
 
5
\alias{extractSeqlevels}
 
6
\alias{extractSeqlevelsByGroup}
 
7
\alias{orderSeqlevels}
 
8
\alias{mapSeqlevels}
 
9
\alias{seqlevelsInGroup}
 
10
\alias{seqlevelsStyle}
 
11
\alias{seqlevelsStyle,character-method}
 
12
\alias{seqlevelsStyle<-}
 
13
\alias{seqlevelsStyle<-,character-method}
 
14
 
 
15
 
 
16
\title{
 
17
List the supported seqname styles for all supported organisms
 
18
}
 
19
\description{
 
20
List the supported seqname styles for all supported organisms
 
21
}
 
22
\usage{
 
23
genomeStyles(species)
 
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)
 
29
seqlevelsStyle(x)
 
30
seqlevelsStyle(x) <- value
 
31
 
 
32
}
 
33
\arguments{
 
34
   \item{species}{
 
35
      The genus and species of the organism in question
 
36
      separated by a single space. Don't forget to capitalize the genus.}
 
37
   \item{style}{
 
38
      a character vector with a single element to specify the style.}
 
39
   \item{group}{ 
 
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.}
 
43
   \item{best.only}{
 
44
      if \code{TRUE} (the default), then only the "best"
 
45
      sequence renaming maps (i.e. the rows with less NAs) are returned.}
 
46
   \item{drop}{
 
47
      if \code{TRUE} (the default), then a vector is returned
 
48
      instead of a matrix when the matrix has only 1 row.}
 
49
   \item{seqnames}{ 
 
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"}
 
54
   \item{X.is.sexchrom}{
 
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".
 
58
   }
 
59
   \item{x}{
 
60
      The object from/on which to get/set the sequence information.}
 
61
   \item{value}{
 
62
      A single character string that sets the seqnameStyle for \code{x}.}
 
63
}
 
64
\value{
 
65
  For \code{extractSeqlevels} , \code{extractSeqlevelsByGroup} and 
 
66
  \code{seqlevelsInGroup} returns a character vector of seqlevels 
 
67
  for given supported species and group.
 
68
    
 
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
 
71
  
 
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
 
75
  GenomeInfoDb.
 
76
  
 
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.
 
81
  
 
82
  For \code{orderSeqlevels} returns an integer vector with indices of seqlevels
 
83
  in their natural order. 
 
84
}
 
85
\details{
 
86
    \code{genomeStyles}:
 
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.
 
91
    
 
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).
 
96
    
 
97
    genomeStyles(species) returns a data.frame only for the given organism 
 
98
    with all its supported seqname mappings. 
 
99
      
 
100
    \code{extractSeqlevels}:
 
101
    Returns a character vector of the seqnames for a single style and species.
 
102
    
 
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. 
 
108
    
 
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
 
112
    
 
113
    \code{mapSeqlevels}:
 
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.
 
118
    
 
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 
 
122
    seqnames.
 
123
    Returns a character vector of seqnames after subsetting for the group 
 
124
    specified by the user. See examples for more details.
 
125
    
 
126
    \code{seqlevelsStyle(x)}: finds the seqlevelsStyle for a given character 
 
127
    vector.
 
128
}
 
129
\author{
 
130
    Sonali Arora \email{sarora@fhcrc.org}, Martin Morgan , Marc Carlson, 
 
131
    H. Pages
 
132
}
 
133
\examples{
 
134
 
 
135
names(genomeStyles())
 
136
genomeStyles("Homo_sapiens")
 
137
"UCSC" \%in\% names(genomeStyles("Homo_sapiens"))
 
138
 
 
139
## List the supported seqname style for the given species and the given
 
140
## style
 
141
extractSeqlevels(species="Drosophila_melanogaster" , style="Ensembl")
 
142
 
 
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")
 
147
 
 
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")
 
151
 
 
152
newchr <- as.character(c(1:22,"X","Y","MT"))
 
153
seqlevelsInGroup(newchr, group="all","Homo_sapiens","NCBI")
 
154
 
 
155
## find the seqname Style for a given character vector 
 
156
seqlevelsStyle(paste0("chr",c(1:30)))
 
157
 
 
158
## order a character vector of seqnames
 
159
seqnames <- c("chr1","chr9", "chr2", "chr3", "chr10")
 
160
seqnames[orderSeqlevels(seqnames)]
 
161
 
 
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"))
 
165
 
 
166
## find mapped seqlevelsStyles for exsiting seqnames
 
167
mapSeqlevels(c("chrII", "chrIII", "chrM"), "NCBI")
 
168
mapSeqlevels(c("chrII", "chrIII", "chrM"), "Ensembl")
 
169
 
 
170
}