Skip to content

Instantly share code, notes, and snippets.

@hurrialice
Created April 5, 2022 05:05
Show Gist options
  • Save hurrialice/9de64bbccfdc96a1ed761f7fee4b40b7 to your computer and use it in GitHub Desktop.
Save hurrialice/9de64bbccfdc96a1ed761f7fee4b40b7 to your computer and use it in GitHub Desktop.
quick R snippets in Jupyter Notebooks
### Annotation
%%R -i dedf -o annot_chr
library(biomaRt)
ensembl <- useMart("ensembl",dataset="hsapiens_gene_ensembl")
columns(ensembl)
annot_chr = select(ensembl, keys=dedf[["gene_id"]], columns=c('ensembl_gene_id_version','chromosome_name'),
keytype='ensembl_gene_id_version')
### Genomic Ranges Manipulation (with bedtools equivalent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment