-
Notifications
You must be signed in to change notification settings - Fork 0
/
join.Rmd
33 lines (25 loc) · 990 Bytes
/
join.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Joining Ranges
You can combine all the intervals that overlap in two PyRanges objects with the join method.
If you do not use a suffix, the default `_b` is chosen.
```{python tidy=FALSE}
import pyranges as pr
gr = pr.load_dataset("aorta")
gr2 = pr.load_dataset("aorta2")
print(gr.join(gr2, suffix="_2"))
```
Both methods also take a strandedness option, which can either be `"same"`, `"opposite"` or `False`/`None`
```{python tidy=FALSE}
print(gr.join(gr2, strandedness="opposite"))
```
The join method also takes a how argument, which currently accepts the
option `"containment"`, which requires that the intervals in self be
completely within the intervals in other.
```{python tidy=FALSE}
print(f2.join(f1, how="containment"))
```
The join method also takes the argument new_pos which can either be `union`or
`ìntersection`. The default suffixes are `["_a", "_b"]`, but a suffixes argument
overrides this.
```{python tidy=FALSE}
print(f2.join(f1, new_pos="intersection"))
```