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
sqdemon () { | |
a=0 | |
while [[ $a != 1 ]]; do | |
date | |
squeue -u achateigner | |
a=$(squeue -u achateigner | wc -l) | |
echo $a | |
sleep ${1:-10} | |
nblines=$(echo "$a + 2" | bc) |
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
############################################################################# | |
## Function to Calculate Monthly Mortgage Payments and Amortization Tables ## | |
############################################################################# | |
# Author: Thomas Girke | |
# Last update: Feb 27, 2007 | |
# Utility: Calculates monthly and annual loan or mortgage payments, generates amortization tables and plots the results | |
# How to run the script: | |
# source("http://faculty.ucr.edu/~tgirke/Documents/R_BioCond/My_R_Scripts/mortgage.R") | |
# Definitions: |
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
manhattanPlus <- function (x, chr = "CHR", bp = "BP", p = "P", snp = "SNP", | |
col = c("gray10", "gray60"), chrlabs = NULL, | |
suggestiveline = -log10(1e-05), | |
genomewideline = -log10(5e-08), highlight = NULL, | |
logp = TRUE, annotatePval = NULL, annotateTop = TRUE, | |
otherColors = rev(viridis::viridis(3)[1:2]), | |
otherDataColName = FALSE, otherCatName = FALSE, | |
...) | |
{ | |
CHR = BP = P = index = NULL |
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
excelRemoveProtection(){ | |
echo "Usage: exelRemoveProtection fichier.xlsx" | |
unzip "$1" -d tmp | |
cd tmp/xl/worksheets/ | |
for i in "$(ls *.xml)" ; do | |
sed -i 's/Protection password="[A-Za-z0-9]*"/Protection password=""/' $i | |
echo "Hacked $i" | |
done | |
cd .. | |
sed -i 's/Protection workbookPassword="[A-Za-z0-9]*"/Protection workbookPassword=""/' workbook.xml |
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
loadAllChunksCache <- function(fileContainingChunks, | |
pathForCache = paste0(sub(".Rmd", "", fileContainingChunks), | |
"_cache/", | |
names(which(sapply(c("html", "pdf", "word"), | |
function(x)dir.exists(paste0(sub(".Rmd", "", fileContainingChunks), "_cache/", x, "/")))))[1], | |
"/")){ | |
lignesDeNomDeChunk <- grep("^```{r", readLines(fileContainingChunks), perl = TRUE, value = TRUE) | |
nomsDeChunks <- sapply(strsplit( | |
sapply(strsplit( | |
sapply(strsplit(lignesDeNomDeChunk, "{r ", perl = TRUE), function(x) x[[2]]), |
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
`%tin%` <- function(x, y) { | |
mapply(assign, as.character(substitute(x)[-1]), y, | |
MoreArgs = list(envir = parent.frame())) | |
invisible() | |
} |
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
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
# if install fails, try bioconductor | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)){ | |
if (! any(grep("BiocInstaller", search()))){ | |
source("https://bioconductor.org/biocLite.R") | |
library(BiocInstaller) |
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
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |