This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Standard function for printing Normal Distribution in ggplot2 | |
# # # # | |
plotNormCurve <- function( mean = 0, sd = 1, variance = sd ^ 2, | |
lowerBound = NULL, upperBound = NULL, | |
sdRange = 3.5, | |
from = mean - (sdRange * sd), | |
to = mean + (sdRange * sd), | |
plotTitle = 'Normal Curve', xlab = 'x', ylab = 'density' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
suppressMessages( library( calibrate ) ) | |
suppressMessages( library( ggplot2 ) ) | |
suppressMessages( library( ggrepel ) ) | |
suppressMessages( library( ggdendro ) ) | |
suppressMessages( library( dendextend ) ) | |
suppressMessages( require( htmlwidgets ) ) | |
suppressMessages( require( gridExtra ) ) | |
suppressMessages( require( plotly ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
## Properties | |
FRM_GENE_FILE <- 'frm_gene_exp.diff.txt' | |
FAV_COLS <- c( 'gene', 'sample_1', 'sample_2', 'value_1', 'value_2', 'log2(fold_change)', 'q_value' ) | |
GENE_ID_FILTER <- '^((Mir([\\d]|let)+.*)|---|LOC\\d+|(.*Rik.*))$' | |
HEATMAPS_DIR <- 'heatmaps' | |
VOLCANO_WIDGET_DIR <- 'interactiveVolcanoPlots' | |
## Package Dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
options( width = 120, warn = -1 ) | |
# # # # | |
# # Just some random R functions that are helpful # # | |
# Override defaults of functions | |
# gsub <- function( pattern, replacement, x, ignore.case = FALSE, perl = TRUE, fixed = FALSE, useBytes = FALSE ) | |
# { | |
# return( gsub(pattern, replacement, x, ignore.case = ignore.case, perl = perl, fixed = fixed, useBytes = useBytes) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
suppressMessages( source( '/cvri/Rutils/randomTools.R' ) ) | |
## | |
# Analyze the results of HOMER after it runs | |
# | |
analyzeHomerEnrichment <- function( | |
dir = 'goi', toFiles = FALSE, | |
n = 5 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
suppressMessages( require( stringr ) ) | |
options( java.parameters = "-Xmx32g" ) | |
suppressMessages( require( rJava ) ) | |
.joptions( java.parameters = "-Xmx32g" ) | |
.jinit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require( zoo ) | |
require( iterpc ) | |
# Could be retreived from anywhere of course… | |
nucleotideSequence <- sample( c('A','T','C','G'), 1000, replace=TRUE, prob=c(.1,.1,.4,.4) ) | |
windowWidth <- 3 | |
kmers <- rollapply( nucleotideSequence, width = windowWidth, by = 1, paste, collapse='' ) | |
possibleKmers <- apply( getall( iterpc(4, 3, c('A','T','C','G'), replace = TRUE) ), 1, paste, collapse = '' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loanData <- data.frame( | |
description = c( | |
'1-03 Direct Loan - Unsubsidized', | |
'1-02 Direct Loan - Subsidized', | |
'Direct Unsubsidized Stafford', | |
'Direct Unsubsidized Stafford', | |
'1-01 Direct Loan - Unsubsidized', | |
'Direct Unsubsidized Stafford', | |
'Direct Subsidized Stafford', | |
'Direct Unsubsidized Stafford', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"type" as $filter | | |
._embedded | to_entries | |
| map({(if (.value | has($filter)) then .key else empty end): .value|keys}) | |
| add | |
## Sample command: | |
# curl --silent https://api.financialwellness.com/task/tasklist/index | jq -Cf findActionsWithType.jq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
currentversion() { | |
# If xpath is on your machine (macos will I believe), | |
# and the project's version is in the path `project.version`, | |
# then it is nice to use this because it is faster. | |
# xpath ./pom.xml 'project/version/text()' 2>/dev/null | |
# Otherwise: | |
mvn help:evaluate -Dexpression=project.version -q -DforceStdout | |
} |
OlderNewer