knitr::opts_chunk$set(echo = FALSE)
The following packages were split off from Yandell's R/doqtl2 package and are now repositories at http://github.com/byandell:
Here is a strategy to look at multiple traits in a small interval:
Some challenges
How to incorporate this into shiny tool?
All packages are now set up to formally import functions or data from other packages. Thus, no packages are actually loaded, which should speed up processes. All packages import from some http://tidyverse.org package.
read_feather
winsorize
interp_map
scan1
, scan1coef
get_snpinfo
, get_svs8
, convert_bp
, get_gene_exon_snp
, sdp_to_logical
, sdp_to_pattern
scan1
, scan1coef
sdp_to_pattern
, CCcolors
, convert_bp
scan1
scan_pattern
get_gene_exon_snp
, sdp_to_pattern
, get_mgi_features
, CCcolors
comediate1_test
, mediate1_test
pmnorm
is.positive.definite
, make.positive.definite
get_common_ids
, fit1
, decomp_kinship
These routines assume data are in RDS files in folder datapath
.
The read data routines use analyses_tbl
created for data entry workflow.
Typically one would first do steps indicated in
system.file(file.path("doqtl2", "setup.R"), package='qtl2shiny')
.
These include
covar <- readRDS(file.path(datapath, "covar.rds")) analyses_tbl <- readRDS(file.path(datapath, "analyses.rds")
read_pheno_tbl
: read phenotype table from RDSget_pheno
: get phenotypes from phenotype tableget_covar
: get covariates from covariate matrixThe read genotype probability routines assume qtl2geno::calc_genoprob
has been run.
For quicker access, the chromosomes are stored in separate RDS file.
read_probs
: read 8-allele genotype probabilitesread_probs36
: read 36-diplotype genotype probabilitesHere are the main components, including CC colors and access to SQL databases with gene, SNP and SVS features.
CCcolors
, CCoricolors
: CC founder colors (from qtl2plot
)get_mgi_features
: Pull MGI gene tbl from SQLite databaseget_snpinfo
: Get SNP and InDel information in window around peakget_snpprobs
: Get SNP genotype probabilities in window around peakget_svs8
: Get SVS information in window around peakThe following pull features. Some have subset
, summary
or plot
methods.
get_feature_snp
: Match features with SNPsget_gene_exon
: Get exons for set of genesget_gene_exon_snp
: Get exons for set of genesget_gene_snp
: Match genes with SNPsThe rest are mostly utilities used in various places.
sdp_to_logical
: Convert sdp to patternsdp_to_pattern
: Convert sdp to patterncheck_interval
: Check chr, start_bp, end_bp for validityconvert_bp
: Convert to bp if in Mblistof_scan1coef
: List of scan1coef objectsmerge_feature
: Merge SNP lod peaks with SNP feature informationscan_pattern
: Genome scan by pattern setsnpscan_pattern
: Plot coefficients by pattern settop_snps_all
: Top SNPs for all phenotypes scannedThis routine will be folded into plot_snpasso
use, but has a few aspects not yet captured.
topsnp_pattern
: Fine Mapping scans by allele patternFollowing are utility routines
genoprob_to_patternprob
: Collapse genoprob according to patternpattern_diplos
: Extract pattern of diplotypespattern_haplos
: Extract pattern of diplotypessnpprob_collapse
: Collapse genoprob according to patternPlot methods for scan1
, scan1coef
, genes
and listof_scan1coef
objects.
The following are utility routines:
ggplot_scan1
: create ggplot2 object for scan1
and scan1coef
ggplot_genes
: create ggplot2 object for genes
color_patterns_get
: Set up col, pattern and group for plottingcolor_patterns_pheno
: Set up col, pattern and group for plottingcolor_patterns_set
: Set up colors for patterns or pointsdoqtl2_app
: run shiny appThe following tables show functions from R/doqtl2 used by shiny app. Some of them will stay, but some of them will be simplified, for instance to fit with R/qtl2ggplot, etc.
file | function ----------------- | -------- shinyGeneExon.R | plot_gene_exon shinyGeneRegion.R | get_mgi_features shinyPattern.R | scan_pattern shinyProbs.R | get_snpprobs read_probs read_probs36 shinySNPAllele.R | get_gene_exon_snp get_top_snps_tbl snpprob_collapse shinyScan1Plot.R | listof_scan1coefCC shinySetup.R | get_pheno shinyTopFeature.R | merge_feature
function | file | use ----------------- | -------- | -------- get_gene_exon_snp | gene_exon.R | call get_mgi_features get_mgi_features | get_mgi_features.R | extract from SQLite get_pheno | get_traits.R | get selected phenotypes get_snpprobs | snpinfo.R | snpprobs for SNPs, InDels, SVs get_top_snps_tbl | top_snps_tbl.R | get top SNP info based on LMMs listof_scan1coefCC | listof_scan1coefCC.R | create list of scan1coefCC objects merge_feature | merge_feature.R | merge SNP LOD and other information plot_gene_exon | gene_exon.R | plot genes and exons read_probs | read_probs.R | read genoprob object for RDS read_probs36 | read_probs.R | read genoprob object for RDS scan_pattern | scan_pattern.R | genome scan by pattern set snpprob_collapse | genoprob_to_patternprob.R | collapse from alleles to SNPs
Want scan_pattern
to look like plot_snpasso
with pattern="all"
.
Need to work on geno and exon stuff to meld with plot_genes
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.