FASTQ files are mapped to the target genome using the BWA mapper (`bwa mem`). The BAM files are then processed using the seqDNAcopy library [1] to first get pairwise counts for the target sample and control samples (`bam2counts`). Adapted bin sizes are chosen so that 75% of the bins have at least 100 counts in the control sample. The data is then segmented using seqDNAcopy’s seqsegment method. The full source code for this methods is available at:
[1] Seshan, Venkatraman E. “Detecting copy number changes and structural rearrangements using DNA sequencing.” Statistical Analysis of Next Generation Sequencing Data. Springer, Cham, 2014. 355-378. (https://github.com/veseshan/seqDNAcopy)