Entering edit mode
julrodr80
▴
30
@julrodr80-11991
Last seen 7.2 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?
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?
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, ]