{"id":28436067,"url":"https://github.com/immunogenomics/schlapers","last_synced_at":"2025-10-05T14:38:58.723Z","repository":{"id":199992804,"uuid":"525078424","full_name":"immunogenomics/scHLApers","owner":"immunogenomics","description":"Code to run the scHLApers pipeline for personalized single-cell HLA quantification","archived":false,"fork":false,"pushed_at":"2024-01-10T18:04:05.000Z","size":8328,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-06-05T21:09:54.965Z","etag":null,"topics":["alignment","expression","hla","single-cell"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/immunogenomics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-08-15T17:30:59.000Z","updated_at":"2024-05-28T22:24:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"1422f9b9-1d25-4c24-948e-196ae591a0b1","html_url":"https://github.com/immunogenomics/scHLApers","commit_stats":null,"previous_names":["immunogenomics/schlapers"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/immunogenomics/scHLApers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2FscHLApers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2FscHLApers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2FscHLApers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2FscHLApers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/immunogenomics","download_url":"https://codeload.github.com/immunogenomics/scHLApers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2FscHLApers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262343564,"owners_count":23296353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alignment","expression","hla","single-cell"],"created_at":"2025-06-05T21:10:01.510Z","updated_at":"2025-10-05T14:38:53.684Z","avatar_url":"https://github.com/immunogenomics.png","language":"Jupyter Notebook","readme":"# scHLApers\nCode to run the scHLApers pipeline for quantifying **s**ingle-**c**ell **HLA** expression using **pers**onalized reference genomes (Kang et al., Nat Genetics 2023).\n![Overview](images/overview.png)\n\n## Requirements\nR program requires (listed version or higher):\n* R=4.0.5\n* Biostrings=2.58.0\n* purrr=0.3.4\n* readr=2.1.2\n* stringi=1.7.8\n* stringr=1.4.0\n* tidyverse=1.3.1\n* rtracklayer=1.50.0\n\nOther software:\n* STAR=2.7.10a [https://github.com/alexdobin/STAR](https://github.com/alexdobin/STAR)\n* samtools=1.4.1 [http://www.htslib.org/download/](http://www.htslib.org/download/)\n\nData:\n* Reference genome (e.g. GRCh38.primary_assembly.genome.fa): available [here](https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/)\n* Gene annotation file (e.g. gencode.v38.annotation.gtf): available [here](https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/)\n* Cell barcode whitelist: more info [here](https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-)\n\n## Pipeline and example data\nEach step has its own directory with necessary scripts and a tutorial walking through the steps. The [example_data](example_data) and [example_output](example_outputs) directories contain example input and output files for 2 samples. The raw scRNA-seq data for the example was obtained from [Yazar et al. Science 2022](https://pubmed.ncbi.nlm.nih.gov/35389779/) study, publicly available on GEO (GSE196830).\n\n### Input\nThe inputs to scHLApers are:\n* Raw scRNA-seq data (either FASTQ or BAM format)\n* HLA allele calls (in CSV format, labeled as \"SampleX_alleles.csv\", see `example_data/inputs/alleles` for format)\n\nSee the [HLA analyses tutorial](https://github.com/immunogenomics/HLA_analyses_tutorial) from [Sakaue et al.](https://www.biorxiv.org/content/10.1101/2022.08.24.504550v1) for protocol for imputing HLA alleles from genotype array data.\n\n### Step 1: Prepare HLA allelic sequence database\nWe provide a [pre-prepared database](1_make_HLA_database/IMGTHLA_all_alleles_FINAL.fa) generated from IPD-IMGT/HLA version 3.47 that can be directly used in Step 2. Alternatively, you can prepare your own database using the latest IPD-IMGT/HLA verison following the [tutorial](1_make_HLA_database/tutorial_make_database.ipynb).\n\n### Step 2: Make personalized reference and annotation files\nThe [tutorial](2_make_personalized_refs/tutorial_make_pers_and_mask_GRCh38.ipynb) demonstrates how to generate personalized contigs (FASTA) and annotations (GTF) files (that will be combined with the masked reference) and how to mask the reference.\n\n### Step 3: Quantify single-cell expression with STARsolo\nExample scripts for how to run [STARsolo](https://github.com/alexdobin/STAR) for read alignment and expression quantification in single-cell data. Script will need to be modified based on the specifics of your dataset (e.g. UMI length, input format, barcode whitelist path, STAR executable). Please see the [STAR manual](https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf) for all options.\n\n### Outputs\nThe output of scHLApers is a genes by cells expression matrix, with improved classical HLA expression estimates. In the example output, we have filtered the raw STARsolo counts matrix (to remove empty droplets) using a provided list of cell barcodes (see `example_data/cell_meta_example.csv`).\n\nThe raw counts matrix output by the pipeline for example `Sample_1006_1007` can be found [here](../example_outputs/STARsolo_results/Sample_1006_1007_scHLApers/Sample_1006_1007_scHLApers_Solo.out/GeneFull_Ex50pAS/raw/UniqueAndMult-EM.mtx):\n`../example_outputs/STARsolo_results/Sample_1006_1007_scHLApers/Sample_1006_1007_scHLApers_Solo.out/GeneFull_Ex50pAS/raw/UniqueAndMult-EM.mtx`\n\nA filtered version is located [here](../example_outputs/STARsolo_results/Sample_1006_1007_scHLApers/exp_EM.rds) (read into R using `readRDS`):\n`../example_outputs/STARsolo_results/Sample_1006_1007_scHLApers/exp_EM.rds`\n\nNote: The classical HLA genes are named `IMGT_A`, `IMGT_C`, `IMGT_B`, `IMGT_DRB1`, `IMGT_DQA1`, `IMGT_DQB1`, `IMGT_DPA1`, `IMGT_DPB1`.\n\n## Support\nFor questions and assistance not answered in tutorials, you can contact Joyce Kang (joyce_kang AT hms.harvard DOT edu).\n\n## Reproducing results from the manuscript\nCode to reproduce the figures and analyses from Kang et al. will become available at [https://github.com/immunogenomics/hla2023](https://github.com/immunogenomics/hla2023).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmunogenomics%2Fschlapers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimmunogenomics%2Fschlapers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmunogenomics%2Fschlapers/lists"}