Filter CNVs if contain certain gene
0
0
Entering edit mode
julrodr80 ▴ 30
@julrodr80-11991
Last seen 7.1 years ago

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 genomic ranges cnvs • 1.1k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 715 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6