# Model weights paths
model_resource:
  root: /gpfs/scratch/zhouh05/aris/senescence_202411/data/gse133292_input/model_weights
  base_weights: chromnitron_base.pt
  per_cap_lora_weights: CAPs

# Input resources paths
input_resource:
  root: /gpfs/scratch/zhouh05/aris/senescence_202411/data/gse133292_input/input_resources
  sequence: DNA_sequence # These could be .fa files or .zarr files. <assembly_name>.fa or <assembly_name>.zarr, if using .zarr a chrom.sizes file is required, stored as <assembly_name>.chrom.sizes. SeqToVec can generate .zarr and .chrom.sizes files from .fa files.
  atac: ATAC_seq # These are .bigwig or .zarr files from SeqToVec pipeline. <sample_name>.zarr. recommend using symlinks to avoid copying files over
  cap: CAP_embeddings # These are .npz file embeddings generated by SeqToVec pipeline from protein sequences. <CAP_name>.npz
# Loci selection config
loci_source_config:
  mode: ATAC_seq # This is either ATAC_seq or RNA_seq, for ATAC_seq, two zarr files are required, for RNA_seq, an additional csv file of expression log2fc is required.
  rna:
    log2fc_csv: # This is the csv file of expression log2fc, should be placed under ./chromnitron_resources/input_resources/RNA_seq. It should have gene_name, experimental_exp, control_exp, and log2fc columns.
    top_diff_genes: # For each direction
    top_conserved_genes: # For each direction
    tss_radius: # 1Kb locus around TSS
    log2fc_threshold: # For each direction
  atac:
    data_path:
      control: growing_rep1,growing_rep2 # This the atac zarr file for the control condition, should be placed under ./chromnitron_resources/input_resources/ATAC_seq
      experimental: senescence_rep1,senescence_rep2 # This the atac zarr file for the experimental condition
    active_locus_threshold: 1 #  We don't consider loci lower than this accessibility threshold.
    log2fc_threshold: 0.1 # For each direction
    top_diff_genes: 2000 # For each direction
    top_conserved_genes: 100
  atac_seq_specific_config:  # Applicable only when mode is ATAC_seq
    mode: Promoter # Either Promoter or All_peaks
    promoter: # This mode will determine promoter regions from gff file and filter them based on the log2fc threshold
      tss_radius: 500 # 1Kb locus around TSS
    all_peaks: # This mode will call all peaks from the atac zarr files and filter them based on the log2fc threshold

preprocessing_data_config: 
  gff_file: gencode.v45.transcripts.annotation.gff3 # Should corresponds to sequence assembly used in the inference, placed under ./chromnitron_resources/input_resources/DNA_sequence
  chr_sizes_file: hg38.chrom.sizes # Should corresponds to sequence assembly used in the inference, placed under ./chromnitron_resources/input_resources/DNA_sequence
  output: 
    path: /gpfs/scratch/zhouh05/aris/senescence_202411/downstream/results/sene/s1_preprocessing

# Inference configuration: input and output paths. Regions, cell types, and CAPs of interest
inference_config:
  input:
    root: /gpfs/scratch/zhouh05/aris/senescence_202411/chromnitron/chromnitron_allchroms/examples/inputs
    assembly: hg38 # Assembly name, used to find chrom.sizes file
    excluded_region_path: auto # automatically determined by assembly and downloaded from Boyle lab, auto format: <assembly_name>-blacklist.v2.bed.
    locus_list_path: locus.bed # Bed file
    locus_list_out: locus_sene_vs_growing.bed # Bed file
    celltype_list_path: celltype.txt # Text file, one cell type per line according to atac-seq sample names
    cap_list_path: cap.txt # Text file, one CAP per line
  inference:
    enable: True
    use_finetune: auto # If auto, use finetuned model if available, otherwise use base model
    batch_size: 8 # Batch size for inference
    num_workers: 8 # Number of cpu workers for inference
  output:
    path: /gpfs/scratch/zhouh05/aris/senescence_202411/chromnitron_sene_output_allchroms # Directory to save output files
  post_processing:
    enable: True
    valid_margin: 1024 # Valid margin is removed from each side of the prediction to keep the prediction within the valid region
    store_bigwig: True # Whether to store bigwig files
    store_zarr: True # Whether to store zarr files
    peak_calling: True # Whether to call peaks


# Post-processing configuration
merge_inference_config:
  output:
    path: /gpfs/scratch/zhouh05/aris/senescence_202411/downstream/results/sene/s3_merge_inference/outputs

# Extract data matrices configuration
extract_data_config:
  output:
    path: /gpfs/scratch/zhouh05/aris/senescence_202411/downstream/results/sene/s4_data_matrices

# Postprocessing configuration
postprocess_config:
  output:
    path: /gpfs/scratch/zhouh05/aris/senescence_202411/downstream/results/sene/s5_postprocessing/strict_variance_filter
  variance_filtering:
    enable: True  # Whether to enable variance filtering
    n_genes: 2000  # Number of most variable genes to keep
    n_caps: 500    # Number of most variable CAPs to keep
    condition: differential  # 'differential' or 'conserved'
  remove_noise:
    enable: True  # Whether to enable noise removal
    top_percent: 10.0  # Keep top percentage of signal
    conditions: ['all']  # Conditions to consider for noise removal
  plotting:
    plot_histograms: True  # Whether to plot histograms of variabilities
    plot_variability: True  # Whether to plot variability bar plots
    plot_chipseq: True  # Whether to plot chip-seq signals for top variable CAPs

# Signature configuration
signature_config:
  output:
    path: /gpfs/scratch/zhouh05/aris/senescence_202411/downstream/results/sene/s6_signature/strict_variance_filter_high_k
  method: nmf  # 'kmeans' or 'nmf'
  seed: 9  # Random seed for reproducibility
  # Method-specific parameters
  kmeans:
    min_k: 3  # Minimum number of clusters to test for kmeans
    max_k: 40  # Maximum number of clusters to test for kmeans
  nmf:
    init: nndsvd  # Initialization method for NMF ('random' or 'nndsvd')
    n_components: 4  # Number of components for NMF
    min_components: 3  # Minimum number of components to test for NMF
    max_components: 40  # Maximum number of components to test for NMF
    max_iter: 200  # Maximum number of iterations for NMF convergence
    
    
    
    
