10X allows for the addition of custom probes to their panel. Official instructions for preparing input files with custom probes for Spaceranger can be found here. Of note, while the instructions recommend appending entries for exogenous sequences to the fasta/GTF, I confirmed that this is not necessary for quantification with 10X support (rhyming with what is described in the probe matching algorithm here).
However, what is necessary for the probe file is a hash for each of the probes. Whiel official 10X hashes are computed by taking the first seven characters of the sha1 of the probe sequence, the official docs merely state that they need to be unique in the scope of the probe set being provided on input (so both your custom probes and the official 10X ones). The hashes take on the form of seven character hexadecimals, so the easiest way to hash the probes is to start at 0 and keep going up, skipping any existing hashes in place. Of note, you can have multiple different panels, and possibly even combine them.
This led to the creation of this script - ingest your custom probe panel expansions as you create them, and the script will create 10X-formatted CSV snippets that you can concatenate in whatever configuration your custom probe panels may coexist in your libraries in while keeping the hashes unique.
The script requires a headerless input CSV with the following columns (matching 10X probe file CSV where possible):
gene_id,gene_name,probe_seq,region
So to look at the first probe from the 10X panel, ENSG00000000003|TSPAN6|8eab823, the entry would look like this:
ENSG00000000003,TSPAN6,GGTGACACCACAACAATGCAACGTATTTTGGATCTTGTCTACTGCATGGC,spliced
Let's stick this into a dummy.csv and feed it through the script as a proof of concept:
python ingest_probes_sequential.py --custom-probes dummy.csvThe entirety of the --primary-probes and all the CSV snippets existing in --output-directory are loaded and scanned for hashes to determine the ones which were already used. This creates a dummy.csv file in the --output-directory with the probe formatted in a 10X compatible manner, coupled with a hash not already present:
ENSG00000000003,GGTGACACCACAACAATGCAACGTATTTTGGATCTTGTCTACTGCATGGC,ENSG00000000003|TSPAN6|0000000,TRUE,spliced
Using the snippets to create a Spaceranger input involves appending any extra panel files at the end of the original 10X CSV.