knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  echo = TRUE,
  include = TRUE,
  eval = FALSE
)
library(DiagrammeR)

Requirements

An up to date R (so whatever the current version is -- check CRAN) and up to date Rstudio. You also need to install the following packages:

cran_pkgs = c('tidyverse', 'devtools')

# note: increase/decrease the number of CPUs. Any machine should be able to 
# handle at least 5. You can probably bump this up to 10 without checking
# anything
install.packages(cran_pkgs, Ncpus = 5)

It is possible that there wil be install errors that come up during the installation of these two pages. If you are on the computational/analyst side of things, then this is a good opportunity to read the error messages and figure out what to install -- both packages may have some c or maybe fortran dependencies which you will need to install onto your computer. Googling the error helps, and frequently R will say, "you need a gcc compiler" or something like that.

If you are not one of the computational/analyst people, then ask for help if there are errors in the installation of those two packages.

Install

If there is a 'passing' badge in the github README, then this has been successfully built on up to date linux, mac and windows OS. It should also work for you. But, if it doesn't, copy the error and make an issue report. Please also include the output of Sys.info() in your issue report.

# as above, you can increase Ncpus
remotes::install.packages("BrentLab/brentlabRnaSeqTools", Ncpus = 5)

Setup Environmental Variables

Environmental variables are variables that are read by R and loaded into your session when you launch R. You can set either 'user' level variables, which are loaded into any R session launched under your current user, and/or you can set project level environmental variables, which are only set if you launch into a project (see Using Rstudio Projects below). These are convenient to use, and are particularly good at avoiding any embarrassing leaks of login credentials onto github.

User level environmental variables

  1. open Rstudio
usethis::edit_r_environ('user')
  1. in the file that is opened, enter some variables that you'd like to have
db_username = "some_username"
db_password = "some_password"
  1. restart your R session

  2. see that you can access these variables like so:

Sys.getenv("db_username")
# output will be:
#> "some_password"

If you put the correct username/password into your environment file, then you can access the database like so:

library(brentlabRnaSeqTools)

meta = getMetadata(
  database_info$kn99$db_host,
  database_info$kn99$db_name,
  Sys.getenv("db_username"),
  Sys.getenv("db_password"))

Since the user level environment file is stored in ~/.Renviron, there is no danger of pushing these credentials up to git if you are in a directory which you are tracking with git/github.

Project Overview

grViz("digraph UML_Class_diagram {
    graph [
        label='Package Structure'
        labelloc='t'
        fontname='Helvetica,Arial,sans-serif'
    ]
    node [
        fontname='Helvetica,Arial,sans-serif'
        shape=record
        style=filled
        fillcolor=gray95
    ]
    edge [fontname='Helvetica,Arial,sans-serif']
    edge [arrowhead=vee style=dashed]
    brentlabSeqTools -> brentlabSeqSet
    brentlabSeqTools -> VariantExplorer

    brentlabSeqSet[label = <{<b> brentlabSeqSet  </b> | + property<br align='left'/>...<br align='left'/>|+ method<br align='left'/>...<br align='left'/>}>]
    VariantExplorer[label = <{<b> VariantExplorer</b> | +metadata<br align='left'/> +gff<br align='left'/> +bsgenome<br align='left'/> +igv_genome <br align='left' /> +variants<br align='left'/> +expected_metadata_fields<br align='left'/>&nbsp;&nbsp;&nbsp;&nbsp; default: sample_id,bam,snpeff,variant_caller&nbsp;<br align='left'/><br align='left'/>|+create_variant_explorer<br align='left'/>+rank_results<br align='left'/>+visualize<br align='left'/>}>]

}")


BrentLab/brentlabRnaSeqTools documentation built on Aug. 20, 2023, 9:22 a.m.