inSTRbility is a toolkit to analyse somatic instability at tandem repeat loci from whole genome sequencing datasets.
The tools includes two modules:
-
extract: Extracts reads mapping to repeat loci and records variations within the repeat region along with SNPs outside of the repeat. The output is a tab-delimited file with information about each read including allele length, haplotype, and methylation information. -
model: Models the read allele length distribution at each locus to estimate the instability of the repeat locus based on the extracted reads.
The basic pipeline of the tool includes fetching reads mapping to repeat region and recording variations within the repeat region along with SNPs outside of the repeat. The variations falling within the repeat region contribute towards calculation of the allele length in the read. Based on the SNP the reads are segregated into two haplogroups. The allele length for each group is calculated as the mode of the group. For each read instability is calculated as the mean absolute deviation from the allele length.
NOTE: The tool currently works on long read sequencing datasets including PacBio and ONT.
git clone https://github.com/dashnowlab/inSTRbility.git
cd inSTRbility
python setup.py install$ python ./inSTRbility/extract_reads.py -h$ python ./inSTRbility/extract_reads.py -ref [fasta] -bed [regions_file] -bam [aln_file] -o [output_file] --reads-out$ python ./inSTRbility/calc_instability.py -i [input_file] -o [output_file] [-v [vcf_file]]The input file for the instability calculation is a tab-delimited file with the following columns:
| Column | Description |
|---|---|
| chromosome | Chromosome |
| start | Start position |
| end | End position |
| individual | Sample ID |
| repeat motif | Repeat motif |
| read_id | Read ID |
| haplotype | Haplotype ID |
| allele_length | Allele length in the read |
| sequence | Sequence of the repeat locus in the read. Optional: |
| avg_meth | Average methylation in the repeat locus in the read |
| nmeth_bases | Number of methylated bases in the repeat locus in the read |
inSTRbility models the read distribution of a repeat locus based on a compound negative binomial geometric distribution. The model is fitted to the read distribution and the parameters are used to calculate the instability of the locus. The model uses the geometric distribution to the model the size of the expansion or contraction step size in each mutation event. The model uses the negative binomial distribution to model the number of mutation events in a cell lineage at a given locus.
__init__.pyextract_reads.pycigar_utils.pycstag_utils.pymd_utils.pygenotype_utils.pyphasing_utils.pyinstabillity_utils.pyprocess_reads.pylocus_utils.pyoperation_utils.pyversion.py
calc_instability.pyparse_inputs.pysuggest_re_rc_grid.pynbgeom_modelling.pycompress_bed.pycalibrate.pycheck_lock.pymultisample-analysis.py

