This repository contains R markdown for processing the TLX files produced by the LAM-HTGTS pipeline, version 3 (https://github.com/brainbreaks/HTGTS). The R scrips here provide secondary LAM-HTGTS processing for variety genomic analysis purposes.
- clean_tlx_blacklist.R <- remove rows containing junctions in the blacklists (ummappable area) from the result.tlx file.
- TLX_statistics.R <- create a report for all libraries in a metafile for their overall junciton and junctions within/outside of breaksite. This also produce bedfiles for each libraries that does not contain any DSBs at bait chromosome (nochr) or bed files removing DSBs around the breaksite (nobrk). Including merging bedfile functions to combine bedfiles in the same condition.
- extend_normalize_split.R <- for normalize the DSB counts between conditions, for ploting. This script takes bedfiles, and random samples the larger libraries to downsize to the smallest library, and extend the junction to 50kb each side, then split the reads to either plus or minus orientation. Output will be two bedfiles.
- Junction_counts_ROI.R <- basically replacing the bedtools intersect function, calculating overlaping features in batches.
- Junction_absolute_distance_to_summit.R <- calculate the absolute distnace between a junction to any defined feature, including R loop summit or replication origins.
- MH_frequency.R <- calculating microhomology usage length in batch, reporting microhomology length for each row in the result.tlx file for all the tlx files analyzed.
- Blen_frequency.R <- same as above, except it analyses the bait length.
The scripts were written under R 4.4.2 (2024-10-31) and requires prior installing of the following packages. readxl, dplyr, readr, stringr, purrr, tibble, tidyr, GenomicRanges, ggplot2, writexl, Stats4, BioGenerics, IRanges, and GenomeInfoDb.
This script works on a working directory containing the following pre-existing folders. Note that the scripts will only work with the following condition, if changing, please change the script paths accordingly:
1.cleaned_result_tlx: holds the output from the clean_tlx_blacklist.R script.
1.result_tlx : contains the original *result.tlx output from brainbreaks/HTGTS. Copy all the files in the same project under this folder. The TLX files will be used as input for the clean_tlx_blacklist.R script
2.bed : holds the output (*.bed) from the TLX_statistics.R script.
3.bed_nobrk : holds the output (*_nobrk.bed) from the TLX_statistics.R script.
4.bed_ext_nobrk: contains subfolders indicating specific conditions, which will hold output from TLX_statistics.R.
6.bedgraph_ext_nobrk : holds bedgraph files generated independent from these scripts here.
7.metadata and report : contains two data types:
METADATA.txt: Required for TLX_statistics.R. this metadata was used for LAM-HTGTS demiltiplexing. It consists with following columns: Library, Sequencing, other description, Assembly, chr, Start, End, Strand, Breakseq, Breaksite, MID, Primer, Adapter, Cutter, Description. It should be saved as a Tab delimited text file.
METADATA_report.xlsx: this Excel format files are modified version of the TLX_Statistics.R report. It contains the following columns: Library, Description, group, clone, treatment, bait, repeat, total, breaksite, no_breaksite, breaksite%, no_breaksite%. See examples under the main.
9.MH_Blen_results: holds the report from MH_frequency.R and Blen_frequency.R.
10.bed_nochr : holds the output (*_nochr.bed) from the TLX_statistics.R script.
Please save the following files under the working directory.
hg38.chrom.sizes : download from USCS (https://hgdownload.soe.ucsc.edu/goldenpath/hg38/bigZips/hg38.chrom.sizes).
hg38-blacklist.v2.bed : blacklist regions for hg38 genome build. This file is uploaded under main.
hg38-blacklist.v2.bed: additional blacklist regions, user defined per LAM-HTGTS assay. This file is uploaded under main.
hg38_offtarget_chr1_chr3_chr11.bed : offtarget regions for three LAM-HTGTS chromosomal baits (hg38). This file is uploaded under main.