Skip to content

Demographic and genetic factors influence the abundance of infiltrating immune cells in human tissues

License

Notifications You must be signed in to change notification settings

drewmard/GTEx_infil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demographic and Genetic Factors Influence the Abundance of Infiltrating Immune Cells in Human Tissues

Information about the repository

This repository contains all computer code to support the findings in the manuscript "Demographic and Genetic Factors Influence the Abundance of Infiltrating Immune Cells in Human Tissues". This manuscript describes an extensive analysis of GTEx data. Many scripts were used to support the findings. All scripts are written in the R or Bash programming languages.

Within the repository, analysis scripts are split by sections of the manuscript that contains the relevant results. Many of the scripts require certain dependencies and certain data files. The file spec-file.txt within the ./bin/ directory can be used for setting up the conda environment containing all required dependencies:

conda create --name GTEx --file spec-file.txt

The required data for analysis is described in the following file:

./bin/data_required.txt

The data files can then be downloaded by copying and pasting the wget commands into Terminal. Since genotype data is not public, we have simulated random genotypes using Plink which can be used to demo the scripts.

The analysis was performed on a linux system. Plots were created on a macOS Catalina system. The underlying raw data for the plots that do not contain genetic information can be found in the following directory:

/Users/andrewmarderstein/Documents/Research/GTEx/Infiltration/GTEx_infil/plot_data

If you can not find the code you are looking for or have any questions, please contact:

Andrew Marderstein
anm2868@med.cornell.edu

Robust estimation of immune cell types in bulk RNA-seq profiles

Directory: ./scripts/SynMix_Sims/

In silico simulation of synthetic mixes:

GenerateSyntheticMixture-ALL.sh
(TPMs were subsequently generated by an in-house pipeline developed by Akanksha Verma, which has been described within the methods section of the manuscript)

Deconvolution of simulated gene expression profiles

cibersort_simulations.R (using cibersort) \ xcell_sim_gen.R (using xcell) \

Comparison of CIB-Rel, CIB-Abs, and xCell

xcell_ciber_simComp.R

Evaluating infiltration across human tissues by using deconvolution

Directory: ./scripts/GTEx_Deconv/

CIBERSORT:

running_cibersort.R (run CIBERSORT)
cibersort_out.R (process CIBERSORT output)

xCell:

xCell_generation.R (run xCell)
xCell_process.R (process xCell output)

Pairwise correlations of infiltration phenotypes:

corr_heatmaps.R

Case examples of differences between deconvolution algorithms:

xcell_cibersort_CaseExample.R

Hierarchical clustering:

clustering_heatmap.R

Boxplots of immune content:

celltype_boxplots2.R

t-SNE of immune content:

immune_content_clusters_tsne.R

Filtering of infiltration phenotypes (to 189):

filter.R

Infiltration signatures in bulk gene expression values

generate_exprPCA_matrix.R (perform PCA of expression)
calculate_exprPCA_infil_cor.R (correlate expression PCs with immune cell scores)
generate_exprPCA_matrix.createTable2.R (for creating supplementary data file)

Identification and characterization of extreme infiltrating immune cell patterns

Directory: ./scripts/HotCold_Cluster/

Algorithm for assigning clusters and differential expression analysis:

ConsensusClusterPlus_mod.r
Final-GTExHotColdAnalysis.r

Widespread vs tissue-specific extreme inflammation patterns

hot_tissueSpecific.R (for k-means clusters) hot_tissueSpecific_quintile.R (for quintile clusters) hot_tissueSpecific_quintile_spec.R (for whole blood & lung heatmap)

Association of age and sex with immune infiltration

Directory: ./scripts/AgeSex/

Statistical analysis:

AgeSex_Analysis.R

Create age/sex plots of most significant associations

AgeSex_Plots2.R

Heatmap summary of age/sex association results

age_sex_heatmap.R

Breast t-sne, males vs females

breast_content_clusters_tsne.R

myeloid:lymphoid & cd4:cd8 ratio analysis in whole blood

blood_MyeloidLymphoid/blood_MyeloidLymphoid_analysis.R # statistical analysis blood_MyeloidLymphoid/blood_MyeloidLymphoid_plots.R # accompanying figures

Association of genetic variants with infiltrating immune cells

Directory: ./scripts/GeneticAnalysis/

Generate PCs:

./GTEx_Genetic_PCA/PCA_calc_all.sh

Prepare data for external GWAS software:

GWAS_preprocess.R

Run GWAS

GWAS_local.sh (or GWAS.sh in parallel cloud computing environment)
Merge_Chr_GWAS_wrapper.sh (to merge different chromosomes together)

Combine related p-values using Empirical Brown's method, and identify significant results

Empirical_Brown_pval_wrapper.sh
(runs Empirical_Brown_pval.R in parallel computing environment)

Analyzing significant results in genetic analysis.

significant_results.R

Script to extract a SNP for genotype - phenotype plots

extract_SNP.sh

Figure panel: qqplots, genotype-phenotype plots & expression-phenotype plots

figure_panel.R
separate_qq.R

GWAS enrichment p-values

GWAS_enrichment.R

EBM shuffled analysis to assess p-value inflation (supplementary)

iQTL_EBM_shuffle_analysis.R

Downstream analysis of genetic results

All the following scripts are in the directory: ./scripts/GeneticAnalysis_2/

Analysis of related genetic variants also associated with thyroiditis using GeneHancer regions & phenoscanner

GWAS_search.R

ieQTL enrichment:

eQTL_enrichment_method2.R
eqtl_enrich_plots.R

GeneMania:

eQTL_network_gen.R (use eQTL_network_gen.R for *ieGene.txt output for input into GeneMania server)

Pleiotropic effects:

pleiotropy.R

Venn diagrams

venndiagram.R

About

Demographic and genetic factors influence the abundance of infiltrating immune cells in human tissues

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published