Skip to content

Instantly share code, notes, and snippets.

@23jodys
23jodys / gist:cf193ec126efb4908f0b93a7c8d55c28
Created Apr 27, 2018
Building vagrant box from existing box with VMWare fusions
View gist:cf193ec126efb4908f0b93a7c8d55c28
vagrant init <base box>
vagrant up
vagrant ssh
# Do your customizations here
# yum -y install blah blah
# don't forget to clean up, yum clean all
# Reset the insecure key
dd if=/dev/zero of=/EMPTY bs=1M; rm -f /EMPTY
curl https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub > ~/.ssh/authorized_keys
exit
@23jodys
23jodys / Jenkinsfile
Created Oct 5, 2017
Declarative Jenkinsfile Environment Variables
View Jenkinsfile
pipeline {
agent any
stages {
stage('Example') {
environment {
// 'This value is exported to all commands in this stage'
AWESOME_BUILD = "${env.BUILD_ID + '/working'}"
}
steps {
sh 'mkdir -p $AWESOME_BUILD'
@23jodys
23jodys / Jenkinsfile
Last active Oct 5, 2017
Jenkinsfile Environment Declarative
View Jenkinsfile
pipeline {
agent any
stages {
stage('Example') {
steps {
// interpolated by the shell
sh 'echo Shell $PWD'
// interpolated by the shell
sh '''echo Shell $PWD'''
// interpolated in this file by Groovy
View test_reporter.py
#!/usr/bin/env python
""" Holds logic for TestReporter objects """
__author__ = "Mike 'Monty' Montgomery"
__copyright__ = "Copyright 2015, ArcherDX"
__credits__ = ["Mike 'Monty' Montgomery, Jody 'JodyStephens' Stephens"]
__license__ = "To Scribe"
__version__ = "0.1"
__maintainer__ = "Mike 'Monty' Montgomery"
__email__ = "mmontgomery@archerd.com"
View variant.py
from verum.common import ITestRecord, IValidationRecord, getPass
logger = logging.getLogger(__name__)
class VariantTestRecord(ITestRecord):
def __init__(self, variant, success=False):
self.variant = variant
self.success = success
self.ident = "{}:{}".format(variant.CHROM, variant.POS)
class VariantMatch(VariantTestRecord):
View gist:162c1d29cf7f72c3bbf5
FC_1_CONSENSUS TCGGCGCCTTTCGAGCAGTACTCCCCGGGTGGCCAGGACACCCCCAGCTCCAGCTCCTCAGGGGACGACTCCGTGTTTGCCCACGACCTGCTGCCCCCGGCCCCACCCATTTAAGGAGTCGGCCTTGAGGAAGCAGTCCTTATACCTCAAGTT
FC_1_CONSENSUS CGCCTTTCGAGCAGTACTCCCCGGGTGGCCAGGACACCCCCAGCTCCAGCTCCTCAGGGGACGACTCCGTGTTTGCCCACGACCTGCTGCCCCCGGCCCCACCCATTTAAGGAGTCGGCCTTGAGGAAGCAGTCCTTATACCTCA
chr4_1808384-1808403_11_R1_full_results.txt
FC_1_CONSENSUS CCTGTACATGATCATGCGGGAGTGCTGGCATGCCGCGCCCTCCCAGAGGCCCACCTTCAAGCAGCTGGTGGAGGACCTGGACCGTGTCCTTACCGTGACGTCCACCGACGTAAAGGCGACACAGGAGGAGAACCGGGAGCTGAGGAGCAGGTGTGAGGAGCTCCACGGGAAGAACCTGGAACTGGGGAAGATCATGGACAGGTTCGAAGAGGTTGTGT
FC_1_CONSENSUS TACATGATCATGCGGGAGTGCTGGCATGCCGCGCCCTCCCAGAGGCCCACCTTCAAGCAGCTGGTGGAGGACCTGGACCGTGTCCTTACCGTGACGTCCACCGACGTAAAGGCGACACAGGAGGAGAACCGGGAGCTGAGGAGCAGGTGTGAGGAGCTCCACGGGAAGAACCTGGAACTGGGGAAGATCATGGACAGGTTCGAAGAGGTT
chr4_1808384-1808403_12_R1_full_results.txt
FC_1_CONSENSUS CCTGTACATGATCATGCGGGAGTGCTGGCATGCCGCGCCCTCCCAGAGGCCCACCTTCAAGCAGCTGGTGGAGGACCTGGACCGTGTCCTTACCGTGACGTCCACCGACGTGCCAGGCCCACCCCCAGGTG
View gist:3d7423479e24e5efaaf9
class SampleHighlight(object):
def __init__(self, job_id, sample_name, field1):
errors = []
if not job_id.startswith("JOB_ID"):
errors.append("STRUCTURAL FAILURE: bad job_id")
try:
self._check_sample_name(sample_name)
except Exception as error:
errors.append(error.message)
View Quick test example
import os
import shutil
import tempfile
import textwrap
import unittest
class TestFileReader(unittest.TestCase):
def setUp(self):
self.tempdir = tempfile.mkdtemp()
View gist:048ce26ff5333bff7745
{
"$schema": "http://json-schema.org/schema#"
"definitions":{
"target": {
"type": "object",
"properties": {
"primer_size_min": {"type": "number", "minimum": 10, "maximum": 30},
"primer_size_max": {"type": "number", "minimum": 20, "maximum": 40}
},
"required": ["primer_size_min", "primer_size_max"]