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
from random import choices, choice | |
import pandas as pd | |
import numpy as np | |
nrows=1000 | |
customers = ["John", "Mary", "Alex", "Smith"] | |
products = ["Beverage", "Meat", "Vegetable", "Fruit"] | |
example_data = pd.DataFrame({"customer_id":choices(customers, k=nrows), "article_id":choices(products, k=nrows)}).astype("category") | |
print(example_data.head()) | |
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/env Rscript | |
#' Read a Microsoft Office color palette (DrawingML) | |
#' | |
#' After saving a custom scheme you can find these files \href{https://answers.microsoft.com/en-us/msoffice/forum/all/where-does-powerpoint-save-color-schemes-added-in/ea2ca2ec-e238-448b-860d-ff899d4e7afc}{here}: | |
#' \code{"%appdata%\Microsoft\Templates\Document Themes\Theme Colors"} | |
#' | |
#' @param file The path or content of the XML file | |
#' @return A named character vector with the hex values | |
#' @examples |
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
39c39,40 | |
< RUN cpanm Bio::Perl \ | |
--- | |
> RUN cpanm -f XML::DOM::XPath && \ | |
> cpanm Bio::Perl \ | |
68c69 | |
< RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.9.0+-x64-linux.tar.gz && \ | |
--- | |
> RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.9.0/ncbi-blast-2.9.0+-x64-linux.tar.gz && \ | |
100c101 |
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
39c39,40 | |
< RUN cpanm Bio::Perl \ | |
--- | |
> RUN cpanm -f XML::DOM::XPath && \ | |
> cpanm Bio::Perl \ | |
68c69 | |
< RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.9.0+-x64-linux.tar.gz && \ | |
--- | |
> RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.9.0/ncbi-blast-2.9.0+-x64-linux.tar.gz && \ | |
100c101 |
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/env bash | |
# | |
# Install | |
# | |
checkmdatdir="~/.checkmdata" | |
conda create -n chekmenv python=2.7 bioconda::checkm-genome -y | |
mkdir $checkmdatdir && wget -qO- https://data.ace.uq.edu.au/public/CheckM_databases/checkm_data_2015_01_16.tar.gz | tar xzf - -C $checkmdatdir | |
source activate chekmenv | |
checkm data setRoot $checkmdatdir |
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/env bash | |
set -e | |
# apt install dnsutils | |
# | |
# Update those values | |
# | |
server=ns.example.net # DNS server | |
zone=d.example.net # DNS Zone configured for updating |
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/env bash | |
# This function takes a hostname as an argument and returns | |
# 0 when the given host has at least 1 job running 0 if it has | |
# no job (or future). | |
function hasHostActiveJobs(){ | |
hostname=$1 | |
qhostout=$(qhost -j -xml -l hostname=$hostname) # Option seems to be called host on other systems | |
#echo $qhostout | |
filterstring="name='job_state'>r" # Just remove the r for any job |
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
#!/bin/bash | |
# Should work for every mod_dir page | |
# The regex ignores the sorted indices | |
# https://explainshell.com/explain?cmd=wget+--recursive+--reject-regex+%22%28.*%29%5C%3F%28.*%29%22+--no-parent+--mirror+--execute+robots%3Doff+--directory-prefix+%2Fnfs2%2Fshared%2Fngsmethdb%2F+--include-directories+%2FNGSmethDB_web%2Fdownloads%2Fhg19%2C%2FNGSmethDB_web%2Fdownloads%2Fhg38+https%3A%2F%2Fbioinfo2.ugr.es%2FNGSmethDB_web%2Fdownloads%2F | |
wget --recursive --reject-regex "(.*)\?(.*)" --no-parent --mirror --execute robots=off --directory-prefix /nfs2/shared/ngsmethdb/ --include-directories /NGSmethDB_web/downloads/hg19,/NGSmethDB_web/downloads/hg38 https://bioinfo2.ugr.es/NGSmethDB_web/downloads/ |