fetchSequence {dagLogo} | R Documentation

## fetch sequence by id

### Description

fetch amino acid sequence by given identifiers via biomaRt or proteome prepared by `prepareProteome`

### Usage

    fetchSequence(IDs, type="entrezgene", anchorAA=NULL, anchorPos,
                                mart, proteome, upstreamOffset, downstreamOffset)

### Arguments

`IDs` | A vector of Identifiers to retrieve peptides
`type` | type of identifiers
`anchorAA` | a vector of character, anchor Amino Acid
`anchorPos` | a vector of character or numeric, anchor position, for example, K121. Or a vector of character with amino acid sequences. If AA sequences is used, the anchorAA must be the a vector of character with single AA for each.
`mart` | an object of Mart
`proteome` | an object of Proteome, output of `prepareProteome`
`upstreamOffset` | an integer, upstream offset position
`downstreamOffset` | an integer, downstream offset position

### Value

return an object of `dagPeptides`

### Author(s)

Jianhong Ou, Alexey Stukalov, Julie Zhu

### See Also

`formatSequence`

### Examples

    if(interactive()){
        mart <- useMart("ensembl", "dmelanogaster_gene_ensembl")
        dat <- read.csv(system.file("extdata", "dagLogoTestData.csv", package="dagLogo"))
        seq <- fetchSequence(as.character(dat$entrez_geneid[1:5]),
                    anchorPos=as.character(dat$NCBI_site[1:5]),
                    mart=mart,
                    upstreamOffset=7,
                    downstreamOffset=7)
        ## sample: use sequence as anchorPos
        sequences <- seq@peptides
        sequences[, 8] <- "k"
        sequences <- apply(sequences, 1, paste, collapse="")
        seq <- fetchSequence(as.character(seq@data$IDs),
                            anchorAA="k",
                            anchorPos=sequences,
                            mart=mart,
                            upstreamOffset=7,
                            downstreamOffset=7)
        ## sample: use sequence as anchorPos 2
        sequences <- cbind(seq@peptides[, 1:8], "*", seq@peptides[, 9:15])
        sequences <- apply(sequences, 1, paste, collapse="")
        seq <- fetchSequence(as.character(seq@data$IDs),
                            anchorAA="*",
                            anchorPos=sequences,
                            mart=mart,
                            upstreamOffset=7,
                            downstreamOffset=7)
    }

[Package dagLogo version 1.20.0 Index]