|
| 1 | +# Panel design algorithm, mark II |
| 2 | + |
| 3 | +## Running the procedure |
| 4 | + |
| 5 | +- Make sure software prerequisites are installed (see below) |
| 6 | +- Make sure databases are in place (see below) |
| 7 | +- Edit the JSON config file `config-example.json` to point to the correct databases (or fiddle with the parameters if you're brave) |
| 8 | +- Run the Snakemake workflow |
| 9 | + |
| 10 | +``` |
| 11 | +snakemake --configfiles config-example.json -c 1 -p |
| 12 | +``` |
| 13 | + |
| 14 | +### Software prerequisites |
| 15 | + |
| 16 | +- intervaltree |
| 17 | +- matplotlib |
| 18 | +- networkx |
| 19 | +- pandas |
| 20 | +- polars |
| 21 | +- scipy |
| 22 | +- snakemake |
| 23 | +- tagore |
| 24 | +- tqdm |
| 25 | +- upsetplot |
| 26 | + |
| 27 | +### Required databases |
| 28 | + |
| 29 | +- RepeatMasker track from UCSC genome browser |
| 30 | +- dbSNP combined VCF file (along with .tbi index) |
| 31 | + |
| 32 | +Both databases must use GRC838 coordinates. |
| 33 | + |
| 34 | + |
| 35 | +## How it works |
| 36 | + |
| 37 | +The design algorithm has three stages: a filtering stage, a panel scaffolding stage, and a panel fill-out stage. |
| 38 | + |
| 39 | +1. The filtering stage applies five filters to exclude microhaps likely to perform poorly in a multiplex targeted amplicon sequencing assay: details are shown below. |
| 40 | +2. In the scaffolding stage, each chromosome is considered independently. A *linkage graph* is constructed for each chromosome where each node represents a microhap marker and each pair of nodes is connected if the corresponding microhaps are separated by at least 9.5 Mbp (as a proxy for linkage equilibrium). All *maximal cliques* in this linkage graph are enumerated, each representing a set of mutually independent microhaps. The maximal clique with the highest aggregate Ae score is retained as the panel scaffolding for this chromosome. |
| 41 | +3. The fill-out stage also proceeds on a chromosome-by-chromosome basis. A greedy algorithm is used to add additional independently inherited microhaps: the highest-ranked microhap by Ae that is separated by at least 9.5 Mbp from all microhaps already included in the panel is added to the panel. This is repeated until no more microhaps can be added. |
| 42 | + |
| 43 | +### Filtering stage |
| 44 | + |
| 45 | +The filters/masks applied during this first stage are as follows. |
| 46 | + |
| 47 | +1. Exclude any marker within 9.5 Mbp of a forensic STR |
| 48 | +2. Exclude any marker that overlaps with a highly conserved genomic repeat element (SINE, LINE, or LTR) |
| 49 | +3. Exclude any marker with low-complexity sequence close to an allele-defining SNP (ADS) |
| 50 | +4. Exclude any marker with an indel polymorphism close to an ADS |
| 51 | +5. Exclude any marker longer than 260 bp in length |
| 52 | + |
| 53 | +The results of each individual filter and of all aggregated filters are in `data/intermediate/`. A plot showing the number of microhaps excluded by each filter is shown in `data/results/masking-results-plot.png`. |
| 54 | + |
| 55 | +### Whitelist |
| 56 | + |
| 57 | +A whitelist was constructed of microhaps to include regardless of filtering status. This list primarily contained microhaps whose performance has already been demonstrated empirically in previous studies. This includes: |
| 58 | + |
| 59 | +- All loci from ThermoFisher 74-plex |
| 60 | +- All loci from Ken Kidd 2022 24-plex |
| 61 | +- All loci from USC panel |
| 62 | + |
| 63 | +It also includes two "keepers" from manual analysis of high Ae microhaps that were filtered in the preliminary stages of algorithm development (mh06SCUZJ-0528857, mh15SCUZJ-0082880). |
| 64 | + |
| 65 | +```python |
| 66 | +>>> table2= pd.read_csv("markers-failed-filter.tsv", sep="\t") |
| 67 | +>>> subtable = table[(~table.FailMode.str.contains("length")) & (~table.FailMode.str.contains("str")) & (table.Ae > 9.0)].sort_values("Ae", ascending=False) |
| 68 | +>>> subtable.to_csv("input/high-ae-filtered.tsv", sep="\t", index=False) |
| 69 | +``` |
| 70 | + |
| 71 | + |
| 72 | +## Whence the parameters? |
| 73 | + |
| 74 | +Some of the parameter values (declared in `config-example.json`) were selected based on informed intuition, and some based on empirical observations. The reasoning behind parameter selection is elaborated upon here. |
| 75 | + |
| 76 | +### max_length |
| 77 | + |
| 78 | +A limit of 300 bp is commonly used in the literature for defining a microhap. However, the Microhap Working Group elected to restrict the max extent of any microhap in a core panel to 250 bp, allowing the entire amplicon—primers and all—to fit within roughly 300 bp. So initially the value of this parameter was set to 250 bp. But during the preliminary stages of the panel design algorithm development, a handful of promising microhaps was observed right on the fence. So this parameter was marginally relaxed to 260 bp to capture a few high-value targets. |
| 79 | + |
| 80 | +### sine/line/ltr |
| 81 | + |
| 82 | +RepeatMasker reports a score for each genomic repeat it annotates. This score captures the extent to which any given repetitive sequence is conserved throughout the genome. Higher scores correspond to longer sequences conserved at higher fidelity, while lower scores indicate shorter sequences with more distant similarities. The distribution of these scores for all SINEs, LINEs, and LTRs in the human genome was examined, and representatives in various score ranges were observed to assess the extent of conservation (or conversely, the amount of unique sequence) corresponding to different score ranges. These observations were then used to inform the selection of cutoffs: repeat elements with scores exceeding the cutoffs were retained to filter out microhaps; repeats with lower scores were ignored at the filtering stage. |
| 83 | + |
| 84 | +### ld_dist |
| 85 | + |
| 86 | +A distance of 10 Mbp was initially selected as a proxy for linkage equilibrium, i.e., the physical distance required between a pair of loci to be considered independently inherited and thus suitable for the probability product rule. This threshold is applied both to filtering based on forensic STRs and to populating the linkage graph. During the preliminary stages of the panel design algorithm development, a handful of promising microhaps was observed just below that threshold. After confirming that none of these microhaps was in linkage disequilibrium with the closest candidate markers in the panel, the threshold was relaxed to 9.5 Mbp. |
| 87 | + |
| 88 | +### max_short_mh_per_chrom |
| 89 | + |
| 90 | +During the preliminary stages of algorithm development, it was noted that populating the linkage graph with all candidates from the chromosome would lead to maximal cliques composed of numerous short microhaps with mediocre Ae scores, crowding out microhaps with higher individual Ae scores. Rather than developing a more sophisticated clique ranking score that gives more weight to higher Ae values, it was decided to include only a handful of short microhaps in the initial linkage graph construction, and then fill in later with a greedy algorithm. This parameter limited the linkage graph to 6 microhaps < 100 bp in length for each chromosome. |
0 commit comments