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 get_average(array) | |
sum = 0.0 | |
result = 0.0 | |
if array.length > 0 then | |
array.each do |item| | |
sum += item | |
end | |
result = sum / array.length | |
end | |
return 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
stage_one = { | |
// define output with produce | |
produce("OUTPUT.vcf") { | |
println "INPUT IS $input" | |
exec "touch $output" | |
} | |
} | |
run { | |
// DEFINE INPUT |
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
bgzip_and_index = | |
{ | |
// first we define manually the outputs, please NOTE the def | |
// without def the variable is GLOBAL and will propagate in other branches!!! | |
// we can use ${input.prefix} to get the BASENAME | |
// We will produce a file with extension: .ann.gvcf.gz (bgzip) | |
// and a file with extension .ann.gvcf.gz.tbi (produced by tabix) | |
// There is no need for the move (mv) stage | |
def outputs = [ |
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
// Learning Processing | |
// Daniel Shiffman | |
// http://www.learningprocessing.com | |
// Example 17-6: Text breaking up | |
// A class to describe a single Letter | |
class Letter { | |
char letter; | |
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
// SILLABA | |
class Sillaba { | |
// An array of Letter objects | |
Letter[] letters; | |
float x; | |
float y; | |
Sillaba(String message, float _x , float _y) |
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(GillespieSSA) | |
gillespie_buggy_model <- function() | |
{ | |
x0 <- c(h=1000,z=10) | |
nu <- matrix(c(+1, -1, -1, 0, 0, 0, 1, -1),nrow=2,byrow=T) | |
rownames(nu) <- c("h","z") | |
colnames(nu) <- c("c1","c2","c3","c4") | |
a <- c("c1*h*h", "c2*h", "c3*h*z", "c4*h*z") |
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 python | |
# encoding: utf-8 | |
""" | |
fibonacci.py | |
RECURSIVE or GENERATOR? | |
Created by drambald on 2012-07-10. | |
Copyright (c) 2012 tucanosoftware.com. All rights reserved. | |
""" |