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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Linkage disequilibrium (LD) between variants.
use crate::options::RequestOption;
use crate::{Client, Response, Result};
impl Client {
/// Computes and returns LD values between the given variant and all other variants in a window around it.
pub fn get_ld_id(
&self,
species: &str,
id: &str,
population_name: &str,
opts: &[RequestOption<'_>],
) -> Result<Response> {
self.call(
"getLdId",
&[
("species", species),
("id", id),
("population_name", population_name),
],
None,
opts,
)
}
/// Computes and returns LD values between two given variants.
pub fn get_ld_pairwise(
&self,
species: &str,
id1: &str,
id2: &str,
opts: &[RequestOption<'_>],
) -> Result<Response> {
self.call(
"getLdPairwise",
&[("species", species), ("id1", id1), ("id2", id2)],
None,
opts,
)
}
/// Computes and returns LD values between all pairs of variants in the defined region.
pub fn get_ld_region(
&self,
species: &str,
region: &str,
population_name: &str,
opts: &[RequestOption<'_>],
) -> Result<Response> {
self.call(
"getLdRegion",
&[
("species", species),
("region", region),
("population_name", population_name),
],
None,
opts,
)
}
}