Entering edit mode
11.4 years ago
tomislav.ilicic
▴
120
Hi,
I am trying to retrive for a list of genes with their location on the chromosomes:
gene_locations<-getBM(attributes = c("ensembl_gene_id","chromosome_name", "start_position", "end_position"), filters='ensembl_gene_id', values = combined_cells_genes, mart = ens)
Now I would like to sort this list after their location on the genome (sort after chromosome + start position). Is there any straightforward way to do that within biomart, without having me to sort them with my own R code?
Thanks in advance, T
To fix the lexical rather than numeric chromosome sorting, you would have to convert the chromosome_name column to a factor with the levels in the desired order:
Remember that R is 1-indexed, so you are probably ordering them by chromosome_name and start_position.
yes, that is what I do. thx