Added the parameter gencode.cols to track.gencode
This is character vector specifying additional columns to include in the gencode data used to generate the gTrack.
Then as long as 'score', 'type', and 'label' are actual column names in gencode then we expect these to be available in the GrangesList associated with gngt and accessible in the following way:
Where i is an integer corresponding to the i'th gene (notice that gngt@data[[1]] is a GRangesList where each item GRanges corresponds to a gene).
This means we could now use these fields for example in the following way:
gngt$gr.labelfield = 'score'
The special field: "label"
We treat "label" as a special case, where if gencode includes a "label" field and "label" %in% gencode.cols then the
"label" column is used to annotate not just each GRanges, but also the metadata of the GRangesList. The value for each gene is assumes to be unique (since each row in the GRangeList metadata corresponds to a gene and hence only a single value could be assigned to each gene).
This allows for the following use usage:
gngt$grl.labelfield = 'label'
By default gngt$grl.labelfield is set to id which is hardcoded to inherit the values of gene_name in the gencode input. label allows us to provide an alternative. So for example, if we want to have all genes included in gngt, but we only want some specific genes of interest to have labels then we can do something like this:
Where gencode.fn is the path to a gencode gff file and genes_of_interest is a character vector with gene names.
Notice that gencode.cols is by default set to label and hence we don't need to specify it in the code above.
Added the parameter
gencode.cols
totrack.gencode
This is character vector specifying additional columns to include in the gencode data used to generate the gTrack.So for example if we run:
Then as long as 'score', 'type', and 'label' are actual column names in
gencode
then we expect these to be available in the GrangesList associated with gngt and accessible in the following way:Where
i
is an integer corresponding to the i'th gene (notice that gngt@data[[1]] is a GRangesList where each item GRanges corresponds to a gene).This means we could now use these fields for example in the following way:
The special field: "label"
We treat "label" as a special case, where if
gencode
includes a "label" field and"label" %in% gencode.cols
then the "label" column is used to annotate not just each GRanges, but also the metadata of the GRangesList. The value for each gene is assumes to be unique (since each row in the GRangeList metadata corresponds to a gene and hence only a single value could be assigned to each gene).This allows for the following use usage:
By default
gngt$grl.labelfield
is set toid
which is hardcoded to inherit the values ofgene_name
in the gencode input.label
allows us to provide an alternative. So for example, if we want to have all genes included ingngt
, but we only want some specific genes of interest to have labels then we can do something like this:Where
gencode.fn
is the path to a gencode gff file andgenes_of_interest
is a character vector with gene names. Notice thatgencode.cols
is by default set tolabel
and hence we don't need to specify it in the code above.