Skip to content

Instantly share code, notes, and snippets.

View heuermh's full-sized avatar

Michael L Heuer heuermh

View GitHub Profile
@heuermh
heuermh / gist:8010881
Created December 17, 2013 19:14
Cy3 task which updates the current visual style but has threading issues
final class MyTask extends AbstractTask
{
private final CyNetworkView networkView;
private final VisualStyle style;
private boolean lockedNodeView = false;
private boolean lockedEdgeView = false;
@Override
public void run(final TaskMonitor taskMonitor)
{
@heuermh
heuermh / Drum8.ino
Created September 28, 2016 00:31 — forked from anonymous/Drum8.ino
// Copyright 2016 DSP Synthesizers Sweden.
//
// Author: Jan Ostman
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@heuermh
heuermh / cgcloud.md
Created March 15, 2017 19:56
ADAM on AWS using CGCloud

ADAM on AWS using CGCloud

Create an EC2 instance as a CGCloud gateway

Installing CGCloud on a Mac is a bit of trouble, so installing to a linux VM or an EC2 instance on AWS might be helpful. Our client chose the latter, installing to a t2.small instance that is available all the time.

$ ssh -A cgcloud.foo.com
@heuermh
heuermh / gist:8614becc278e98dd287d0fe9aa536682
Created March 14, 2018 17:18
Shuffle region join with/without sequence dictionary
$ ./bin/adam-shell --driver-memory 14g
Using SPARK_SHELL=/usr/local/bin/spark-shell
2018-03-14 12:02:18 WARN NativeCodeLoader:62 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
Spark context Web UI available at http://l0504206.nmdp.org:4040
Spark context available as 'sc' (master = local[*], app id = local-1521046943951).
Spark session available as 'spark'.
Welcome to
____ __
@heuermh
heuermh / gist:5e04ce1b90a588c4f46605eef43d3236
Created March 26, 2018 21:09
Reference.all fails with loadPartitionedParquetAlignments
scala> import org.bdgenomics.adam.rdd.ADAMContext._
import org.bdgenomics.adam.rdd.ADAMContext._
scala> import org.bdgenomics.adam.models._
import org.bdgenomics.adam.models._
scala> val partitioned = sc.loadPartitionedParquetAlignments("small.partitioned.alignments.adam")
2018-03-26 16:04:58 WARN ObjectStore:568 - Failed to get database global_temp, returning NoSuchObjectException
partitioned: org.bdgenomics.adam.rdd.read.AlignmentRecordRDD = DatasetBoundAlignmentRecordRDD with 2 reference sequences, 0 read groups, and 2 processing steps
import org.bdgenomics.adam.models.{ RecordGroup, RecordGroupDictionary }
import org.bdgenomics.adam.rdd.ADAMContext._
import org.bdgenomics.adam.rdd.fragment.InterleavedFASTQInFormatter
import org.bdgenomics.adam.rdd.read.{ AlignmentRecordRDD, AnySAMOutFormatter }
import org.bdgenomics.adam.sql.{ AlignmentRecord => AlignmentRecordProduct }
import org.bdgenomics.formats.avro.AlignmentRecord
val reads = sc.loadPairedFastqAsFragments("sample_1.fq", "sample_2.fq")
implicit val tFormatter = InterleavedFASTQInFormatter
#!/bin/bash
cannoli-submit \
interleaveFastq \
sample_1.fq \
sample_2.fq \
sample.ifq
cannoli-submit \
bwa \
[INFO] --- exec-maven-plugin:1.5.0:exec (doc-r) @ adam-r-spark2_2.11 ---
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
import org.bdgenomics.adam.rdd.ADAMContext._
import org.bdgenomics.cannoli.Cannoli._
val reads = sc.loadPairedFastqAsFragments("sample_1.fq", "sample_2.fq")
val bwaArgs = new BwaArgs()
bwaArgs.sample = "sample"
bwaArgs.indexPath = "/data/hs38DH.fa"
bwaArgs.useDocker = true
//bwaArgs.useSingularity = true
@heuermh
heuermh / .bash_profile
Created March 22, 2019 15:59
Bash prompt
# Generated 2015-09-14 by http://www.gilesorr.com/Code/bpb/ ,
# The Bash Prompt Builder written by Giles Orr.
case ${TERM} in
xterm*|rxvt*)
TITLEBAR='\[\033]0;\u@\h:\w\007\]';;
*)
TITLEBAR='';;
esac;
# Elegant code courtesy of nitrous.io: