The connectome-seq workflow consists of two main parts:
- Dataset integration
- Clustering and quality control
- Cell type annotation (automatic and manual)
- Cell type information
-
Cell Ranger processing
Raw sequencing files (.fastq) are transformed into BAM files.- mRNA features and Pre/PostRNA features come from separate FASTQ files.
- UMIs that differ within Hamming distance = 1 are automatically collapsed by Cell Ranger.
-
Custom Python collapsing of Pre/PostRNAs
Pre/PostRNAs with the same cell barcode (CB) that differ by Hamming distance = 1 are further collapsed. -
(Configurable) Disambiguation of Pre/PostRNA assignment
If a Pre/PostRNA is linked to more than two CBs, it is assigned to the CB with the highest Pre/PostRNA UMI count after passing quality checks.Current criteria:
- CB #1 PreRNA > 5 × CB #2 PreRNA
- CB #1 PostRNA > 2 × CB #2 PostRNA
- CBs ranked by Pre/PostRNA UMI count
-
Matching between nuclei and synaptosome Pre/PostRNAs
Matching is performed at a specified Hamming distance threshold.
BC_collapse: Processing raw barcode through collapsing cell barcodes.cseq_NucUMIClean: Collapsing nucleus barcode information based on UMI.cseq_synaptosome: Preprocessing synaptosomal barcode, applying filters to extract cleaned data.cseq_HarmonyIntegration: Integrate different connectome-seq datasets to eliminate batch effect.cseq_Annotation: Annotate the integrated connectome-seq dataset with Allen Institute mouse brain cell type atlas.cseq_Cluster: Cluster the integrated dataset and annotate each cluster from marker gene expression.cseq_Match: Conduct barcode matching based on synapse barcode and cell barcode.cseq_PurkinjeAnalysis: Analyze possible Pons–Purkinje cell connection.cseq_Rfunction: Wrapper for R functions used incseq_PurkinjeAnalysis.cseq_virusLib: Analyze virus library sequencing results, extracting barcode information.cseq_preseq: Predict virus library barcode diversity.
Demonstrating with cseq25 dataset.
Run one-line commands to quantify features from raw sequencing data.
cellranger count --id=cseq25-PN-new --transcriptome=/home/boxuan/data/hdd2/mouse_2022 --libraries=library_PN.csv --feature-ref=feature_ref_2.csv --force-cells=21000 --localmem 128 --localcores=32 --check-library-compatibility=falsecellranger count --id=cseq25-CN2 --transcriptome=/home/boxuan/data/hdd2/mouse_cseq6 --libraries=library_CN.csv --feature-ref=feature_ref_2.csv --force-cells=4000 --localmem 128 --localcores=32cellranger count --id=cseq25-CS-pre2 --transcriptome=/home/boxuan/data/hdd2/mouse_cseq6 --libraries=library_CSpre2.csv --feature-ref=feature_ref_pre.csv --expect-cells=8000 --localmem 128 --localcores=32cellranger count --id=cseq25-CS-post2 --transcriptome=/home/boxuan/data/hdd2/mouse_cseq6 --libraries=library_CSpost2.csv --feature-ref=feature_ref_post.csv --expect-cells=8000 --localmem 128 --localcores=32- Change
id,libraries, andfeature-refas needed. - Use
--force-cellsfor nucleus libraries. - Use
--expect-cellsfor synaptosome libraries.
gunzip barcodes.tsv.gz~/cellranger/subset-bam_linux --bam ../../cseq1-PN2/outs/possorted_genome_bam.bam --cell-barcodes barcodes.tsv --cores 32 --out-bam pons.pre.barcodes.bam- Navigate to the
outs/directory of eachcellranger countresult. - Unzip barcode files:
gunzip barcodes.tsv.gz
- Create a new folder for each sample.
- Copy:
- Filtered
barcodes.tsvfrom nucleus samples - Unfiltered (raw)
barcodes.tsvfrom synaptosome samples
- Filtered
../connectome.py pons.pre.barcodes.bam pons.pre.barcodes.hamm1.txt 1- Extract reads and collapse barcodes at a given Hamming distance.
- Synaptosome barcode information (TXT format) is processed with
cseq_synaptosome.Rmd, where extensive quality control steps are taken. Output:synp.post.clean.csvsynp.pre.clean.csv
These data serve as input forcseq_Match.Rmd.
- Cell barcode information (e.g.,
cere.post.BC.hamm1.txt,pons.pre.BC.hamm1.txt) are UMI collapsed withcseq_NucUMIClean.ipynb, producing:CN.umi.csvPN.umi.csv
These serve as input forcseq_Match.Rmd, where cell barcodes undergo disambiguous assignment and cleaned barcode information is generated.
- Follow code annotation to run this RMarkdown.
- Raw single-nucleus sequencing data were processed with CellRanger to extract feature_bc_matrix files:
barcodes.tsv.gzfeatures.tsv.gzmatrix.mtx.gz
These are used as input forcseq_HarmonyIntegration.Rmd, where Seurat objects are created and biological replicates integrated with Harmony. Output Seurat objects:cn.afpn.af
- Integrated data go through cell type prediction by MapMyCell in
cseq_Annotation.Rmd, generating:scdata.pnscdata.cn
Further QC, dimension reduction, and annotation are performed incseq_Cluster.Rmd, producing:celltype.pons.newcelltype.cere.newpn_barcodescn_barcodes
These provide cell type information for different CBs and corresponding barcodes, serving as input forcseq_Match.Rmd.
All outputs above serve as input for cseq_Match.Rmd, which generates the final connectome. Outputs include:
PN.neuron.umiClean.csvCN.neuron.umiClean.csvsynp.pre.clean.csvsynp.post.clean.csvconnectome.match.count.csv
Purkinje cells are extracted from annotated snRNA-seq data and processed with cseq_PurkinjeAnalysis.Rmd to analyze potential connectivity-related gene markers.
- Raw sequencing data of Barcode AAV genomic DNA are processed with
cseq_VirusLib.ipynb. Barcode sequence and count information are extracted, and distribution calculated. cseq_preseq.shis applied to project barcode sequence diversity at future sequencing depth.