| Title: | Incorporation of chromatin interaction and epigenetic profiles to predict risk genes |
|---|---|
| Description: | Combines chromatin interaction (e.g. PLAC-seq/Hi-C) data with regulatory region annotations (e.g. promoters, enhancers, H3K27ac) to link non-coding GWAS SNPs to their putative target genes, producing MAGMA-compatible gene annotation files for downstream gene-level association testing. |
| Authors: | Aydan Asgarova [aut, cre] |
| Maintainer: | Aydan Asgarova <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.99.3 |
| Built: | 2026-10-12 13:45:07 UTC |
| Source: | https://github.com/BiocStaging/hmagmaR |
Generates an annotation file for magma input
AnnotationFileHmagma( hic, regulatoryRegions = NULL, promoterRegions = NULL, enhancerRegions = NULL, snps, annotated_genes, snpgeneexon, AnnotationFile )AnnotationFileHmagma( hic, regulatoryRegions = NULL, promoterRegions = NULL, enhancerRegions = NULL, snps, annotated_genes, snpgeneexon, AnnotationFile )
hic |
Dataframe of chromatin interaction data with 6 columns in the format: "chrom1", "start1", "end1", "chrom2", "start2", "end2". Chromosome columns should have "chr" before the number |
regulatoryRegions |
Dataframe of regulatory regions (H3K27ac) in the .bed format (chr, start, end). Chromosome columns should have "chr" before the number |
promoterRegions |
Dataframe of promoters in the .bed format (chr, start, end). Chromosome columns should have "chr" before the number |
enhancerRegions |
Dataframe of enhancers in the .bed format (chr, start, end). Chromosome columns should have "chr" before the number |
snps |
Dataframe of reference snps. This could be the ".bim" file from g1000 reference genome in the format: "chr", "position", "rsid" |
annotated_genes |
Dataframe of reference genes. This should contain columns with names "chr", "start", "end", "ensg". Chromosome columns should have "chr" before the number |
snpgeneexon |
Dataframe of genes and snps within it. This should contain columns with names "rsid", "ensg" |
AnnotationFile |
Path prefix for the output file; ".transcript.annot" is appended |
Function generates gene level analysis files (.genes.raw, .genes.out, .log.suppl, .log)
data("test_dataset.microglia.hg19") out <- tempfile() AnnotationFileHmagma( hic = hic, promoterRegions = promoterRegions, enhancerRegions = enhancerRegions, snps = snps, annotated_genes = annotated_genes, snpgeneexon = snpgeneexon, AnnotationFile = out )data("test_dataset.microglia.hg19") out <- tempfile() AnnotationFileHmagma( hic = hic, promoterRegions = promoterRegions, enhancerRegions = enhancerRegions, snps = snps, annotated_genes = annotated_genes, snpgeneexon = snpgeneexon, AnnotationFile = out )
Generates an annotation file for magma input
GeneLevelAnalysis_hmagma(magma, g1000, gwas, AnnotationFile, output)GeneLevelAnalysis_hmagma(magma, g1000, gwas, AnnotationFile, output)
magma |
Path to magma binary file, should be in a '.../magma' format |
g1000 |
Path to 1,000 Genomes reference data files (.bin, .bed, .fam, .synonyms). Include the name of the of the files in the path (e.g. /path_to_g1000/g1000_eur). Obtain from https://cncr.nl/research/magma/ under Auxiliary files. |
gwas |
Path to the GWAS summary statistics to be used where rsid column name is "SNP", p-value column name is "P", and sample size column name is "N" |
AnnotationFile |
Annotation file generated using AnnotationFileHmagma() or SampledDownAnnotation() |
output |
Name of the output file |
Function generates gene level analysis files (.genes.raw, .genes.out, .log.suppl, .log)
# Requires a local MAGMA installation and 1000 Genomes reference files; # skipped automatically when magma is not found on the PATH. magma_path <- Sys.which("magma") if (nzchar(magma_path)) { GeneLevelAnalysis_hmagma( magma = magma_path, g1000 = "/path/to/g1000_eur", gwas = "/path/to/gwas_summary_stats.txt", AnnotationFile = "/path/to/annotation.transcript.annot", output = tempfile() ) } else { message("magma not found on PATH; skipping example.") }# Requires a local MAGMA installation and 1000 Genomes reference files; # skipped automatically when magma is not found on the PATH. magma_path <- Sys.which("magma") if (nzchar(magma_path)) { GeneLevelAnalysis_hmagma( magma = magma_path, g1000 = "/path/to/g1000_eur", gwas = "/path/to/gwas_summary_stats.txt", AnnotationFile = "/path/to/annotation.transcript.annot", output = tempfile() ) } else { message("magma not found on PATH; skipping example.") }
Generates an annotation file for magma input
SampledDownAnnotation( hic, regulatoryRegions, snps, annotated_genes, snpgeneexon, loopNumber, sampleDownNumber, AnnotationFile )SampledDownAnnotation( hic, regulatoryRegions, snps, annotated_genes, snpgeneexon, loopNumber, sampleDownNumber, AnnotationFile )
hic |
Dataframe of chromatin interaction data with 6 columns in the format: "chrom1", "start1", "end1", "chrom2", "start2", "end2". Chromosome columns should have "chr" before the number |
regulatoryRegions |
Dataframe of regulatory regions (H3K27ac) in the .bed format (chr, start, end). Chromosome columns should have "chr" before the number |
snps |
Dataframe of reference snps. This could be the ".bim" file from g1000 reference genome in the format: "chr", "position", "rsid" |
annotated_genes |
Dataframe of reference genes. This should contain columns with names "chr", "start", "end", "ensg". Chromosome columns should have "chr" before the number |
snpgeneexon |
Dataframe of genes and snps within it. This should contain columns with names "rsid", "ensg" |
loopNumber |
Number to sample down the loop number to. This is useful when comparing more than one sample to ensure that the difference is not down to the difference in loop number |
sampleDownNumber |
Number of times sample down the loop number randomly |
AnnotationFile |
Path where to save the sampled down annotation files |
Function generates sampled down gene level analysis files (.genes.raw, .genes.out, .log.suppl, .log)
data("test_dataset.microglia.hg19") out <- tempfile() SampledDownAnnotation( hic = hic, regulatoryRegions = regulatoryRegions, snps = snps, annotated_genes = annotated_genes, snpgeneexon = snpgeneexon, loopNumber = 5000, sampleDownNumber = 1, AnnotationFile = out )data("test_dataset.microglia.hg19") out <- tempfile() SampledDownAnnotation( hic = hic, regulatoryRegions = regulatoryRegions, snps = snps, annotated_genes = annotated_genes, snpgeneexon = snpgeneexon, loopNumber = 5000, sampleDownNumber = 1, AnnotationFile = out )
A small, randomly subsampled set of objects used to demonstrate the
hmagmaR workflow in the package vignette and examples. Load with
data("test_dataset.microglia.hg19"). Because the rows are drawn
independently at random from each source table (rather than hand-picked
around loci known to overlap), results produced from this dataset are
illustrative only and not biologically meaningful.
hic promoterRegions enhancerRegions regulatoryRegions snps annotated_genes snpgeneexon gwashic promoterRegions enhancerRegions regulatoryRegions snps annotated_genes snpgeneexon gwas
Eight objects are provided:
A data frame/tibble of 20,000 microglia PLAC-seq chromatin
interactions (Nott et al., 2019), with columns chr1, start1,
end1, chr2, start2, end2, plus interaction-calling
metadata (count, expected, fdr, ClusterLabel,
ClusterSize, ClusterType, ClusterNegLog10P,
ClusterSummit).
A data frame of 12,709 microglia promoter regions
(Nott et al., 2019) in BED-like format: chr, start, end.
A data frame of 44,090 microglia enhancer regions
(Nott et al., 2019) in BED-like format: chr, start, end.
A data frame identical to promoterRegions,
provided for functions such as SampledDownAnnotation() that take
a single combined regulatory-region table instead of separate promoter
and enhancer tables.
A data table of 20,000 reference SNPs subsampled from 1000
Genomes (European ancestry), with columns chr, Position,
SNP.
A data table of 20,000 reference gene coordinates,
with columns chr, start, end, ensg.
A data table of 20,000 SNPs falling within exons/promoters
of a gene, with columns rsid, ensg.
A data table of 20,000 example GWAS summary statistics rows,
with columns SNP, CHR, BP, A1, A2,
FRQ, BETA, SE, P, N.
An object of class tbl_df (inherits from tbl, data.frame) with 20000 rows and 14 columns.
An object of class data.frame with 12709 rows and 3 columns.
An object of class data.frame with 44090 rows and 3 columns.
An object of class data.frame with 12709 rows and 3 columns.
An object of class data.table (inherits from data.frame) with 20000 rows and 3 columns.
An object of class data.table (inherits from data.frame) with 20000 rows and 4 columns.
An object of class data.table (inherits from data.frame) with 20000 rows and 2 columns.
An object of class data.table (inherits from data.frame) with 20000 rows and 10 columns.
Subsampled from microglia PLAC-seq interactions and regulatory regions (Nott et al., 2019, https://doi.org/10.1126/science.aay0793), 1000 Genomes reference SNPs, and example GWAS summary statistics.