Learn R Programming

CNEr (version 1.8.3)

subAxt-methods: subAxt method

Description

Get subset of Axt alignments based on chromosome and ranges.

Usage

subAxt(x, chr, start, end, select=c("target", "query"), qSize=NULL)

Arguments

x
A object of Axt.
chr
A object of character. The chromosome name to extract.
start, end
A object of integer. These ranges should be based on the positive strand. When select is "query", the reverse complement alignments which lay inside this range will also be selected.
select
When select is "target", the subset criteria is for target alignments in axts. When select is "query", the subset criteria is for query alignments in axts.
qSize
When select is "query", qSize must be provided and is the length of chromosome chr.

Value

A subset of Axt object is returned.

Details

Usually when we want to subset some axts from a Axt object, we care about all the axts within certain range. The axts can come from the axt file with chr as reference (i.e., target sequence), or the axt file with chr as query sequence. When the chr is query sequence, it can be on the negative strand. Hence, the size of chromosome is necessary to convert the search range to a range on negative strand coordinate.

When one axt is partially overlapped with the range, subset of the axt will be extract. If the extracted axt alignment has gaps at the beginning or the end, the gap columns will be chopped. Therefore, the coordinate of alignments will be changed accordingly.

Examples

Run this code
    
  axtFilesHg19DanRer7 <- file.path(system.file("extdata", package="CNEr"), 
                                  "hg19.danRer7.net.axt")
  axtHg19DanRer7 <- readAxt(axtFilesHg19DanRer7)
  subAxt(axtHg19DanRer7, chr="chr11", start=31500000, end=32500000,
         select="target")
  subAxt(axtHg19DanRer7, chr="chr11", start=c(31082021, 32461267), 
         end=c(31082862,32461581), select="target")
  

Run the code above in your browser using DataLab