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
import pyvips | |
a = pyvips.Image.new_from_file('input.svs') | |
image_desc = a.get('tiff.ImageDescription') | |
a.set_type(pyvips.GValue.gstr_type, 'image-description', image_desc) | |
a.tiffsave('output.tif', pyramid=True, tile=True, compression='jpeg', tile_height=256, tile_width=256, Q=80) |
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
import psutil | |
import random | |
ports = set(map(lambda k: k.laddr.port,psutil.net_connections())) | |
print(random.choice(list(set(range(2000,10000)) - ports))) |
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 ce9d3edd1b0f3397cf6558a650d1a0ee2edbb823 Mon Sep 17 00:00:00 2001 | |
From: rvalieris <[email protected]> | |
Date: Fri, 21 Sep 2018 21:16:05 -0300 | |
Subject: [PATCH] uncomment sysroot change | |
--- | |
recipe/build.sh | 30 ++++++++++++++++-------------- | |
1 file changed, 16 insertions(+), 14 deletions(-) | |
diff --git a/recipe/build.sh b/recipe/build.sh |
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
library(signeR) | |
library(VariantAnnotation) | |
library(BSgenome.Hsapiens.UCSC.hg19) | |
library(BiocParallel) | |
register(MulticoreParam(workers=5)) # use 5 cores | |
vcf = readVcf("a.vcf") | |
split_vcf = split(vcf,ceiling(seq_along(vcf)/1000)) # split vcf into chunks of 1000 rows |
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 python3 | |
import requests | |
import hashlib | |
import getpass | |
password = getpass.getpass() | |
hash = hashlib.sha1(password.encode("utf8")).hexdigest().upper() | |
head, rest = hash[:5], hash[5:] | |
r = requests.get("https://api.pwnedpasswords.com/range/%s" % 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
change_triplet <- c( | |
"C>A:ACA","C>A:ACC","C>A:ACG","C>A:ACT","C>A:CCA","C>A:CCC","C>A:CCG", | |
"C>A:CCT","C>A:GCA","C>A:GCC","C>A:GCG","C>A:GCT","C>A:TCA","C>A:TCC", | |
"C>A:TCG","C>A:TCT","C>G:ACA","C>G:ACC","C>G:ACG","C>G:ACT","C>G:CCA", | |
"C>G:CCC","C>G:CCG","C>G:CCT","C>G:GCA","C>G:GCC","C>G:GCG","C>G:GCT", | |
"C>G:TCA","C>G:TCC","C>G:TCG","C>G:TCT","C>T:ACA","C>T:ACC","C>T:ACG", | |
"C>T:ACT","C>T:CCA","C>T:CCC","C>T:CCG","C>T:CCT","C>T:GCA","C>T:GCC", | |
"C>T:GCG","C>T:GCT","C>T:TCA","C>T:TCC","C>T:TCG","C>T:TCT","T>A:ATA", | |
"T>A:ATC","T>A:ATG","T>A:ATT","T>A:CTA","T>A:CTC","T>A:CTG","T>A:CTT", |
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
change_triplet <- c( | |
"C>A:ACA","C>A:ACC","C>A:ACG","C>A:ACT","C>A:CCA","C>A:CCC","C>A:CCG", | |
"C>A:CCT","C>A:GCA","C>A:GCC","C>A:GCG","C>A:GCT","C>A:TCA","C>A:TCC", | |
"C>A:TCG","C>A:TCT","C>G:ACA","C>G:ACC","C>G:ACG","C>G:ACT","C>G:CCA", | |
"C>G:CCC","C>G:CCG","C>G:CCT","C>G:GCA","C>G:GCC","C>G:GCG","C>G:GCT", | |
"C>G:TCA","C>G:TCC","C>G:TCG","C>G:TCT","C>T:ACA","C>T:ACC","C>T:ACG", | |
"C>T:ACT","C>T:CCA","C>T:CCC","C>T:CCG","C>T:CCT","C>T:GCA","C>T:GCC", | |
"C>T:GCG","C>T:GCT","C>T:TCA","C>T:TCC","C>T:TCG","C>T:TCT","T>A:ATA", | |
"T>A:ATC","T>A:ATG","T>A:ATT","T>A:CTA","T>A:CTC","T>A:CTG","T>A:CTT", |
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 | |
set -e | |
perl Configure.pl --backend=moar --gen-moar --prefix="$PREFIX" | |
make | |
make rakudo-test | |
make install |
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
--- a/configure 2017-08-22 07:59:12.000000000 -0300 | |
+++ b/configure 2018-01-16 16:41:25.378540069 -0200 | |
@@ -3298,7 +3298,7 @@ | |
## Download NLopt source code | |
## curl -O http://ab-initio.mit.edu/nlopt/nlopt-${NLOPT_VERSION}.tar.gz | |
- $("${R_HOME}/bin/Rscript" --vanilla -e "download.file(url='${NLOPT_URL}', destfile='${NLOPT_TGZ}')") | |
+ $("${R_HOME}/bin/Rscript" --vanilla -e "download.file(url='${NLOPT_URL}', destfile='${NLOPT_TGZ}', method='curl', extra='-L')") | |
## Extract NLopt source code and remove .tar.gz |
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
# run as R -d valgrind -f test.R | |
library(Rcpp) | |
sourceCpp("test.cpp") |