美文网首页
Bimap-direction

Bimap-direction

作者: 生信小博士 | 来源:发表于2020-12-10 22:53 被阅读0次

    From AnnotationDbi v1.34.4 by Bioconductor Package Maintainer

    Methods For Getting/Setting The Direction Of A Bimap Object, And Undirected Methods For Getting/Counting/Setting Its Keys

    These methods are part of the Bimap interface (see ?[Bimap](https://www.rdocumentation.org/link/Bimap?package=AnnotationDbi&version=1.34.4) for a quick overview of the Bimap objects and their interface).

    They are divided in 2 groups: (1) methods for getting or setting the direction of a Bimap object and (2) methods for getting, counting or setting the left or right keys (or mapped keys only) of a Bimap object. Note that all the methods in group (2) are undirected methods i.e. what they return does NOT depend on the direction of the map (more on this below).

    (https://www.rdocumentation.org/search/keywords/methods)</dd>

    Usage
    ## Getting or setting the direction of a Bimap object
    direction(x)
    direction(x) <- value
    revmap(x, ...)
    ## Getting, counting or setting the left or right keys (or mapped
    ## keys only) of a Bimap object
    Lkeys(x)
    Rkeys(x)
    Llength(x)
    Rlength(x)
    mappedLkeys(x)
    mappedRkeys(x)
    count.mappedLkeys(x)
    count.mappedRkeys(x)
    Lkeys(x) <- value
    Rkeys(x) <- value
    "subset"(x, Lkeys = NULL, Rkeys = NULL, drop.invalid.keys = FALSE)
    "subset"(x, Lkeys = NULL, Rkeys = NULL, drop.invalid.keys = FALSE,  objName = NULL)
    
    Arguments

    Extra arguments for subset can be:

    <dl style="box-sizing: inherit;">

    <dt style="box-sizing: inherit; font-weight: 700; float: left; margin-right: 15px;">Lkeys</dt>

    <dd style="box-sizing: inherit; margin-left: 100px; margin-bottom: 1rem;">The new Lkeys.</dd>

    </dl>

    </dd>

    <dt style="box-sizing: inherit; font-weight: 700; float: left; margin-right: 15px;">Rkeys</dt>

    <dd style="box-sizing: inherit; margin-left: 100px; margin-bottom: 1rem;">The new Rkeys.</dd>

    <dt style="box-sizing: inherit; font-weight: 700; float: left; margin-right: 15px;">drop.invalid.keys</dt>

    <dd style="box-sizing: inherit; margin-left: 100px; margin-bottom: 1rem;">If drop.invalid.keys=FALSE (the default), an error will be raised if the new Lkeys or Rkeys contain invalid keys i.e. keys that don't belong to the current Lkeys or Rkeys. If drop.invalid.keys=TRUE, invalid keys are silently dropped.</dd>

    <dt style="box-sizing: inherit; font-weight: 700; float: left; margin-right: 15px;">objName</dt>

    <dd style="box-sizing: inherit; margin-left: 100px; margin-bottom: 1rem;">The name to give to the submap (only supported if x is an AnnDbBimap object).</dd>

    </dl>

    Details

    All Bimap objects have a direction which can be left-to-right (i.e. the mapping goes from the left keys to the right keys) or right-to-left (i.e. the mapping goes from the right keys to the left keys). A Bimap object x that maps from left to right is considered to be a direct map. Otherwise it is considered to be an indirect map (when it maps from right to left).

    direction returns 1 on a direct map and -1 otherwise.

    The direction of x can be changed with direction(x) <- value where value must be 1 or -1. An easy way to reverse a map (i.e. to change its direction) is to do direction(x) <- - direction(x), or, even better, to use revmap(x) which is actually the recommended way for doing it.

    The Lkeys and Rkeys methods return respectively the left and right keys of a Bimap object. Unlike the [keys](https://www.rdocumentation.org/link/keys?package=AnnotationDbi&version=1.34.4) method (see ?[keys](https://www.rdocumentation.org/link/keys?package=AnnotationDbi&version=1.34.4) for more information), these methods are direction-independent i.e. what they return does NOT depend on the direction of the map. Such methods are also said to be "undirected methods" and methods like the [keys](https://www.rdocumentation.org/link/keys?package=AnnotationDbi&version=1.34.4) method are said to be "directed methods".

    All the methods described below are also "undirected methods".

    Llength(x) and Rlength(x) are equivalent to (but more efficient than) length(Lkeys(x)) and length(Rkeys(x)), respectively.

    The mappedLkeys (or mappedRkeys) method returns the left keys (or right keys) that are mapped to at least one right key (or one left key).

    count.mappedLkeys(x) and count.mappedRkeys(x) are equivalent to (but more efficient than) length(mappedLkeys(x)) and length(mappedRkeys(x)), respectively. These functions give overall summaries, if you want to know how many Rkeys correspond to a given Lkey you can use the nhit function.

    Lkeys(x) <- value and Rkeys(x) <- value are the undirected versions of keys(x) <- value (see ?[keys](https://www.rdocumentation.org/link/keys?package=AnnotationDbi&version=1.34.4) for more information) and subset(x, Lkeys=new_Lkeys, Rkeys=new_Rkeys) is provided as a convenient way to reduce the sets of left and right keys in one single function call.

    Value

    <dl style="box-sizing: inherit;">1L or -1L for direction.A Bimap object of the same subtype as x for revmap and subset.A character vector for Lkeys, Rkeys, mappedLkeys and mappedRkeys.A single non-negative integer for Llength, Rlength, count.mappedLkeys and count.mappedRkeys.</dl>

    相关文章

      网友评论

          本文标题:Bimap-direction

          本文链接:https://www.haomeiwen.com/subject/vgldgktx.html