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
# CAS -> smiles with CACTUS server | |
sapply(cas, function(id){ | |
require(RCurl) | |
return(getURL(paste("http://cactus.nci.nih.gov/chemical/structure/",id,"/smiles",sep=""))) | |
}) |
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 java.io._ | |
import java.util.zip._ | |
import scala.io.Source | |
var in = new GZIPInputStream(new FileInputStream("test.gz")) | |
// write setup in different objects to close later properly (important for big files ) | |
var fos = new FileOutputStream("test2.gz") | |
var gzos = new GZIPOutputStream( fos ) | |
var w = new PrintWriter(gzos) |
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 https://biercoff.com/easily-measuring-code-execution-time-in-scala/ | |
def time[R](block: => R): R = { | |
val t0 = System.nanoTime() | |
val result = block // call-by-name | |
val t1 = System.nanoTime() | |
println("Elapsed time: " + (t1 - t0) + "ns") | |
result | |
} |
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
def f1 = { | |
println("f1") | |
true | |
} | |
def f2 = { | |
println("f2") |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Paste&Go</title> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js" ></script> | |
<script> | |
$( document ).ready(function() { | |
console.log( "ready!" ); |
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(Rqc) | |
fs <- "corrupted.fastq" | |
qa <- rqcQA(fs,sample=F) | |
sessionInfo() |
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
# loop over symbolik links in current directory | |
for f in `find . -maxdepth 1 -type l ` ; do | |
# get symlink destination | |
g=` readlink $f ` | |
# move original to directory | |
cp -f $g . | |
# clean | |
if [ $? == 0 ]; then | |
rm -f $g | |
rm -f $f |
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 java.io.File | |
import org.rocksdb._ | |
import org.rocksdb.util.SizeUnit | |
import scala.collection.JavaConversions._ | |
// build.sbt | |
// name := "RocksDB" | |
// version := "0.1" | |
// scalaVersion := "2.12.0" | |
// libraryDependencies += "org.rocksdb" % "rocksdbjni" % "5.0.1" |
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
/* | |
build.sbt | |
name := "AkkaStreamTemplate" | |
version := "0.1-SNAPSHOT" | |
scalaVersion := "2.12.2" | |
libraryDependencies ++= { | |
Seq( |
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
# http://www.sequentix.de/gelquest/help/distance_measures.htm | |
bdist <- function( x, y , method ){ | |
a <- sum( x == 1 & y == 1) | |
b <- sum( x == 1 & y == 0) | |
c <- sum( x == 0 & y == 1) | |
d <- sum( x == 0 & y == 0) | |
switch(method, | |
tanimoto = (a+d)/(a+2*(b+c)+d), |
OlderNewer