Created
August 22, 2022 07:07
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]>", | |
author="<[email protected]>", | |
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