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(gridExtra) | |
getLegend <- function(tp.gplot, position="bottom", box="horizontal"){ | |
tmp <- ggplot_gtable(ggplot_build(tp.gplot + theme(legend.position = position, legend.box = box))) | |
leg <- which(sapply(tmp$grobs, function(x) x$name) == "guide-box") | |
legend <- tmp$grobs[[leg]] | |
return(legend) | |
} | |
#then extract height or width of legend |
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.{ BufferedReader, File, FileReader } | |
import scalaz._, Scalaz._, effect.IO, iteratee.{ Iteratee => I, _ } | |
object IterateeIOExample { | |
type ErrorOr[+A] = EitherT[IO, Throwable, A] | |
def openFile(f: File) = IO(new BufferedReader(new FileReader(f))) | |
def readLine(r: BufferedReader) = IO(Option(r.readLine)) | |
def closeReader(r: BufferedReader) = IO(r.close()) |
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
package scalaz.example | |
object Reader extends App { | |
/** | |
* Manual propagation of the environment (in the example, `contextRoot`.) | |
*/ | |
object Config0 { | |
def fragment1(contextRoot: String) = <a href={contextRoot + "/foo"}>foo</a> |
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 | |
#copy .metainfo and .chrnames.endsembl from orig tar.gz in subfolder and change | |
# chrnames, ID | |
#tar with tar -zcvf Tair10numeric.tar.gz Tair10numeric | |
convertRdata <- function(){ | |
id <- "Tair10numeric" | |
dir.create(id, recursive=TRUE, show=FALSE ) |
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 nextflow | |
//the problem is 1, then the channel gets file(*) => UnixPath; > 1, then channel gets ArrayList<UnixPath> | |
starts=Channel.from(1,2,3,4) | |
process first { | |
input: | |
val start from starts | |
output: |
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 | |
#echo "Creating an SSH key for you..." | |
#ssh-keygen -t rsa | |
#echo "Please add this public key to Github \n" | |
#echo "https://github.com/account/ssh \n" | |
#read -p "Press [Enter] key after this..." | |
XCODE=$(xcode-select -p 1>/dev/null;echo $?) | |
if [ $XCODE -ne 0 ]; then |
OlderNewer