Skip to content

Instantly share code, notes, and snippets.

@slavailn
Created August 22, 2022 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slavailn/ed8b6744312bdab1c190dd985f84557a to your computer and use it in GitHub Desktop.
Save slavailn/ed8b6744312bdab1c190dd985f84557a to your computer and use it in GitHub Desktop.
Build annotation package org.Xx.eg.db for a non-model organism (Ovis aries)
library(AnnotationForge)
library(biomaRt)
setwd("path/to/dir")
## Get annotation data frame for Ovis aries from BiomaRt
ensembl <- useMart("ENSEMBL_MART_ENSEMBL", host="https://www.ensembl.org")
ensembl <- useDataset("oaries_gene_ensembl", mart=ensembl)
#126 oaries_gene_ensembl Sheep (texel) genes (Oar_v3.1) Oar_v3.1
attributes_gene <- c("ensembl_gene_id", "uniprot_gn_symbol",
"description", "gene_biotype",
"chromosome_name", "start_position",
"end_position")
# Load DESeq data set
load("expression_data/DESeqOBJ.RData")
ids <- rownames(counts(dds))
gene_table <- getBM(attributes = attributes_gene, values = ids,
mart = ensembl)
# First column must be "GID"
names(gene_table)[1] <- "GID"
gene_table <- gene_table[!duplicated(gene_table$GID),]
head(gene_table)[,1:4]
save(gene_table, file="geneTable.RData")
## Then call the function
makeOrgPackage(gene_info=gene_table,
version="1.0.0",
maintainer="Some Name <some_email@email.com>",
author="<some_email@email.com>",
outputDir = ".",
tax_id="9940",
genus="Ovis",
species="aries")
# Install package
# This step requires RTools
install.packages("./org.Oaries.eg.db", type="source", repos = NULL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment