-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update material for lectures 16 17 18
- Loading branch information
1 parent
bd02a00
commit ca32423
Showing
6 changed files
with
1,670 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
title: "Mapping chromatin structure and transactions" | ||
author: "Your Name Here" | ||
--- | ||
|
||
## `bed_intersect()` example {.smaller} | ||
|
||
```{r} | ||
#| label: bed-intersect | ||
library(valr) | ||
library(dplyr) | ||
x <- tribble( | ||
~chrom, ~start, ~end, | ||
"chr1", 25, 50, | ||
"chr1", 100, 125 | ||
) | ||
y <- tribble( | ||
~chrom, ~start, ~end, | ||
"chr1", 30, 75 | ||
) | ||
``` | ||
|
||
## valr example | ||
|
||
You can use `read_bed()` and related functions to load genome annotations and signals. | ||
|
||
```{r} | ||
#| label: valr-example | ||
snps <- read_bed( | ||
valr_example("hg19.snps147.chr22.bed.gz"), | ||
n_fields = 6 | ||
) | ||
genes <- read_bed( | ||
valr_example("genes.hg19.chr22.bed.gz"), | ||
n_fields = 6 | ||
) | ||
``` | ||
|
||
## What is in `snps` and `genes`? {.smaller} | ||
|
||
```{r} | ||
``` | ||
|
||
```{r} | ||
``` | ||
|
||
## Interval manipulation {.smaller} | ||
|
||
Let's find and characterize intergenic SNPs. We'll use the tools `bed_substract()` and `bed_closest()`. Take a look and their examples in the documentation to see what they do. | ||
|
||
```{r} | ||
``` | ||
|
||
. . . | ||
|
||
Take a look at the `intergenic` and `nearby` objects in the console. | ||
|
||
## Interval manipulation {.smaller} | ||
|
||
Now that you have overlaps and distances between SNPs and genes, you can | ||
go back to dplyr tools to generate reports. | ||
|
||
```{r} | ||
#| label: valr-dplyr | ||
``` | ||
|
||
## `bed_map()` example {.smaller} | ||
|
||
Copy / paste these into your console. | ||
|
||
```{r} | ||
#| echo: true | ||
x <- tribble( | ||
~chrom, ~start, ~end, | ||
"chr1", 100, 250, | ||
"chr2", 250, 500 | ||
) | ||
y <- tribble( | ||
~chrom, ~start, ~end, ~value, | ||
"chr1", 100, 250, 10, | ||
"chr1", 150, 250, 20, | ||
"chr2", 250, 500, 500 | ||
) | ||
``` | ||
|
||
## `bed_map()` example continued {.smaller} | ||
|
||
First examine the intersecting intervals. | ||
|
||
```{r} | ||
``` | ||
|
||
|
||
```{r} | ||
``` | ||
|
Oops, something went wrong.