How to subset a GRanges via an argument passed into a function?
subsetter = function(gr, cname) {
    return(mcols(gr)[[cname]])
}


You can then use things like subsetter(gr, "GC") and subsetter(gr, "score").