Finding cryptic relationships to boost disease gene detection
Help improve this workflow!
This workflow has been published but could be further improved with some additional meta data:- Keyword(s) in categories input, output, operation, topic
You can help improve this workflow by suggesting the addition or removal of keywords, suggest changes and report issues, or request to become a maintainer of the Workflow .
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:
-
The VCF is filtered using quality metrics contained within the VCF file.
-
The resultant VCF is then phased using BEAGLE.
-
IBD Segments are then estimated using GERMLINE.
-
Artefactual IBD is masked using a reference file by adjusting segment endpoints.
-
Adjusted IBD Segments are then summed to estimate relationships.
-
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
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" |
Support
- Future updates
Related Workflows





