#
# Configuration file for defuse
#
# At a minimum, replace all values enclosed by []
#
# For example:
# source_directory = /path/to/defuse
#

ensembl_version                             = 69
ensembl_genome_version                      = GRCh37
ucsc_genome_version                         = hg19

# Directory where the defuse code was unpacked
source_directory                            = [Where you unpacked the defuse code]

# Directory where you want your dataset
dataset_directory                           = [Where you intend to store the reference dataset]

# Input genome and gene models
gene_models                                 = $(dataset_directory)/Homo_sapiens.$(ensembl_genome_version).$(ensembl_version).gtf
genome_fasta                                = $(dataset_directory)/Homo_sapiens.$(ensembl_genome_version).$(ensembl_version).dna.chromosomes.fa

# Repeat table from ucsc genome browser
repeats_filename                            = $(dataset_directory)/repeats.txt

# EST info downloaded from ucsc genome browser
est_fasta                                   = $(dataset_directory)/est.fa
est_alignments                              = $(dataset_directory)/intronEst.txt

# Unigene clusters downloaded from ncbi
unigene_fasta                               = $(dataset_directory)/Hs.seq.uniq

# Paths to external tools
samtools_bin                                = [path of your samtools binary]
bowtie_bin                                  = [path of your bowtie binary version 0.12.5 or greater recommended]
bowtie_build_bin                            = [path of your bowtie-build binary version 0.12.5 or greater recommended]
blat_bin                                    = [path of your blat binary]
fatotwobit_bin                              = [path of your faToTwoBit binary from the blat suite]
r_bin                                       = [path of your R binary]
rscript_bin                                 = [path of your Rscript binary]
gmap_bin                                    = [path of your gmap binary]
gmap_setup_bin                              = [path of your gmap_setup binary]

# Directory where you want your dataset
gmap_index_directory                        = $(dataset_directory)/gmap

# Dataset files
dataset_prefix                              = $(dataset_directory)/defuse
chromosome_prefix                           = $(dataset_prefix).dna.chromosomes
exons_fasta                                 = $(dataset_prefix).exons.fa
cds_fasta                                   = $(dataset_prefix).cds.fa
cdna_regions                                = $(dataset_prefix).cdna.regions
cdna_fasta                                  = $(dataset_prefix).cdna.fa
reference_fasta                             = $(dataset_prefix).reference.fa
rrna_fasta                                  = $(dataset_prefix).rrna.fa
ig_gene_list                                = $(dataset_prefix).ig.gene.list
repeats_regions                             = $(dataset_directory)/repeats.regions
est_split_fasta1                            = $(dataset_directory)/est.1.fa
est_split_fasta2                            = $(dataset_directory)/est.2.fa
est_split_fasta3                            = $(dataset_directory)/est.3.fa
est_split_fasta4                            = $(dataset_directory)/est.4.fa
est_split_fasta5                            = $(dataset_directory)/est.5.fa
est_split_fasta6                            = $(dataset_directory)/est.6.fa
est_split_fasta7                            = $(dataset_directory)/est.7.fa
est_split_fasta8                            = $(dataset_directory)/est.8.fa
est_split_fasta9                            = $(dataset_directory)/est.9.fa

# Fasta files with bowtie indices for prefiltering reads for concordantly mapping pairs
prefilter1                                  = $(unigene_fasta)

# deFuse scripts and tools
scripts_directory                           = $(source_directory)/scripts
tools_directory                             = $(source_directory)/tools
data_directory                              = $(source_directory)/data

# Bowtie parameters
bowtie_threads                              = 1
bowtie_quals                                = --phred33-quals
max_insert_size                             = 500

# Parameters for building the dataset
chromosomes                                 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X,Y,MT
mt_chromosome                               = MT
gene_sources                                = IG_C_gene,IG_D_gene,IG_J_gene,IG_V_gene,processed_transcript,protein_coding
ig_gene_sources                             = IG_C_gene,IG_D_gene,IG_J_gene,IG_V_gene,IG_pseudogene
rrna_gene_sources                           = Mt_rRNA,rRNA,rRNA_pseudogene

# Blat sequences per job
num_blat_sequences                          = 10000

# Minimum gene fusion range
dna_concordant_length                       = 2000

# Trim length for discordant reads (split reads are not trimmed)
discord_read_trim                           = 50

# Filtering parameters
clustering_precision                        = 0.95
span_count_threshold                        = 5
split_count_threshold                       = 3
percent_identity_threshold                  = 0.90
max_dist_pos                                = 600
num_dist_genes                              = 500
split_min_anchor                            = 4
max_concordant_ratio                        = 0.1
splice_bias                                 = 10
denovo_assembly                             = no
positive_controls                           = $(data_directory)/controls.txt
probability_threshold                       = 0.50

# Position density when calculating covariance
covariance_sampling_density                 = 0.01

# Number of reads for each job in split
reads_per_job                               = 1000000

# Number of regions for each breakpoint sequence job in split
regions_per_job                             = 20

# If you have command line 'mail' and wish to be notified
mailto                                      = andrew.mcpherson@gmail.com

# Remove temp files
remove_job_files                            = yes
remove_job_temp_files                       = yes

# Converting to fastq
# Fastq converter config format 1 for reads stored in separate files for each end
#  data_lane_rexex_N is a perl regex which stores the lane id in $1
#  data_end_regex_N is a perl regex which stores the end, 1 or 2, in $1
#  data_compress_regex_N is a perl regex which stores the compression extension in $1
#  data_convert_N is the associated conversion utility that takes data at stdin and outputs fastq at stdout
# Fastq converter config format 2 for reads stored in separate files for each end
#  data_lane_regex_N is a perl regex which stores the lane id in $1
#  data_compress_regex_N is a perl regex which stores the compression extension in $1
#  data_end1_converter_N is the associated conversion utility that takes data at stdin and outputs fastq for end 1 at stdout
#  data_end2_converter_N is the associated conversion utility that takes data at stdin and outputs fastq for end 2 at stdout

data_lane_regex_1                           = ^(.+)_[12]_export\.txt.*$
data_end_regex_1                            = ^.+_([12])_export\.txt.*$
data_compress_regex_1                       = ^.+_[12]_export\.txt(.*)$
data_converter_1                            = $(scripts_directory)/fq_all2std.pl export2std

data_lane_regex_2                           = ^(.+)_[12]_concat_qseq\.txt.*$
data_end_regex_2                            = ^.+_([12])_concat_qseq\.txt.*$
data_compress_regex_2                       = ^.+_[12]_concat_qseq\.txt(.*)$
data_converter_2                            = $(scripts_directory)/qseq2fastq.pl

data_lane_regex_3                           = ^(.+)\.bam.*$
data_compress_regex_3                       = ^.+\.bam(.*)$
data_end1_converter_3                       = samtools view - | filter_sam_mate.pl 1 | sam_to_fastq.pl
data_end2_converter_3                       = samtools view - | filter_sam_mate.pl 2 | sam_to_fastq.pl

data_lane_regex_4                           = ^(.+).[12].fastq.*$
data_end_regex_4                            = ^.+.([12]).fastq.*$
data_compress_regex_4                       = ^.+.[12].fastq(.*)$
data_converter_4                            = cat

