diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/fitqtl.rs | 9 | ||||
| -rw-r--r-- | src/routes/gemma.rs | 6 | ||||
| -rw-r--r-- | src/routes/qtl2.rs | 16 | ||||
| -rw-r--r-- | src/routes/rqtl.rs | 6 | ||||
| -rw-r--r-- | src/suggest.rs | 23 |
5 files changed, 60 insertions, 0 deletions
diff --git a/src/routes/fitqtl.rs b/src/routes/fitqtl.rs index 8c0c283..d37e4be 100644 --- a/src/routes/fitqtl.rs +++ b/src/routes/fitqtl.rs @@ -429,6 +429,15 @@ pub async fn compute_fitqtl( "PheWAS: every published trait peaking at this fit's strongest marker", ); } + let version = request + .genotype_version + .clone() + .unwrap_or_else(|| "{version}".to_string()); + if let Some(peak) = &peak_marker { + let (href, description) = + crate::suggest::class_hint(&group, &version, peak); + envelope = envelope.with_next(&href, description); + } envelope = envelope.with_links(crate::suggest::group_links(&group)); } Ok(Json(envelope)) diff --git a/src/routes/gemma.rs b/src/routes/gemma.rs index 2062425..cc7eb44 100644 --- a/src/routes/gemma.rs +++ b/src/routes/gemma.rs @@ -580,6 +580,12 @@ pub async fn compute_gemma( ), "PheWAS: every published trait peaking within 10 kb of this GWAS's peak", ); + let version = request + .genotype_version + .clone() + .unwrap_or_else(|| "{version}".to_string()); + let (href, description) = crate::suggest::class_hint(group, &version, &peak); + envelope = envelope.with_next(&href, description); envelope = envelope.with_links(crate::suggest::group_links(group)); } } diff --git a/src/routes/qtl2.rs b/src/routes/qtl2.rs index 6cc736c..45aa4b5 100644 --- a/src/routes/qtl2.rs +++ b/src/routes/qtl2.rs @@ -566,6 +566,13 @@ pub async fn compute_qtl2( if !output.summary.trim().is_empty() { envelope = envelope.with_note(&format!("qtl2: {}", output.summary.trim())); } + envelope = envelope.with_note( + "On a riself (riset) panel heterozygous calls are dropped before the scan -- R/qtl's \ + convert2riself -- and the HMM re-imputes them from flanking markers; GEMMA keeps them \ + as dosage 0.5. A marker that is mostly H therefore cannot produce a peak here, and two \ + engines can name different markers of one region without either being wrong. The \ + classes link in `next` shows the per-class counts.", + ); for note in ¬es { envelope = envelope.with_note(note); } @@ -589,6 +596,15 @@ pub async fn compute_qtl2( "PheWAS: every published trait peaking at this scan's strongest marker", ); } + let version = request + .genotype_version + .clone() + .unwrap_or_else(|| "{version}".to_string()); + if let Some(peak) = &peak_marker { + let (href, description) = + crate::suggest::class_hint(&group, &version, peak); + envelope = envelope.with_next(&href, description); + } envelope = envelope.with_links(crate::suggest::group_links(&group)); } Ok(Json(envelope)) diff --git a/src/routes/rqtl.rs b/src/routes/rqtl.rs index 0e142fb..8ff265e 100644 --- a/src/routes/rqtl.rs +++ b/src/routes/rqtl.rs @@ -448,6 +448,12 @@ pub async fn compute_rqtl( ), "PheWAS: every published trait peaking within 10 kb of this QTL's peak", ); + let version = request + .genotype_version + .clone() + .unwrap_or_else(|| "{version}".to_string()); + let (href, description) = crate::suggest::class_hint(group, &version, &peak); + envelope = envelope.with_next(&href, description); envelope = envelope.with_links(crate::suggest::group_links(group)); } } diff --git a/src/suggest.rs b/src/suggest.rs index 51d729a..9dad0b1 100644 --- a/src/suggest.rs +++ b/src/suggest.rs @@ -323,6 +323,11 @@ pub fn genotype_version_links(group: &str, version: &str) -> Vec<Link> { looks like real data otherwise", ), ( + format!("{base}/markers/{{marker}}/classes?trait={{trait_id}}"), + "One marker's trait values summarised per genotype class -- how a peak that rests \ + on two animals is told apart from one that rests on a hundred", + ), + ( format!("/groups/{}", seg(group)), "The group's record (species, mapping method, trait count)", ), @@ -404,6 +409,24 @@ pub fn unlisted_marker_links(name: &str, marker: &str) -> Vec<Link> { ] } +/// The forward hint every scan should carry: how many animals sit in each +/// genotype class at the peak. A peak resting on two animals and one resting +/// on a hundred read the same in a LOD column, and only this call tells them +/// apart. `{trait_id}` is the caller's to fill in -- the scan knows the trait's +/// values, not its PublishXRef.Id. +pub fn class_hint(group: &str, version: &str, marker: &str) -> Link { + ( + format!( + "/groups/{}/genotypes/{}/markers/{}/classes?trait={{trait_id}}", + seg(group), + seg(version), + seg(marker) + ), + "Count the animals in each genotype class at this peak (n, mean, sd, min, max per \ + class): a class of one or two is a different claim from a hundred. Fill in the trait id", + ) +} + /// What a group leads to. pub fn group_links(group: &str) -> Vec<Link> { let base = format!("/groups/{}", seg(group)); |
