Last updated: 2025-02-18

Checks: 7 0

Knit directory: muse/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20200712) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 4aeedcb. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rproj.user/
    Ignored:    data/1M_neurons_filtered_gene_bc_matrices_h5.h5
    Ignored:    data/293t/
    Ignored:    data/293t_3t3_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/293t_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/5k_Human_Donor1_PBMC_3p_gem-x_5k_Human_Donor1_PBMC_3p_gem-x_count_sample_filtered_feature_bc_matrix.h5
    Ignored:    data/5k_Human_Donor2_PBMC_3p_gem-x_5k_Human_Donor2_PBMC_3p_gem-x_count_sample_filtered_feature_bc_matrix.h5
    Ignored:    data/5k_Human_Donor3_PBMC_3p_gem-x_5k_Human_Donor3_PBMC_3p_gem-x_count_sample_filtered_feature_bc_matrix.h5
    Ignored:    data/5k_Human_Donor4_PBMC_3p_gem-x_5k_Human_Donor4_PBMC_3p_gem-x_count_sample_filtered_feature_bc_matrix.h5
    Ignored:    data/Parent_SC3v3_Human_Glioblastoma_filtered_feature_bc_matrix.tar.gz
    Ignored:    data/brain_counts/
    Ignored:    data/cl.obo
    Ignored:    data/cl.owl
    Ignored:    data/jurkat/
    Ignored:    data/jurkat:293t_50:50_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/jurkat_293t/
    Ignored:    data/jurkat_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/pbmc4k_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/refdata-gex-GRCh38-2020-A.tar.gz
    Ignored:    data/seurat_1m_neuron.rds
    Ignored:    data/t_3k_filtered_gene_bc_matrices.tar.gz
    Ignored:    r_packages_4.4.1/

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/cross_species.Rmd) and HTML (docs/cross_species.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 4aeedcb Dave Tang 2025-02-18 CD4 and CD8 markers
html 102d48a Dave Tang 2025-02-18 Build site.
Rmd 8edc91c Dave Tang 2025-02-18 Convert rat gene symbols to mouse
html 1080430 Dave Tang 2025-02-18 Build site.
Rmd 6edbb51 Dave Tang 2025-02-18 Use homologene
html 576dac1 Dave Tang 2025-02-18 Build site.
Rmd 1500177 Dave Tang 2025-02-18 Convert gene symbols across species

Installation

To begin, install the {biomaRt} package.

if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("biomaRt")

Package

Load package.

suppressPackageStartupMessages(library(biomaRt))
packageVersion("biomaRt")
[1] '2.62.1'

biomaRt

Adapted from https://www.biostars.org/p/446641/.

getLDS() retrieves information from two linked datasets; this function is the main {biomaRt} query function that links 2 datasets and retrieves information from these linked BioMart datasets. In Ensembl this translates to homology mapping.

human_us_mart <- useEnsembl(
  biomart = "ensembl",
  mirror = "useast",
  dataset = "hsapiens_gene_ensembl"
)

rat_us_mart <- useEnsembl(
  biomart = "ensembl",
  mirror = "useast",
  dataset = "rnorvegicus_gene_ensembl"
)

rat_genes <- c("Tll1", "Tlx3")

rat_to_human <- getLDS(
  attributes = c("rgd_symbol"), 
  filters = "rgd_symbol", 
  values = rat_genes, 
  mart = rat_us_mart, 
  attributesL = c("hgnc_symbol"), 
  martL = human_us_mart, 
  uniqueRows = TRUE
)
Error in `httr2::req_perform()`:
! HTTP 502 Bad Gateway.
rat_to_human
Error: object 'rat_to_human' not found

Expected output:

#>   RGD.symbol HGNC.symbol
#> 1       Tll1        TLL1
#> 2       Tlx3        TLX3

homologene

Install package.

install.packages("homologene")

NCBI Taxonomy IDs:

  • Human: 9606
  • Mouse: 10090
  • Rat: 10116

Convert from rat to human.

suppressPackageStartupMessages(library(homologene))

# Convert human genes to rat genes
# 9606 = human
# 10116 = rat
human_genes <- homologene(
  rat_genes,
  inTax = 10116,
  outTax = 9606
)

human_genes
  10116 9606 10116_ID 9606_ID
1  Tll1 TLL1   678743    7092
2  Tlx3 TLX3   497881   30012

Convert from rat to mouse.

homologene(
  rat_genes,
  inTax = 10116,
  outTax = 10090
)
  10116 10090 10116_ID 10090_ID
1  Tll1  Tll1   678743    21892
2  Tlx3  Tlx3   497881    27140

Marker genes

Human CD4+ T cell markers.

cd4_markers <- c("IL7R", "MAL", "LTB", "CD4", "LDHB", "TPT1", "TRAC", "TMSB10", "CD3D", "CD3G")

homologene(
  cd4_markers,
  outTax = 10116,
  inTax = 9606
)
  9606 10116 9606_ID 10116_ID
1 IL7R  Il7r    3575   294797
2  MAL   Mal    4118    25263
3  LTB   Ltb    4050   361795
4  CD4   Cd4     920    24932
5 LDHB  Ldhb    3945    24534
6 TPT1  Tpt1    7178   116646
7 CD3D  Cd3d     915    25710
8 CD3G  Cd3g     917   300678

Human CD8+ T cell markers.

cd8_markers <- c("CD8B", "CD8A", "CD3D", "TMSB10", "HCST", "CD3G", "LINC02446", "CTSW", "CD3E", "TRAC")

homologene(
  cd8_markers,
  outTax = 10116,
  inTax = 9606
)
  9606 10116 9606_ID 10116_ID
1 CD8B  Cd8b     926    24931
2 CD8A  Cd8a     925    24930
3 CD3D  Cd3d     915    25710
4 HCST  Hcst   10870   474146
5 CD3G  Cd3g     917   300678
6 CTSW  Ctsw    1521   293676
7 CD3E  Cd3e     916   315609

sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] homologene_1.4.68.19.3.27 biomaRt_2.62.1           
[3] workflowr_1.7.1          

loaded via a namespace (and not attached):
 [1] KEGGREST_1.46.0         xfun_0.48               bslib_0.8.0            
 [4] httr2_1.0.5             processx_3.8.4          Biobase_2.66.0         
 [7] callr_3.7.6             generics_0.1.3          vctrs_0.6.5            
[10] tools_4.4.1             ps_1.8.1                curl_5.2.3             
[13] stats4_4.4.1            tibble_3.2.1            fansi_1.0.6            
[16] AnnotationDbi_1.68.0    RSQLite_2.3.7           blob_1.2.4             
[19] pkgconfig_2.0.3         dbplyr_2.5.0            S4Vectors_0.44.0       
[22] lifecycle_1.0.4         GenomeInfoDbData_1.2.13 compiler_4.4.1         
[25] stringr_1.5.1           git2r_0.35.0            Biostrings_2.74.1      
[28] progress_1.2.3          getPass_0.2-4           httpuv_1.6.15          
[31] GenomeInfoDb_1.42.3     htmltools_0.5.8.1       sass_0.4.9             
[34] yaml_2.3.10             later_1.3.2             pillar_1.9.0           
[37] crayon_1.5.3            jquerylib_0.1.4         whisker_0.4.1          
[40] cachem_1.1.0            tidyselect_1.2.1        digest_0.6.37          
[43] stringi_1.8.4           purrr_1.0.2             dplyr_1.1.4            
[46] rprojroot_2.0.4         fastmap_1.2.0           cli_3.6.3              
[49] magrittr_2.0.3          utf8_1.2.4              withr_3.0.2            
[52] filelock_1.0.3          prettyunits_1.2.0       UCSC.utils_1.2.0       
[55] promises_1.3.0          rappdirs_0.3.3          bit64_4.5.2            
[58] rmarkdown_2.28          XVector_0.46.0          httr_1.4.7             
[61] bit_4.5.0               png_0.1-8               hms_1.1.3              
[64] memoise_2.0.1           evaluate_1.0.1          knitr_1.48             
[67] IRanges_2.40.1          BiocFileCache_2.14.0    rlang_1.1.4            
[70] Rcpp_1.0.13             glue_1.8.0              DBI_1.2.3              
[73] xml2_1.3.6              BiocGenerics_0.52.0     rstudioapi_0.17.1      
[76] jsonlite_1.8.9          R6_2.5.1                fs_1.6.4               
[79] zlibbioc_1.52.0