Skip to content

Commit

Permalink
Merge pull request #4 from kevinlkx/main
Browse files Browse the repository at this point in the history
update track plot tutorial page
  • Loading branch information
kevinlkx authored Oct 6, 2023
2 parents 7f2ea62 + 58b786b commit 4dd4b7c
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 86 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Description: Performs enrichment, functionally-informed genetic fine-mapping
and gene mapping.
BugReports: https://github.com/xinhe-lab/mapgen/issues
License: MIT + file LICENSE
Depends: R (>= 3.5.1)
Depends: R (>= 3.5.0)
Encoding: UTF-8
Imports:
tidyverse,
Expand Down
2 changes: 1 addition & 1 deletion R/plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ track_plot <- function(finemapstats,
highlight.color = 'pink',
genelabel.side = c('above', 'below', 'left', 'right'),
track.sizes,
rotation.title = 90,
rotation.title = 0,
verbose = FALSE,
...) {

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 29 additions & 66 deletions docs/articles/track_plot_tutorial.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ articles:
gene_mapping_tutorial: gene_mapping_tutorial.html
partition_pip_tutorial: partition_pip_tutorial.html
track_plot_tutorial: track_plot_tutorial.html
last_built: 2023-10-06T03:57Z
last_built: 2023-10-06T04:47Z
urls:
reference: https://xinhe-lab.github.io/mapgen/reference
article: https://xinhe-lab.github.io/mapgen/articles
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/track_plot.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/track_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 8 additions & 15 deletions vignettes/track_plot_tutorial.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Please have the following Bioconductor packages installed:
`GenomicInteractions`, `AnnotationDbi`, `org.Hs.eg.db`.

Load packages
```{r load-packages, message=FALSE}
```{r load-packages, message=FALSE, warning=FALSE}
library(GenomicFeatures) # Making and manipulating annotations
library(rtracklayer)
library(rtracklayer) # Import annotation data
library(Gviz) # R package used to visualize track plots
library(GenomicInteractions) # visualize HiC loops
library(AnnotationDbi) # match gene ID to gene symbol
Expand All @@ -45,14 +45,9 @@ finemapstats <- process_finemapping_sumstats(finemapstats,
pip.thresh = 0)
```

Load genomic annotations (hg19) included in the package
Load gene annotations (hg19) included in the package
```{r load-annotations}
genomic.annots <- readRDS(system.file("extdata", "genomic.annots.hg19.rds", package = "mapgen"))
summary(genomic.annots)
```

gene annotations
```{r}
gene.annots <- genomic.annots$genes
```

Expand Down Expand Up @@ -110,7 +105,7 @@ using a reference panel in `bigSNP` object.
We provided a `bigSNP` object of the reference genotype panel from the 1000 Genomes (1KG) European population.

If you are in the He lab at UChicago, you can load the `bigSNP` object from RCC as below.
```{r}
```{r, message=FALSE, warning=FALSE}
library(bigsnpr) # loading reference genotype for LD calculation
```

Expand All @@ -125,6 +120,7 @@ bigSNP <- snp_attach(rdsfile = "../../mapgen_tutorial_data/bigsnpr/EUR_variable_
## Make track plots

Plot CALU locus in the genomic region "chr7:128375000-128425000"

Highlight topSNP "rs55985730"
```{r make-CALU-trackplot, fig.width=12, fig.height=8, message=FALSE}
counts <- list("CM" = CM_counts, "Endo" = Endo_counts, "Fibro" = Fibro_counts)
Expand All @@ -145,13 +141,12 @@ track_plot(finemapstats,
counts.color = c("red", "green", "purple"),
peaks.color = c("navy", "blue"),
loops.color = "gray",
rotation.title = 0,
genelabel.side = "left",
verbose = TRUE)
genelabel.side = "left")
```


Plot HCN4 locus in the genomic region "chr15:73610000-73700000"

Highlight topSNP "rs7172038"
```{r make-HCN4-trackplot, fig.width=12, fig.height=8, message=FALSE}
counts <- list("CM" = CM_counts, "Endo" = Endo_counts, "Fibro" = Fibro_counts)
Expand All @@ -172,9 +167,7 @@ track_plot(finemapstats,
counts.color = c("red", "green", "purple"),
peaks.color = c("navy", "blue"),
loops.color = "gray",
rotation.title = 0,
genelabel.side = "above",
verbose = TRUE)
genelabel.side = "above")
```

[GENCODE]: https://www.gencodegenes.org

0 comments on commit 4dd4b7c

Please sign in to comment.