Supplementary Code S1

=================================================================================================
Publication
=================================================================================================

Decoding common and complex FSHD genotypes using methylation profiling and long-read sequencing
Scharf, Lucas et al., Erdmann (last author)
Brain Communications, 2026

=================================================================================================
Contents
=================================================================================================

This archive contains the custom scripts used for read sampling and statistical analysis as 
described in the Methods section of the above manuscript. The code is provided for transparency 
and reproducibility purposes. File paths and sample-specific parameters require adjustment before 
use.

File                          Description
------------------------------------------------------------------------------------------------
fshd_downsampling.sh          Main script for data evaluation; loops through the downsampling
steps and invokes subsample_reads.py, calculateMethPerRU.sh and calculateSlope.R 
subsample_reads.py            Random sampling without replacement for downsampling replicates
calculateMethPerRU.sh         Calculates average methylation values per repeat unit
calculateSlope.R              Calculates the slope of the methylation values per repeat unit
calculateDownsamplingStats.R  Statistical analysis of downsampling experiments
                              (IQR, exponential fit)

================================================================================================
Dependencies
================================================================================================

- Python (v3.9): Python Software Foundation. Available at http://www.python.org
- R (v4.0.0): R Core Team. R: A language and environment for statistical computing. R Foundation 
  for Statistical Computing, Vienna, Austria. 2020. Available at https://www.R-project.org/
- bash
- modbam2bed (v0.9.5): Oxford Nanopore Technologies. 
  Available at https://github.com/epi2me-labs/modbam2bed
- samtools (v1.14): Danecek P, Bonfield JK, Liddle J, et al. Twelve years of SAMtools and 
  BCFtools. GigaScience. 2021;10(2):giab008. doi:10.1093/gigascience/giab008

================================================================================================
Usage Notes
================================================================================================

- File paths require adjustment to match the local directory structure
- This code has not been optimized for general use and may require adaptation for other datasets
- For questions regarding the code, please contact florentine.scharf@mgz-muenchen.de
