All functions

GetChromosomeBAFs()

Morphs phased SNPs from WGS input into haplotype blocks

GetChromosomeBAFs_SNP6()

Morphs phased SNPs from SNP6 input into haplotype blocks

allele_ratio_plot()

Plot allele ratios from raw segmented data

battenberg()

Run the Battenberg pipeline

calc_psi_t()

Calculate psi based on a reference segment and its associated logr

calc_rho_psi_refit()

Calculate rho and psi values from a refit suggestion

calculate_solution_fast()

Fast solution calculation (vectorized and optimized)

callChrXsubclones()

Fit ChrX subclonal copy number (male only)

callSubclones()

Fit subclonal copy number

call_multisample_MSAI()

Generates haplotype blocks, MSAI results, and plots from phasing information contained in multisample Battenberg runs

cel2baf.logr()

Transform cel files into BAF and LogR

cell_line_baf_logR()

Obtain BAF and LogR from the Cell line (tumour only) allele counts

cell_line_reconstruct_normal()

Reconstruct normal-pair allele count files for cell lines

check.imputeinfofile()

Check impute info file consistency

cnfit_to_refit_suggestions()

Create refit suggestions for a fit copy number profile

combine.baf.files()

Combines all separate BAF files per chromosome into a single file

combine.impute.output()

Concatenate the impute output generated for each of the regions.

convert.impute.input.to.beagle.input()

Converts impute input to a beagle input

coverage_plot()

Plot relative coverage of tumour and normal

create_smart_search_order()

Create smart search order - best regions first

find_centroid_of_global_minima()

This function is an alternative procedure for finding the optimum (psi, rho) pair. This function first finds all the find all the global optima, and then finds the centroid of this set of globla optima. Then we find the global optimum which is nearest to the centroid. (When the set of global optima is convex, we expect the selected optimum to be at the centroid.)

fit.copy.number()

Fit copy number

gc.correct()

Correct the LogR estimates for GC content

gc.correct.wgs()

Function to correct LogR for waivyness that correlates with GC content

gc.correct.wgs.germline()

Function to correct LogR for waivyness that correlates with GC content

generate.impute.input.snp6()

Prepares data for impute

generate.impute.input.wgs()

Prepare data for impute

generate.impute.input.wgs.germline()

Prepare data for impute

generate_plots_battenberg()

Generate plots

germline_baf_logR()

Obtain BAF and LogR from the Germline allele counts

germline_reconstruct_normal()

Reconstruct normal-pair allele count files for Germlines

get.chrom.names()

Returns the chromosome names that are supported

getAlleleCounts()

Obtain allele counts for 1000 Genomes loci through external program alleleCount

getBAFsAndLogRs()

Obtain BAF and LogR from the allele counts

get_multisample_phasing()

Generates phased haplotypes from multisample Battenberg runs

infer_gender_birdseed()

Infer the gender using the birdseed report file

input_known_haplotypes()

Combine imputation results with external haplotype blocks

is_local_minimum_fast()

Fast local minimum check (optimized version of original 7x7)

make_posthoc_plots()

Function to make additional figures

mask_high_cn_segments()

Mask segments that have a too high CN state

parse.imputeinfofile()

Read in the imputeinfofile.

plot(<haplotype.data>)

Plot haplotyped SNPs

prepare_snp6()

Prepare SNP6 data for haplotype construction

prepare_wgs()

Prepare WGS data for haplotype construction

prepare_wgs_cell_line()

Prepare WGS data of cell line for haplotype construction

prepare_wgs_germline()

Prepare WGS data of germline for haplotype construction

read_alleleFrequencies()

Parser for allele frequencies data

read_baf()

Parser for BAF data

read_bafsegmented()

Parser for BAFsegmented data

read_beagle_output()

Parser for beagle5 output data

read_gccontent()

Parser for GC content reference data

read_impute_input()

Parser for impute input data

read_imputed_output()

Parser for imputed genotype data

read_logr()

Parser for logR data

read_replication()

Parser for replication timing reference data

read_table_generic()

Generic reading function using the readr R package, tailored for reading in genomic data

run.beagle5()

Command to run beagle5

run.impute()

Run impute on the specified inputfile

runASCAT()

A modified ASCAT main function to fit Battenberg

runASCAT_enhanced()

Key optimizations: 1. Early termination after first good solution (like original) 2. Vectorized distance calculations 3. Optimized constraint checking 4. Smart search ordering (best regions first) 5. Reduced memory allocations

run_clonal_ASCAT()

ASCAT like function to obtain a clonal copy number profile

run_haplotyping()

Construct haplotypes for a chromosome

run_haplotyping_germline()

Construct haplotypes for a chromosome - germline WGS version

segment.baf.phased()

Segment BAF, with the possible inclusion of structural variant breakpoints

segment.baf.phased.legacy()

Segment the haplotyped and phased data using fastPCF. This is the legacy segmentation function as it was used in the original Battenberg versions

segment.baf.phased.multisample()

Segment BAF, with the possible inclusion of structural variant breakpoints

segment.baf.phased.sv()

Segment BAF with the inclusion of structural variant breakpoints - This function is now deprecated, call segment.baf.phased instead

split_input_haplotypes()

Split a single vcf into separate vcfs for each chromosome

squaresplot()

Plot Battenberg copy number solutions for a segment

standardiseChrNotation()

Chromosome notation standardisation (removing 'chr' string from chromosome names - mainly an issue in hg38 BAMs)

standardiseChrNotation_germline()

Chromosome notation standardisation (removing 'chr' string from chromosome names - mainly an issue in hg38 BAMs)

suggest_refit()

Calculate refit values from a refit suggestion

totalcn_chrom_plot()

Plot total copy number split per chromosome

write_battenberg_phasing()

Writes the imputation and copy number phased haplotypes to a vcf

writebeagle.as.impute()

Writes output of beagle as output from impute (interface bealge/impute for Battenberg)

writevcf.beagle()

Writes input file for beagle5