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

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

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

                                        SNP injection
                                         硝普钠注射液

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

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

Inject SNPs from a SNPlocs data package into a genome.
从SNPlocs数据包注入到基因组的SNP。


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


injectSNPs(x, SNPlocs_pkgname)

SNPlocs_pkgname(x)
SNPcount(x)
SNPlocs(x, seqname)

## Related utilities
available.SNPs(type=getOption("pkgType"))
installed.SNPs()



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

参数:x
A BSgenome object.  
BSgenome对象。


参数:SNPlocs_pkgname
The name of a SNPlocs data package containing SNP information for the single sequences contained in x. This package must be already installed (injectSNPs won't try to install it).  
一个SNPlocs数据包包含在x所载的单序列单核苷酸多态性信息的名称。这个包必须已经安装(injectSNPs不会尝试安装它)。


参数:seqname
The name of a single sequence in x.  
在x单一序列的名称。


参数:type
Character string indicating the type of package ("source", "mac.binary" or "win.binary") to look for.  
字符串,指示包("source","mac.binary"或"win.binary"),以寻找的类型。


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

injectSNPs returns a copy of the original genome x where some or all of the single sequences were altered by injecting the SNPs defined in the SNPlocs data package specified thru the SNPlocs_pkgname argument. The SNPs in the altered genome are represented by an IUPAC ambiguity code at each SNP location.
injectSNPs返回原基因的副本x单序列的部分或全部被注射在指定SNPlocs通过SNPlocs_pkgname参数数据包中定义的单核苷酸多态性改变。改变基因组的单核苷酸多态性代表IUPAC模糊代码在每个SNP的位置。

SNPlocs_pkgname, SNPcount and SNPlocs return NULL if no SNPs were injected in x (i.e. if x is not a BSgenome object returned by a previous call to injectSNPs). Otherwise SNPlocs_pkgname returns the name of the package from  which the  SNPs were injected, SNPcount the number of SNPs for each altered sequence in x, and SNPlocs their locations in the sequence whose name is specified by seqname.
SNPlocs_pkgname,SNPcount和SNPlocs回NULL如果没有SNPs被注入x(即x不是BSgenome的对象返回以前调用injectSNPs)。否则SNPlocs_pkgname返回的SNPs注射的包的名称,SNPcountx,SNPlocs他们的序列中的位置每个改变序列的SNP他的名字被指定seqname。

available.SNPs returns a character vector containing the names of the SNPlocs data packages that are currently available on the Bioconductor repositories for your version of R/Bioconductor. A SNPlocs data package contains basic SNP information (location and alleles) for a given organism.
available.SNPs返回一个字符的向量,目前正在对您的版本的R / Bioconductor Bioconductor库的SNPlocs数据包名称。 SNPlocs数据包包含基本的SNP对于一个给定的有机体的信息(位置和等位基因)。

installed.SNPs returns a character vector containing the names of the SNPlocs data packages that are already installed.
installed.SNPs返回一个字符向量,其中包含已安装的SNPlocs数据包的名称。


注意----------Note----------

injectSNPs, SNPlocs_pkgname, SNPcount and SNPlocs have the side effect to try to load the SNPlocs data package if it's not already loaded.
injectSNPs,SNPlocs_pkgname,SNPcount和SNPlocs有副作用尝试加载SNPlocs的数据包,如果它不是已经加载。


作者(S)----------Author(s)----------


H. Pages



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

BSgenome-class, IUPAC_CODE_MAP, injectHardMask, letterFrequencyInSlidingView, .inplaceReplaceLetterAt
BSgenome-级,IUPAC_CODE_MAP,injectHardMask,letterFrequencyInSlidingView,.inplaceReplaceLetterAt


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


  ## What SNPlocs data packages are already installed:[#什么SNPlocs数据包已经安装:]
  installed.SNPs()

  ## What SNPlocs data packages are available:[#SNPlocs数据包可供选择:]
  available.SNPs()

  if (interactive()) {
    ## Make your choice and install with:[#请您选择并安装:]
    source("http://bioconductor.org/biocLite.R")
    biocLite("SNPlocs.Hsapiens.dbSNP.20100427")
  }

  ## Inject SNPs from dbSNP into the Human genome:[#从dbSNP的注入到人类基因组的SNP:]
  library(BSgenome.Hsapiens.UCSC.hg19)
  Hsapiens
  SNPlocs_pkgname(Hsapiens)

  SNP_Hsapiens <- injectSNPs(Hsapiens, "SNPlocs.Hsapiens.dbSNP.20100427")
  SNP_Hsapiens  # note the extra "with SNPs injected from ..." line[请注意额外的“注射用单核苷酸多态性”线]
  SNPlocs_pkgname(SNP_Hsapiens)
  SNPcount(SNP_Hsapiens)
  head(SNPlocs(SNP_Hsapiens, "chr1"))

  alphabetFrequency(Hsapiens$chr1)
  alphabetFrequency(SNP_Hsapiens$chr1)

  ## Find runs of SNPs of length at least 25 in chr1. Might require[#查找在chr1的运行长度至少有25个SNPs。可能需要]
  ## more memory than some platforms can handle (e.g. 32-bit Windows[#多一些平台上的内存可以处理(如32位Windows]
  ## and maybe some Mac OS X machines with little memory):[#也许某些Mac OS X的机器用很少的内存):]
  is_32bit_windows <- .Platform$OS.type == "windows" &amp;&amp;
                      .Platform$r_arch == "i386"
  is_macosx <- substr(R.version$os, start=1, stop=6) == "darwin"
  if (!is_32bit_windows &amp;&amp; !is_macosx) {
      chr1 <- injectHardMask(SNP_Hsapiens$chr1)
      ambiguous_letters <- paste(DNA_ALPHABET[5:15], collapse="")
      lf <- letterFrequencyInSlidingView(chr1, 25, ambiguous_letters)
      sl <- slice(as.integer(lf), lower=25)
      v1 <- Views(chr1, start(sl), end(sl)+24)
      v1
      max(width(v1))  # length of longest SNP run[长度最长的单核苷酸多态性运行]
  }

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-25 05:16 , Processed in 0.019706 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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