read.Mask(IRanges)
read.Mask()所属R语言包:IRanges
Read a mask from a file
阅读从一个文件中的面具
译者:生物统计家园网 机器人LoveR
描述----------Description----------
read.agpMask and read.gapMask extract the AGAPS mask from an NCBI "agp" file or a UCSC "gap" file, respectively.
read.agpMask和read.gapMask提取AGAPS面具,分别从NCBI的“AGP”文件或UCSC的“缺口”文件。
read.liftMask extracts the AGAPS mask from a UCSC "lift" file (i.e. a file containing offsets of contigs within sequences).
read.liftMask抽取AGAPS从加州大学圣克鲁兹分校的“升降机”的文件(即文件包含序列重叠群内的偏移量)的面具。
read.rmMask extracts the RM mask from a RepeatMasker .out file.
read.rmMask提取马币面具从RepeatMasker。出的文件。
read.trfMask extracts the TRF mask from a Tandem Repeats Finder .bed file.
read.trfMask提取从串联重复查找的成绩单面具。床文件。
用法----------Usage----------
read.agpMask(file, seqname="?", mask.width=NA, gap.types=NULL, use.gap.types=FALSE)
read.gapMask(file, seqname="?", mask.width=NA, gap.types=NULL, use.gap.types=FALSE)
read.liftMask(file, seqname="?", mask.width=NA)
read.rmMask(file, seqname="?", mask.width=NA, use.IDs=FALSE)
read.trfMask(file, seqname="?", mask.width=NA)
参数----------Arguments----------
参数:file
Either a character string naming a file or a connection open for reading.
无论是一个字符串命名一个文件或一个连接打开阅读。
参数:seqname
The name of the sequence for which the mask must be extracted. If no sequence is specified (i.e. seqname="?") then an error is raised and the sequence names found in the file are displayed. If the file doesn't contain any information for the specified sequence, then a warning is issued and an empty mask of width mask.width is returned.
面具必须提取序列的名称。如果没有指定顺序(即seqname="?"),那么就会引发错误,并显示在文件中找到的序列名称。如果该文件不包含任何指定的序列信息,然后发出警告和空的宽度mask.width面具返回。
参数:mask.width
The width of the mask to return i.e. the length of the sequence this mask will be put on. See ?`MaskCollection-class` for more information about the width of a MaskCollection object.
这个面具的面具即序列的长度,宽度返回将放在。看到?MaskCollection-class宽度一个MaskCollection对象的有关信息。
参数:gap.types
NULL or a character vector containing gap types. Use this argument to filter the assembly gaps that are to be extracted from the "agp" or "gap" file based on their type. Most common gap types are "contig", "clone", "centromere", "telomere", "heterochromatin", "short_arm" and "fragment". With gap.types=NULL, all the assembly gaps described in the file are extracted. With gap.types="?", an error is raised and the gap types found in the file for the specified sequence are displayed.
NULL或字符向量差距的类型。使用此参数来筛选组装的差距,是从“AGP”或“缺口”根据其类型的文件中提取。差距最常见的类型是"contig","clone","centromere","telomere","heterochromatin","short_arm"和"fragment"。用gap.types=NULL,所有大会文件中描述的是差距提取。 :gap.types="?",错误引发的差距和类型在文件中找到指定的顺序显示。
参数:use.gap.types
Whether or not the gap types provided in the "agp" or "gap" file should be used to name the ranges constituing the returned mask. See ?`IRanges-class` for more information about the names of an IRanges object.
无论提供的差距,在“AGP”或“缺口”文件类型应使用来命名的范围constituing返回面具。看到?IRanges-class为有关一个IRanges对象的名称的更多信息。
参数:use.IDs
Whether or not the repeat IDs provided in the RepeatMasker .out file should be used to name the ranges constituing the returned mask. See ?`IRanges-class` for more information about the names of an IRanges object.
是否重复的ID RepeatMasker提供了文件。应使用来命名的范围constituing返回面具。看到?IRanges-class为有关一个IRanges对象的名称的更多信息。
参见----------See Also----------
MaskCollection-class, IRanges-class
MaskCollection级,IRanges级
举例----------Examples----------
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## A. Extract a mask of assembly gaps ("AGAPS" mask) with read.agpMask()[#答:提取的装配差距read.agpMask(面具(“AGAPS”面具))]
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## Note: The hs_b36v3_chrY.agp file was obtained by downloading,[#注:hs_b36v3_chrY.agp文件下载]
## extracting and renaming the hs_ref_chrY.agp.gz file from[#提取和重命名hs_ref_chrY.agp.gz文件]
##[#]
## ftp://ftp.ncbi.nih.gov/genomes/H_sapiens/Assembled_chromosomes/[#ftp://ftp.ncbi.nih.gov/genomes/H_sapiens/Assembled_chromosomes/]
## hs_ref_chrY.agp.gz 5 KB 24/03/08 04:33:00 PM[#hs_ref_chrY.agp.gz 5 KB 24/03/08 4点33分零零秒]
##[#]
## on May 9, 2008.[#2008年5月9日。]
chrY_length <- 57772954
file1 <- system.file("extdata", "hs_b36v3_chrY.agp", package="IRanges")
mask1 <- read.agpMask(file1, seqname="chrY", mask.width=chrY_length,
use.gap.types=TRUE)
mask1
mask1[[1]]
mask11 <- read.agpMask(file1, seqname="chrY", mask.width=chrY_length,
gap.types=c("centromere", "heterochromatin"))
mask11[[1]]
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## B. Extract a mask of assembly gaps ("AGAPS" mask) with read.liftMask()[#B.提取的装配差距read.liftMask(面具(“AGAPS”面具))]
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## Note: The hg18liftAll.lft file was obtained by downloading,[#注:hg18liftAll.lft文件下载]
## extracting and renaming the liftAll.zip file from[#提取和重命名文件liftAll.zip]
##[#]
## http://hgdownload.cse.ucsc.edu/goldenPath/hg18/bigZips/[#http://hgdownload.cse.ucsc.edu/goldenPath/hg18/bigZips/]
## liftAll.zip 03-Feb-2006 11:35 5.5K[#liftAll.zip 2月03-2006 11:35 5.5K]
##[#]
## on May 8, 2008.[#2008年5月8日。]
file2 <- system.file("extdata", "hg18liftAll.lft", package="IRanges")
mask2 <- read.liftMask(file2, seqname="chr1")
mask2
if (interactive()) {
## contigs 7 and 8 for chrY are adjacent[#重叠群7和为chrY 8,相邻]
read.liftMask(file2, seqname="chrY")
## displays the sequence names found in the file[#显示序列名称在文件中找到]
read.liftMask(file2)
## specify an unknown sequence name[#指定一个未知的序列名。]
read.liftMask(file2, seqname="chrZ", mask.width=300)
}
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## C. Extract a RepeatMasker ("RM") or Tandem Repeats Finder ("TRF")[#C。提取RepeatMasker(“马币”)或串联重复查找(“成绩单”)]
## mask with read.rmMask() or read.trfMask()[#面罩read.rmMask()或read.trfMask()]
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## Note: The ce2chrM.fa.out and ce2chrM.bed files were obtained by[#注:的ce2chrM.fa.out和ce2chrM.bed文件,得到了]
## downloading, extracting and renaming the chromOut.zip and[#下载,解压缩和重命名chromOut.zip]
## chromTrf.zip files from[的#chromTrf.zip文件]
##[#]
## http://hgdownload.cse.ucsc.edu/goldenPath/ce2/bigZips/[#http://hgdownload.cse.ucsc.edu/goldenPath/ce2/bigZips/]
## chromOut.zip 21-Apr-2004 09:05 2.6M[#chromOut.zip 21-APR-2004 09:05 2.6M]
## chromTrf.zip 21-Apr-2004 09:07 182K[#chromTrf.zip 21-APR-2004 09:07 182K]
##[#]
## on May 7, 2008.[#2008年5月7日。]
## Before you can extract a mask with read.rmMask() or read.trfMask(), you[#之前,您可以提取read.rmMask()或read.trfMask(面具),]
## need to know the length of the sequence that you're going to put the[#需要知道序列的长度,你要放]
## mask on:[#掩盖:]
if (interactive()) {
library(BSgenome.Celegans.UCSC.ce2)
chrM_length <- seqlengths(Celegans)[["chrM"]]
## Read the RepeatMasker .out file for chrM in ce2:[#阅读RepeatMasker出在CE2磁场方向的文件。]
file3 <- system.file("extdata", "ce2chrM.fa.out", package="IRanges")
RMmask <- read.rmMask(file3, seqname="chrM", mask.width=chrM_length)
RMmask
## Read the Tandem Repeats Finder .bed file for chrM in ce2:[#阅读串联重复查找床的特征剩磁CE2文件。]
file4 <- system.file("extdata", "ce2chrM.bed", package="IRanges")
TRFmask <- read.trfMask(file4, seqname="chrM", mask.width=chrM_length)
TRFmask
desc(TRFmask) <- paste(desc(TRFmask), "[period<=12]")
TRFmask
## Put the 2 masks on chrM:[#对磁场方向2口罩:]
chrM <- Celegans$chrM
masks(chrM) <- RMmask # this would drop all current masks, if any[这将删除所有当前的口罩,如有]
masks(chrM) <- append(masks(chrM), TRFmask)
chrM
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|