Skip to content

Instantly share code, notes, and snippets.

💻
Hacking away

Samuel Lampa samuell

💻
Hacking away
Block or report user

Report or block samuell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@samuell
samuell / Makefile
Created Sep 12, 2019
Example Makefile for building a coverage report for .Net Core 2.2 projects on Windows 10 in MSYS2/Bash
View Makefile
#!/bin/bash
# --------------------------------------------------------------------------------
# This script uses the coverlet tool to generate code coverage statistics about the tests
# For more info about coverlet: https://github.com/tonerdo/coverlet
# Author: Samuel Lampa
# --------------------------------------------------------------------------------
./bin/Debug/netcoreapp2.2/MyApp.Tests.dll:
echo "Installing any uninstalled dependencies, by executing dotnet restore ..."
dotnet restore
dotnet build
View eq-centric-2.go
package main
// Source code for this experiment: https://github.com/samuell/gormula
import (
"fmt"
"math"
)
func main() {
View eq-centric-1.go
monthlyPaymentUSD := Mul(
Div(
Mul(
Div(Val(rate),
Val(1200.0)),
Exp(
Add(
Val(1.0),
Div(
Val(rate),
View revcomplement.dot
digraph "DNA Base Complement Workflow" {
rankdir=LR;
graph [fontname="Arial",fontsize=13,color="#384A52",fontcolor="#384A52"];
node [fontname="Arial",fontsize=11,color="#384A52",fontcolor="#384A52",fillcolor="#EFF2F5",shape=box,style=filled];
edge [fontname="Arial",fontsize=9, color="#384A52",fontcolor="#384A52"];
"Base Complement" [shape=box];
"Make DNA" [shape=box];
"Reverse" [shape=box];
"Base Complement" -> "Reverse" [taillabel="compl", headlabel="in"];
"Make DNA" -> "Base Complement" [taillabel="dna", headlabel="in"];
View resequencing.dot
digraph "resequencing_workflow" {
rankdir=LR;
graph [fontname="Arial",fontsize=13,color="#384A52",fontcolor="#384A52"];
node [fontname="Arial",fontsize=11,color="#384A52",fontcolor="#384A52",fillcolor="#EFF2F5",shape=box,style=filled];
edge [fontname="Arial",fontsize=9, color="#384A52",fontcolor="#384A52"];
"bwa_aln_NA06984_1" [shape=box];
"bwa_aln_NA06984_2" [shape=box];
"bwa_aln_NA12489_1" [shape=box];
"bwa_aln_NA12489_2" [shape=box];
"download_fastq_NA06984_1" [shape=box];
View command_to_parameters_example.go
package main
import (
sp "github.com/scipipe/scipipe"
spc "github.com/scipipe/scipipe/components"
)
func main() {
wf := sp.NewWorkflow("example_workflow", 4)
View show_test_coverage_dotnetcore.sh
#!/bin/bash
# ---------------------------------------------------------------------
# Generate test coverage for .Net core 2 projects.
# ---------------------------------------------------------------------
# Author: Samuel Lampa
#
# This script is supposed to be run in a Windows bash-environment such
# as MSYS2 (See this post for a guide on how to set up one:
# https://bionics.it/posts/linux-like-non-wsl-terminal-env-on-windows)
#
View scipipe_late.go
package main
import (
sp "github.com/scipipe/scipipe"
)
func main() {
wf := sp.NewWorkflow("hello_world", 4)
hello := wf.NewProc("hello", "echo 'Hello ' > {o:out}")
View scipipe_early.go
package main
import (
sp "github.com/samuell/scipipe"
)
func main() {
hello := sp.Sh("echo foo > {o:out}")
hello.OutPathFuncs["out"] = func() string {
return "hello.txt"
View scipipe_proc_init_api.go
// -------------------------
// Option A
// -------------------------
merge := wf.NewProc("merge_"+ind, "bwa sampe {i:ref} {i:sai1} {i:sai2} {i:fq1} {i:fq2} > {o:merged} # {i:refdone} {p:ind}",
merge.InParam("ind").FromStr(ind)
merge.In("ref").From(ungzipRef.Out("out"))
merge.In("refdone").From(indexRef.Out("done"))
merge.In("sai1").From(outs[ind]["1"]["sai"])
merge.In("sai2").From(outs[ind]["2"]["sai"])
merge.In("fq1").From(outs[ind]["1"]["fastq"])
You can’t perform that action at this time.