XuLab-Computations is the Xu lab’s shared repository for computational workflows and tooling. It currently includes:
- Paired-Tag / paired multimodal — preprocessing and mapping scripts,
reachtools, reference files, downstream R workflows, and pileup utilities. - cisTopic — a standalone pipeline for single-cell TF / accessibility matrices using pycisTopic: export from
.rds, LDA with MALLET, model selection, and imputation (theta/phior fullP(r|c)). - unified — a single-architecture PyTorch imputer for sparse TF / chromatin matrices: Basset-style sequence encoder, multi-scale bin-context conv, learnable cell bank, and a gated bilinear head, trained jointly (focal + ranking loss). Share pack (code only):
share/unified_imputation_pipeline.zip.
Additional pipelines may live alongside this tree over time.
| Path | Purpose |
|---|---|
README.md |
This top-level guide for repository structure, setup, and quick-start workflows |
.gitignore |
Ignore rules for generated data and local tooling artifacts |
environment.yml |
Conda env paired-tag: aligners and QC for Paired-Tag (Bowtie, Bowtie2, STAR, Trim Galore, Samtools, FastQC, Perl, Make) |
Paired-Tag/README.md |
End-to-end Paired-Tag preprocessing: barcode extraction, DNA/RNA mapping, matrix merge |
Paired-Tag/pipeline/readme.md |
Wrapper pipeline (run.sh) and file naming conventions |
Paired-Tag/protocol/readme.md |
Protocol PDF link and wet-lab FAQs |
Paired-Tag/reachtools/ |
C++ utilities; build with sh make.sh after editing paths |
Paired-Tag/shellscrips/ |
Shell drivers for FASTQ preprocessing and genome alignment |
Paired-Tag/perlscripts/ |
Matrix filter/merge and BAM helpers |
Paired-Tag/rscripts/ |
QC plots, Seurat, and integration examples |
Paired-Tag/refereces/ |
Cellular barcode FASTA/Bowtie indexes and RNA/bin annotation lists |
Paired-Tag/remove_pileup/ |
Scripts to count/remove pileups from BAM-derived data (remove_pileups.py, run.sh) |
cisTopic/README.md |
cisTopic LDA + imputation pipeline details, data scale notes, and references |
cisTopic/environment.yml |
Conda env cistopic (Python/R stack; pycisTopic installed from GitHub via pip) |
cisTopic/configs/default.yaml |
Main runtime configuration (input/work paths, MALLET path, filtering, LDA grid, imputation mode) |
cisTopic/scripts/ |
Pipeline scripts 00-07: inspect/export/build/LDA/select/impute/downstream/eval |
cisTopic/slurm/ |
SLURM templates to submit each cisTopic stage and chained dependencies |
cisTopic/scripts/cistopic_ctcf/ |
Example working directory with generated run outputs (mm, obj, models, select, impute, downstream, eval) |
Mallet-202108/ |
Local MALLET distribution used by cisTopic (paths.mallet_path) |
unified/README.md |
Full unified docs: model structure, required inputs, config, manual/SLURM run |
unified/environment.yml |
Conda env unified (Python 3.11 + PyTorch + einops) |
unified/configs/ |
default.yaml + per-TF overlays (paths, model, train, impute) |
unified/scripts/ |
00_ingest → 01_train → 02_impute (+ 02b remask, 03 RDS export); _model.py |
unified/slurm/ |
Full-pipeline and multi-TF SLURM drivers (edit paths/partitions for your cluster) |
share/unified_imputation_pipeline.zip |
Share pack: code + configs only — no FASTA, BEDs, matrices, or work/ |
Folder names shellscrips and refereces match the upstream Paired-Tag layout.
Paired-Tag (repo root):
conda env create -f environment.yml
conda activate paired-tagcisTopic uses a separate environment (pycisTopic, R for export/inspect):
conda env create -f cisTopic/environment.yml
conda activate cistopicunified (PyTorch imputer; keep isolated from cisTopic):
conda env create -f unified/environment.yml
conda activate unifiedNotes:
pycisTopicis installed from GitHub incisTopic/environment.yml(not from PyPI).paths.mallet_pathincisTopic/configs/default.yamlmust point to a real MALLET binary, e.g.Mallet-202108/bin/mallet.- The unified share zip does not include a genome FASTA or ATAC/blacklist BEDs. Recipients set
paths.genome_fa, supplymm/(Matrix Market + regions + barcodes), and should setimpute.open_chromatin_bed: nullunless they provide their own open-chromatin BED.
See cisTopic/README.md and especially unified/README.md for architecture and end-to-end instructions. Also ENVIRONMENTS.md.
- Build tools and references —
reachtools+ Bowtie index oncell_id_full.faorcell_id_full_407.fa(seePaired-Tag/README.md). - Preprocess FASTQs —
Paired-Tag/shellscrips/01.pre_process_paired_tag_fastq.sh(adjust paths; note Bowtie 0.x vs 1.x and GEO/SRA read-name caveats in script comments). - Map — DNA:
02.proc_DNA.sh; RNA:03.proc_RNA.sh. - Merge and analyze — filter low-read barcodes if desired, merge sub-libraries with
perlscripts/merge_mtx.pl, then use R/Seurat or other tools as in the Paired-Tag README.
For a single entry point with fixed paths, see Paired-Tag/pipeline/run.sh and its readme.
High level: inspect .rds → export Matrix Market → build CistopicObject → MALLET LDA over a topic grid → select topic count K → save theta/phi (and optionally full imputed P(r|c)) → optional downstream UMAP/topic binarization.
The current workflow in this repo has been run end-to-end (02 to 06) and now includes a held-out reconstruction benchmark:
conda run -n cistopic python cisTopic/scripts/07_eval_heldout.py \
--config cisTopic/configs/default.yaml \
--n-samples 100000 --seed 42This writes AUROC/AUPRC benchmarking outputs under <work_dir>/eval/:
heldout_eval.jsonheldout_eval.tsvheldout_eval.png
You can also run strict held-out mode by first creating a masked matrix with --prepare-holdout, then retraining and scoring with --holdout-split (see script header in cisTopic/scripts/07_eval_heldout.py).
Run locally or chain SLURM jobs under cisTopic/slurm/. Full steps, storage notes, and citations are in cisTopic/README.md.
Model (one jointly trained net): DNA window → SequenceEncoder (D=64) → BinContext (dilations 1/4/16 along chrom bins) → bilinear cell bank p_rc × GateMLP g_rc → (\hat y = g\cdot p). Trained with focal BCE + uniform negatives + pairwise ranking; optional RC augmentation. Open-chromatin BED filtering is post-hoc and optional, not part of the network.
You provide: (1) sparse counts as mm/{matrix.mtx.gz, regions, barcodes}, (2) indexed genome FASTA matching contig names, (3) optional blacklist / open-chromatin BEDs. The zip ships none of these.
unzip share/unified_imputation_pipeline.zip -d /path/to/dest
cd /path/to/dest/unified
conda env create -f environment.yml && conda activate unified
# Edit configs/default.yaml:
# paths.work_dir, paths.genome_fa
# impute.open_chromatin_bed: null # unless you supply a BED
# Place Matrix Market files under $work_dir/mm/
python scripts/00_ingest.py --config configs/default.yaml
python scripts/01_train.py --config configs/default.yaml # GPU
python scripts/02_impute.py --config configs/default.yaml # GPU
# outputs: $work_dir/impute/{matrix_csr.npz, regions.tsv, barcodes.tsv, meta.json}Full submodule dimensions, loss details, work-dir layout, and SLURM notes: unified/README.md.
Pipeline code and documentation in Paired-Tag/ follow the upstream Paired-Tag project; see Paired-Tag/LICENSE.
If you use Paired-Tag in a publication, cite:
Zhu et al., Joint profiling of histone modifications and transcriptome in single cells from mouse brain. Nature Methods (2021). https://doi.org/10.1038/s41592-021-01060-3
For cisTopic methods, cite cisTopic / pycisTopic as in cisTopic/README.md.