找回密码
 注册
查看: 651|回复: 0

R语言 Biostrings包 reverseComplement()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 13:49:32 | 显示全部楼层 |阅读模式
reverseComplement(Biostrings)
reverseComplement()所属R语言包:Biostrings

                                        Sequence reversing and complementing
                                         倒车和互补序列

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Use these functions for reversing sequences and/or complementing DNA or RNA sequences.
扭转序列和/或互补的DNA或RNA序列,使用这些功能。


用法----------Usage----------


complement(x, ...)
reverseComplement(x, ...)



参数----------Arguments----------

参数:x
A DNAString, RNAString, DNAStringSet, RNAStringSet, XStringViews (with DNAString or RNAString subject), MaskedDNAString or MaskedRNAString object for complement and reverseComplement.  
一个DNAString,RNAString,DNAStringSet,RNAStringSet,XStringViews与DNAString或RNAString主题,MaskedDNAString或MaskedRNAStringcomplement和reverseComplement对象。


参数:...
Additional arguments to be passed to or from methods.  
额外的参数被传递到或从方法。


Details

详情----------Details----------

See ?reverse for reversing an XString, XStringSet or XStringViews object.
看到?reverse扭转一个XString,XStringSet或XStringViews对象。

If x is a DNAString or RNAString object, complement(x) returns an object where each base in x is "complemented" i.e. A, C, G, T in a DNAString object are replaced by T, G, C, A respectively and A, C, G, U in a RNAString object are replaced by U, G, C, A respectively.
如果x是DNAString或RNAString对象,complement(x)返回一个每个x碱基“补充”对象,即A,C,G,T在DNAString对象所取代T,G,A分别与A,C,Gü在RNAString对象是由U,G,C,A分别取代。

Letters belonging to the IUPAC Extended Genetic Alphabet are also replaced by their complement (M <-> K, R <-> Y, S <-> S, V <-> B, W <-> W, H <-> D, N <-> N) and the gap ("-") and hard masking ("+") letters are unchanged.
信件也属于扩展的遗传字母的IUPAC取代的补(男< - > K,R < - > Y,< - > S,V] < - >乙,宽< - >宽,高< - > D,氮< - > N)和差距("-")和硬掩蔽("+")字母是不变的。

reverseComplement(x) is equivalent to reverse(complement(x)) but is faster and more memory efficient.
reverseComplement(x)相当于reverse(complement(x))的,而且是更快和更高效的内存。


值----------Value----------

An object of the same class and length as the original object.
同一类的对象和原始对象的长度。


参见----------See Also----------

reverse, DNAString-class, RNAString-class, DNAStringSet-class, RNAStringSet-class, XStringViews-class, MaskedXString-class, chartr, findPalindromes, IUPAC_CODE_MAP
相反,DNAString类,级RNAString,级DNAStringSet,级RNAStringSet,级XStringViews,MaskedXString级,chartr,findPalindromes,IUPAC_CODE_MAP


举例----------Examples----------


## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## A. SOME SIMPLE EXAMPLES[#答:一些简单的例子]
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]

x <- DNAString("ACGT-YN-")
reverseComplement(x)

library(drosophila2probe)
probes <- DNAStringSet(drosophila2probe)
probes
alphabetFrequency(probes, collapse=TRUE)
rcprobes <- reverseComplement(probes)
rcprobes
alphabetFrequency(rcprobes, collapse=TRUE)

## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## B. OBTAINING THE MISMATCH PROBES OF A CHIP[#B.获取芯片不匹配探针]
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]

pm2mm <- function(probes)
{
    probes <- DNAStringSet(probes)
    subseq(probes, start=13, end=13) <- complement(subseq(probes, start=13, end=13))
    probes
}
mmprobes <- pm2mm(probes)
mmprobes
alphabetFrequency(mmprobes, collapse=TRUE)

## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## C. SEARCHING THE MINUS STRAND OF A CHROMOSOME[#C.搜索染色体的负链]
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## Applying reverseComplement() to the pattern before calling[#在应用reverseComplement()之前调用模式]
## matchPattern() is the recommended way of searching hits on the[,#matchPattern()是推荐的方式上的搜索点击]
## minus strand of a chromosome.[#染色体的负链。]

library(BSgenome.Dmelanogaster.UCSC.dm3)
chrX <- Dmelanogaster$chrX
pattern <- DNAString("ACCAACNNGGTTG")
matchPattern(pattern, chrX, fixed=FALSE)  # 3 hits on strand +[3点击上链+]
rcpattern <- reverseComplement(pattern)
rcpattern
m0 <- matchPattern(rcpattern, chrX, fixed=FALSE)
m0  # 5 hits on strand -[5链命中 - ]

## Applying reverseComplement() to the subject instead of the pattern is not[#在应用reverseComplement()的格局,而不是问题不]
## a good idea for 2 reasons:[#一个好主意,原因有二:]
## (1) Chromosome sequences are generally big and sometimes very big[#(1)染色体序列是一般大,有时是非常大的]
##     so computing the reverse complement of the positive strand will[#所以计算正股反向补]
##     take time and memory proportional to its length.[#需要时间和内存长度成正比。]
chrXminus &lt;- reverseComplement(chrX)  # needs to allocate 22M of memory![需要分配22M内存!]
chrXminus
## (2) Chromosome locations are generally given relatively to the positive[#(2)染色体的位置一般都相对积极]
##     strand, even for features located in the negative strand, so after[#链,即使是在位于负链的特性,所以后]
##     doing this:[#做这个:]
m1 <- matchPattern(pattern, chrXminus, fixed=FALSE)
##     the start/end of the matches are now relative to the negative strand.[#开始/结束的比赛是相对负链。]
##     You need to apply reverseComplement() again on the result if you want[#你需要再次申请结果reverseComplement()如果你想]
##     them to be relative to the positive strand:[#它们是相对于正股:]
m2 &lt;- reverseComplement(m1)  # allocates 22M of memory, again![分配22M内存,再次!]
##     and finally to apply rev() to sort the matches from left to right[#终于申请转()的比赛进行排序从左至右]
##     (5'3' direction) like in m0:[#(53方向),如在M0:]
m3 &lt;- rev(m2) # same as m0, finally![同为M0,终于来了!]

## WARNING: Before you try the example below on human chromosome 1, be aware[#警告:您尝试之前人类1号染色体上下面的例子中,要注意]
## that it will require the allocation of about 500Mb of memory![#这将需要约500MB的内存分配!]
if (interactive()) {
  library(BSgenome.Hsapiens.UCSC.hg18)
  chr1 <- Hsapiens$chr1
  matchPattern(pattern, reverseComplement(chr1))  # DON'T DO THIS![千万不要这样做!]
  matchPattern(reverseComplement(pattern), chr1)  # DO THIS INSTEAD[做,而不是]
}

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-25 04:24 , Processed in 0.020628 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表