Skip to contents

TFinfo class handles transcription factor binding site (TFBS) analysis. It processes peak data, scans for motif matches, and generates TF-target gene dictionaries for GRN construction.

Public fields

peak_df

Data frame with peak information

ref_genome

Reference genome name

bsgenome

BSgenome object name

peak_ranges

GRanges object for peaks

scanned_df

Data frame with motif scanning results

TF_onehot

One-hot encoded TF binding matrix

all_TF_list

All TF names

Methods


Method new()

Create a new TFinfo object

Usage

TFinfo$new(peak_df = NULL, ref_genome = NULL, genomes_dir = NULL)

Arguments

peak_df

Data frame with columns: chr, start, end, peak_id, gene_short_name

ref_genome

Reference genome (e.g., "hg38", "mm10")

genomes_dir

Directory for genome data (optional)


Method scan()

Scan peaks for TF motif matches

Usage

TFinfo$scan(motifs = NULL, fpr = 0.02, n_cores = 1, verbose = TRUE)

Arguments

motifs

PWMatrixList or path to motif database

fpr

False positive rate threshold

n_cores

Number of cores for parallel processing

verbose

Print progress


Method filter()

Filter TF results by various criteria

Usage

TFinfo$filter(min_peaks = 10, tfs_to_keep = NULL, tfs_to_remove = NULL)

Arguments

min_peaks

Minimum peaks with TF binding

tfs_to_keep

TFs to include (NULL for all)

tfs_to_remove

TFs to exclude


Method to_dataframe()

Convert to data frame format

Usage

TFinfo$to_dataframe()

Returns

Data frame with peak_id, gene_short_name, and TF columns


Method to_dictionary()

Convert to TF dictionary format

Usage

TFinfo$to_dictionary()

Returns

Named list mapping target genes to regulator TFs


Method save()

Save TFinfo object

Usage

TFinfo$save(file_path)

Arguments

file_path

Path to save file


Method print()

Print TFinfo summary Get BSgenome package name from reference genome Load genome from BSgenome Get default motifs from JASPAR Load motifs from file

Usage

TFinfo$print()


Method clone()

The objects of this class are cloneable with this method.

Usage

TFinfo$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.