In this study, TEA-seq was performed on 2 samples (2 replicates for each sample):
- HSC/MPP gated cells
- MultiLin gated cells
These populations enrich for the hematopoietic stem cells, the multilineage progenitor populations, and the immediate specification events to unipotent lineages, thought to go through hierarchical lineage restriction.
Note: although TEA-seq captures surface protein, transcriptomes, and accessibility data, we found that the surface protein data and transcriptome data was not as robust as that obtained from CITE-seq and InfinityFlow. So we prioritized our efforts to map states between CITE-seq and TEA-seq and use the RNA from CITE-seq and the ATAC-based accessibility from TEA-seq for downstream analyses.
II. CITE-seq Label Transfer to TEA-seq Data
III. Pseudobulk processing of accessibility data
IV. Call peaks on TEA-seq pseudobulk clusters
- 1. Use individual pseudobulk cluster BAM files to call peaks
- 2. Merge the peak sets called on individual clusters
VI. Peak by cell matrix and pseudobulk profiles
- 1. Set up the snap objects
- 2. Creating the peak by cell matrix
- 3. Pseudobulk accessibility profiles for clusters
- 1. Initial setup for ChromBPNet
- 2. Model training for ChromBPNet
- 3. Base resolution contribution score predictions
- 4. Seqlet pattern clustering with tfmodisco
IX. Downstream analysis of seqlets
- 1. Scanning CWM patterns across all peaks
- 2. Score seqlet patterns
- 3. Seqlet to gene correlations within TADs
- 4. Seqlet to gene correlation heatmap
- 5. Seqlet and gene expression heatmaps
- 6. Identify marker genes for pseudobulk clusters
- 7. Seqlet to gene correlation heatmap - marker genes
- 8. Seqlet and gene expression heatmaps
X. Gene regulatory network analysis
- 1. Identify and score TF to gene connections
- 2. Score the TF to gene links
- 3. Score TF activities in clusters
- 4. Score TF to gene links for surface proteins
- 5. Seqlet to gene correlation heatmap - surface proteins
- 6. Seqlet to gene correlation subplots - surface proteins
- 7. Annotate modisco patterns with transcription factors using CIS-BP2 annotated motifs
- 8. Build interaction file for plotting GRN with Cytoscape
- 9. Scoring GRN connections for each cluster
The fastq files after sequencing were processed using the cellranger count program (v5.0.1) with the --chemistry=ARC-v1
Eg.:
cellranger count --id=$INPUTFILE --libraries=library.csv --transcriptome=/database/cellranger/$SPECIESDATABASE --feature-ref=Mouse-ADT-Custom.csv --localmem 132 --include-introns --chemistry=ARC-v1This notebook walks through the pyHarmony method used to correct for batch effects between CITE-seq and TEA-seq transcriptomes and to transfer the labels from the CITE-seq reference to the TEA-seq cells.
The label transfer from CITE-seq to TEA-seq is validated by comparing the ranking of marker genes according to gene expression data from both modalities. A spearman correlation value between ranking of top marker genes is compared between each cluster between modalities.
Each of these .sh files split the possorted BAM file from cellranger into pseudobulk BAM files.
After the BAM files are separated by clusters, these scripts sort and index the BAM files.
These scripts merge the BAM files for each cluster.
These scripts index the cluster BAM files after they were merged.
These files are used to call peaks on the cluster split BAM files.
This file merges the peak summits. The algorithm orders the summits called by MACS2 by their significance, and then iteratively removes less significant summits that are within a predefined range (+/- 500 bp).
The BigWig files created with the scripts in this directory are used to project the accessibility coverage tracks onto a genome browser.
Directory for these scripts:
'4-TEA-seq/pseudobulk_accessibility_processing/snaptools/'
After peaks have been identified (within individual pseudobulk clusters), we want to represent the single-cell accessibility data from TEA-seq as a peak by cell matrix. This quickly enables downstream analysis of those peaks. Here we use the snaptools program to generate the peak by cell matrix.
First, the output from the 10X genomics software had to be slightly modified to work with the snaptools program. These scripts will remove the header from the fragments file and compress it to be able to input into the snaptools program.
These scripts initialize the snap objects with snaptools.
These scripts used snaptools to create the peak by cell matrix. So we took the merged pseudobulk cluster specific peak set and counted the fragments for each cell that overlap with those peaks to a matrix. If a peak by cell matrix is already in the snap object, you have to use the snaptools snap-del command to first remove the existing peak by cell matrix before you can add a new peak by cell matrix with the snaptools snap-add-pmat command.
This script was used to pull out the peak by cell matrices from the snap objects and save them as separate sparse .mtx files.
Note: the individual peak by cell matrices were merged with the following script:
merge_pmats.py
This script takes the peak by cell matrix, the cluster labels identified by the modified pyHarmony label transfer from the CITE-seq reference to the TEA-seq data, and creates pseudobulk accessibility profiles to work with downstream.
Directory for these scripts:
'4-TEA-seq/pseudobulk_accessibility_processing/correlate_peaks_to_genes/'
The purpose of this script is to correlate the accessibility of peaks to the expression of genes. These comparisons are restricted to be within pre-defined TADs (identified by Chen et al. Cell Reports 2019 : GSE119347). We can then restrict the peak set to those that correlate to changes in gene expression above a pre-defined level (any peak with a p-value < 0.001 from Pearson correlation test).
'cluster_peak_and_gene_correlations_with_significant_connections.ipynb'
Here we use hierarchical clustering of the peak by gene correlation values to group genes that have similar peak correlation profiles. These clusters of genes can be thought to be regulated by similar groups of peaks.
'pseudobulk_accessibility_processing/chrombpnet/'
In this study, ChromBPNet was run on the pseudobulk accessibility profiles to generate models that predict accessibility profiles by training on DNA sequences. These provide a context-specific prediction for what DNA syntax elements are important for predicting increased chromatin accessibility. This is paired with tfmodisco to identify DNA motifs that are important for predicting accessibility.
'initial_setup_scripts/add_columns_to_peak_bed_file_for_10_format.py'
ChromBPNet uses a 10 column format for the peak set. This script reformats the merged peak set identified above.
This script prepares the cross validation regions. These are sets of chromosomes that split the peak set into regions used for training the model and regions used for validating the model.
This script filters the peak set to remove blacklisted regions.
'initial_setup_scripts/prepare_non_peak_regions_for_splits.sh'
This script prepares the non-peak regions. These are regions used to train the bias model to learn DNA syntax that is preferentially bound by the Tn5 enzyme.
Trains the bias model. Note that one of the possorted BAM files from 10X cellranger is used. This contains enough cells from different types to try to avoid having the bias model learn a cell type specific sequence incorrectly as Tn5 bias.
'model_training/cluster_specific_models/train_*_test_fold_0.sh'
These files train the ChromBPNet models for each pseudobulk cluster accessibility file.
Each of these script files calculates the base resolution contribution score values for the pseudobulk models.
Each of these script files identifies CWM patterns for each of the contribution score value bigwig files. These patterns are used downstream to identify all seqlet positions in the peak set.
'seqlet_analysis/gimmemotifs_scan_modisco_patterns_for_all_peaks.ipynb'
The output of tfmodisco is only a subset of all the potential seqlets that could be found from the contribution score files. To search for all seqlet sites that match a CWM pattern, here we implement a custom script to scan for the DNA sequence that matches each of the CWM patterns identified by tfmodisco.
Note: we use the
seqlet_analysis/generate_motif_files_from_modisco_h5_files.pyscript to extract the base frequencies of the CWM patterns identified by tfmodisco as a .pfm file for the scanning and we use the 'seqlet_analysis/generate_seqlet_bed_from_modisco_h5_file.py' script to extract the seqlet positions as a bed file.For the peaks/regions, you must use the<output_prefix>.interpreted_regions.bedfile output fromchrombpnet contribs_bwso that idx coordinates pulled from the tfmodisco-lite file are accurate. The seqlet coordinates currently depend on thestart(second column of bed file) andoffsetlast column of bedfile, as well as thewidthparameter used by tfmodisco-lite (default is currently 400)
'seqlet_analysis/score_called_modisco_seqlets_in_all_peaks.ipynb'
After identifying sites in all peaks that match CWM DNA sequence patterns identified by tfmodisco, we score each of them for how well they match to the CWM scores. This is a dot product between the observed contribution value and the CWM values filtered to the bases with high frequency of occurrence in the CWM motif. We then filter the called seqlets to those that have a score greater than the 5th percentile of scores from the set defined by tfmodisco. This gives us the highest scoring seqlets that match a pattern identified by tfmodisco across all queried regions.
'seqlet_analysis/seqlet_to_gene_correlation_within_tads.ipynb'
For each of the expressed genes, we identify seqlets within the same TAD as the gene, and calculate a Pearson correlation coefficient value across the clusters for the dot product score from the previous script, and the log2-CPTT normalized centroid gene expression value. This gives an association between seqlets and genes that are expressed highly in the same states. The seqlets are filtered to those with a Pearson correlation > 0.4 to get the strongest associations.
Note: we cluster the genes based on their patterns of correlation to seqlets using hierarchical clustering, and then using MarkerFinder to associate each of the seqlets with each of these gene clusters here: cluster_gene_to_seqlet_correlations.ipynb
Note: we annotate the patterns called by tfmodisco by scraping the top match from the output
.htmlfiles, and using the CIS-BP2 annotation, detailed in this script: annotate_cisbp2_overlap_with_modisco_patterns.ipynb
Generates the pairwise Pearson correlation heatmap between gene expression and seqlet contribution score values.
'seqlet_analysis/seqlet_to_gene_correlation_heatmap_subplots_all_5k.ipynb'
This generates the paired seqlet and gene expression subplots for the correlation heatmap. This visualizes the level across the clusters.
Note: here we are sampling 50 cells per cluster, carried out in identify_markers_and_generate_heatmaps.ipynb, though the choice will largely depend on the dataset being used.
Nominates the top marker genes for each clusters. This focuses to the critical changes in gene expression between clusters.
'seqlet_analysis/seqlet_to_gene_correlation_heatmap_tea_seq_markers.ipynb'
Repeat the pairwise gene to seqlet correlation heatmap, but only with the marker genes.
'seqlet_analysis/seqlet_to_gene_correlation_heatmap_subplots_tea_seq_markers.ipynb'
Repeat making the paired seqlet and gene expression subplots for the correlation heatmap focused on the marker gene set. This visualizes the level across the clusters.
Here we are trying to use the seqlet contribution scores as a means to link candidate transcription factors to the genes they regulate.
'grn/combine_seqlet_to_gene_to_custom_cisbp2_annotation.ipynb'
Note: we calculate motif similarities between known motifs with the CIS-BP2 database and the tfmodisco patterns independenlty, as many TFs of the same family can likely bind to the same tfmodisco pattern: annotate_modisco_patterns_with_cisbp2_motifs.ipynb
To assign and score the TF-gene connections, we annotate the seqlets with TF identities by calculating the similarity of the seqlet DNA pattern to previously identified transcription factor motifs (Cisbp2 database).
We score the connections between TFs and genes within each cluster by multiplying the seqlet score, the target gene expression, and the transcription factor gene expression within each cluster.
To estimate the transcription factor activity in each cluster, we take the sum of all TF to gene link scores provided by the previous step.
Here, the TF to gene links are filtered to those genes that encode surface proteins.
'grn/seqlet_to_gene_correlation_heatmap_surface_proteins.ipynb'
The pairwise seqlet to gene correlation heatmap is generated here.
'grn/seqlet_to_gene_correlation_heatmap_subplots_surface_protein_terms.ipynb'
This code makes the expression heatmaps for the seqlets and the genes encoding surface proteins.
This script is used to link the transcription factors to the motif patterns identified by tfmodisco.
This file is used to build the connections file required for plotting network connections with Cytoscape.
This script is used to score each of the TF to target gene connections for each cluster in the dataset to build cluster specific gene regulatory networks.