Finding cryptic relationships to boost disease gene detection

public public 1yr ago Version: v0.3.0dev1-1 0 bookmarks

TRIBES

This is documentation to TRIBES version 0.2+. For the the documentation for older version 0.1 please check https://github.com/aehrc/TRIBES/tree/branch-0.1 .

TRIBES is a user-friendly platform for relatedness detection in genomic data. TRIBES is the first tool which is both accurate (up to 7th degree) and combines essential data processing steps in a single platform.

We demonstrate the accuracy of TRIBES in our publications here and here

Briefly, input data to TRIBES is quality control filtered, joint sample VCF. TRIBES then follows these steps:

  1. The VCF is filtered using quality metrics contained within the VCF file.

  2. The resultant VCF is then phased using BEAGLE.

  3. IBD Segments are then estimated using GERMLINE.

  4. Artefactual IBD is masked using a reference file by adjusting segment endpoints.

  5. Adjusted IBD Segments are then summed to estimate relationships.

  6. TRIBES returns result files, including .csv of estimated relationships.

To facilitate ease-of-use we employ ‘Snakemake’, a workflow tool which enables flexibility and reproducibility.

The full TRIBES pipeline is described in detail in Supplementary Material .

Learn more

Watch a short video introducing TRIBES and its applications TRIBES video

See documentation for more information on installing and using TRIBES

Code Snippets

9
knitr::opts_chunk$set(echo = TRUE, warning=FALSE, fig.width=12, fig.height=8)
13
14
15
library(ggplot2)
library(dplyr)
library(tribes.tools)
19
20
21
22
23
24
25
26
27
28
29
30
#Snakemake interface
args = list()
if (exists('snakemake')) {
    args = list(estimatedRelFile = snakemake@input$estRel, 
                trueRelFile = snakemake@input$trueRel)

} else {
    warning("Not running with snakemake. Using test arguments!!!")
    args = list(estimatedRelFile = '~/tmp/tribes/TFEur/FF-EUR-15-30-2-mut_BiSnp_EurAF:0.01_LD_PH_GRM-allchr_IBD.csv', 
                trueRelFile = '~/tmp/tribes/TFEur/FF-EUR-15-30-2-mut_relations.txt')
}
print(args)
34
35
36
37
38
39
40
41
42
estimatedRelations <- normalizeRelations(read.csv(args$estimatedRelFile, header = TRUE, stringsAsFactors = FALSE) %>% 
    mutate(EstDegree = as.relDegree(EstDegree)))
trueRelations <- readRelations(args$trueRelFile)
estimateRelationsWithTrue <- left_join(trueRelations, estimatedRelations, by=c('Id1', 'Id2')) %>%
    mutate(
        EstDegree = na.replace(EstDegree, as.relDegree('UR')), 
        IBD0.cM = na.replace(IBD0.cM, 1.0)
    )
head(estimateRelationsWithTrue)
46
47
48
49
50
51
#group and count by Known degree:Predicted degree combination
estimatedVsTruth <- estimateRelationsWithTrue %>%
  group_by(Degree, EstDegree) %>%
  count()

head(estimatedVsTruth)
56
57
58
59
60
61
62
63
64
65
#make plot comparing estimated to true degree - excluding unrelated as it distorts scale
print(
    ggplot(estimatedVsTruth, aes(Degree, EstDegree)) 
        + geom_point(aes(size = n)) 
        + geom_text(aes(label=n),hjust=0.5, vjust=-1, colour='red') 
        + theme_bw()
        + labs(title="Predicted vs True with UR",
                        y="Estimated degree of relationship",
                        x="Degree of reported relationship")
)
70
71
72
73
74
75
76
77
78
79
#make plot comparing estimated to true degree - excluding unrelated as it distorts scale
print(
    ggplot(estimatedVsTruth %>% filter(Degree != "UR") , aes(Degree, EstDegree)) 
        + geom_point(aes(size = n)) 
        + geom_text(aes(label=n),hjust=0.5, vjust=-1, colour='red') 
        + theme_bw()
        + labs(title="Predicted vs True no UR",
                        y="Estimated degree of relationship",
                        x="Degree of reported relationship")
)
20
21
22
shell:
    "echo 'Usage:' ;"
    "echo '    tribes -d <working dir> (estimate_degree|estimate_degree_vs_true)'"
1
__version__="0.2.0"
ShowHide 7 more snippets with no or duplicated tags.

Login to post a comment if you would like to share your experience with this workflow.

Do you know this workflow well? If so, you can request seller status , and start supporting this workflow.

Free

Created: 1yr ago
Updated: 1yr ago
Maitainers: public
URL: https://github.com/aehrc/TRIBES
Name: tribes
Version: v0.3.0dev1-1
Badge:
workflow icon

Insert copied code into your website to add a link to this workflow.

Downloaded: 0
Copyright: Public Domain
License: None
  • Future updates

Related Workflows

cellranger-snakemake-gke
snakemake workflow to run cellranger on a given bucket using gke.
A Snakemake workflow for running cellranger on a given bucket using Google Kubernetes Engine. The usage of this workflow ...