Hi
I am using the attached biomart script for calculating the dn/ds ratio's between the human and model organisms.
However, in an output file, I am getting dn/ds ratios only for mouse and rat.
For the rest of the model organisms (worm, zebrafish, fruitfly), I am getting NA values
Input file = list of human Ensembl id's
library(biomaRt)
## This gives the full list of all marts, including archives
archives <- listEnsemblArchives()
## For the human data
ensemblhsapiens = useMart(host = 'jan2020.archive.ensembl.org', biomart = 'ENSEMBL_MART_ENSEMBL',
dataset = "hsapiens_gene_ensembl")
filters = listFilters(ensemblhsapiens)
attributes = listAttributes(ensemblhsapiens)
## Input human gene list
hsapiens_GFList <- scan("Human_GF_list.txt", what = character())
## human and Rat
hsapiens_rat <- getBM(attributes = c('ensembl_gene_id', 'rnorvegicus_homolog_ensembl_gene',
'rnorvegicus_homolog_dn',
'rnorvegicus_homolog_ds', 'rnorvegicus_homolog_orthology_type'),
filters = 'ensembl_gene_id',
values = hsapiens_GFList,
mart = ensemblhsapiens)
hsapiens_rat1 <- subset(hsapiens_rat, hsapiens_rat$rnorvegicus_homolog_orthology_type == 'ortholog_one2one')
hsapiens_rat1$dnds_ratios <- hsapiens_rat1$rnorvegicus_homolog_dn/hsapiens_rat1$rnorvegicus_homolog_ds
write.csv(hsapiens_rat1, file = "hsapiens_rat.csv")
## human and mouse
hsapiens_mouse <- getBM(attributes = c('ensembl_gene_id', 'mmusculus_homolog_ensembl_gene',
'mmusculus_homolog_dn',
'mmusculus_homolog_ds', 'mmusculus_homolog_orthology_type'),
filters = 'ensembl_gene_id',
values = hsapiens_GFList,
mart = ensemblhsapiens)
hsapiens_mouse1 <- subset(hsapiens_mouse, hsapiens_mouse$mmusculus_homolog_orthology_type ==
'ortholog_one2one')
hsapiens_mouse1$dnds_ratios <-
hsapiens_mouse1$mmusculus_homolog_dn/hsapiens_mouse1$mmusculus_homolog_ds
write.csv(hsapiens_mouse1, file = "hsapiens_mouse.csv")
## human and c.elegans
hsapiens_celegans <- getBM(attributes = c('ensembl_gene_id', 'celegans_homolog_ensembl_gene',
'celegans_homolog_dn',
'celegans_homolog_ds', 'celegans_homolog_orthology_type'),
filters = 'ensembl_gene_id',
values = hsapiens_GFList,
mart = ensemblhsapiens)
hsapiens_celegans1 <- subset(hsapiens_celegans, hsapiens_celegans$celegans_homolog_orthology_type ==
'ortholog_one2one')
hsapiens_celegans1$dnds_ratios <-
hsapiens_celegans1$celegans_homolog_dn/hsapiens_celegans1$celegans_homolog_ds
write.csv(hsapiens_celegans1, file = "hsapiens_celegans.csv")
## human and Fruitfly
hsapiens_fly <- getBM(attributes = c('ensembl_gene_id', 'dmelanogaster_homolog_ensembl_gene',
'dmelanogaster_homolog_dn',
'dmelanogaster_homolog_ds', 'dmelanogaster_homolog_orthology_type'),
filters = 'ensembl_gene_id',
values = hsapiens_GFList,
mart = ensemblhsapiens)
hsapiens_fly1 <- subset(hsapiens_fly, hsapiens_fly$dmelanogaster_homolog_orthology_type == 'ortholog_one2one')
hsapiens_fly1$dnds_ratios <-
hsapiens_fly1$dmelanogaster_homolog_dn/hsapiens_fly1$dmelanogaster_homolog_ds
write.csv(hsapiens_fly1, file = "hsapiens_fly.csv")
###human and Zebrafish
hsapiens_fish <- getBM(attributes = c('ensembl_gene_id', 'drerio_homolog_ensembl_gene', 'drerio_homolog_dn',
'drerio_homolog_ds', 'drerio_homolog_orthology_type'),
filters = 'ensembl_gene_id',
values = hsapiens_GFList,
mart = ensemblhsapiens)
hsapiens_fish1 <- subset(hsapiens_fish, hsapiens_fish$drerio_homolog_orthology_type == 'ortholog_one2one')
hsapiens_fish1$dnds_ratios <- hsapiens_fish1$drerio_homolog_dn/hsapiens_fish1$drerio_homolog_ds
write.csv(hsapiens_fish1, file = "hsapiens_fish.csv")