Question: Filter CNVs if contain certain gene
0
gravatar for julrodr80
2.2 years ago by
julrodr8030
julrodr8030 wrote:

I have a GR objetc, a list of cnvs with its genes; its possible to subset this cnvs if they have al least one gene of a list of genes?

cnv cnvs genomic ranges • 331 views
ADD COMMENTlink written 2.2 years ago by julrodr8030

Probably, but you will have to be more descriptive than that. Do you have one GRanges object with genes in the mcols, or a GRanges object and a list of genes?

ADD REPLYlink written 2.2 years ago by James W. MacDonald50k

In the same line as  James W. MacDonald.

You probably can get more help if you could show us a few lines of your GRanges object.

If gene names are stored as names of ranges:

    idx = which(names(gr) %in% gene.list)

    gr = gr[idx, ]

If gene names are stored as a column in elementMetadata slot:

    idx = which(mcols(gr)[ ,"Gene_Symbol"] %in% gene.list)

    gr = gr[idx, ]

ADD REPLYlink written 2.2 years ago by Haiying.Kong110
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 223 users visited in the last hour