Skip to content

Instantly share code, notes, and snippets.

View mpkocher's full-sized avatar

M. Kocher mpkocher

View GitHub Profile
@mpkocher
mpkocher / ArchOverview.md
Last active October 2, 2019 14:59
High Level Overview of the SMRT Link Secondary Analysis System

Arch Overview

Core Nouns of the PacBio System

  1. Run (often created/edited from SMRT Link RunDesign, stored as XML)
  2. CollectionMetadata a Run has a list of Collection (Primary Analysis will convert a CollectionMetadata to a SubreadSet)
  3. PacBio DataSets SubreadSet, ReferenceSet, etc... These are thin-ish XML files that have general metadata as well as pointers to 'external resources' (e.g., BAM, Fasta files) and their companion index files.
  4. SMRT Link Job A general (async) unit of work to perform operations on PacBio DataSets
  5. ** DataStoreFile** a container for output files from a SMRT Link Job and contains metadata, such as file type, size, path. A list of DataStore Files is called a DataStore. This is the core output of SMRT Link Job.
  6. ** Report** a Report is general model to capture Report metrics (also referred to as 'Attributes'), Report Tables and Report Plot Groups. A Report is a specific type of DataStoreFile and are used to communicate details of
@mpkocher
mpkocher / Example.scala
Last active October 2, 2019 15:00
akka-http Uri Example (Ammonite output)
@ import akka.http.scaladsl.model.Uri
import akka.http.scaladsl.model.Uri
@ val u = Uri("http://smrtlink-bihourly:8081")
u: Uri = Uri("http", Authority(NamedHost("smrtlink-bihourly"), 8081, ""), , None, None)
@ val p1 = Uri.Path("root") / "alpha" / "beta"
p1: Uri.Path = Segment("root", Slash(Segment("alpha", Slash(Segment("beta", )))))
@ val p2 = p1 / "gamma"
@mpkocher
mpkocher / Example.md
Last active October 2, 2019 15:02
TechSupport Manual Submission of Failed Job Example

Manual creation of sending TS

  1. Get Failed Job By Id
  2. Use pbservice to create a TS failed job request
  3. Manually download the TGZ file from the Job UI page or curl
  4. Manulally send TGZ file using `tech-support-uploader'

From SL beta.

@mpkocher
mpkocher / slln.py
Last active December 27, 2017 23:43
Example for extracting SubreadSet Bam files from a SMRT Link Job
#!/usr/bin/env python
import logging
import sys
from pbcommand.services import ServiceAccessLayer as S
from pbcore.io.dataset import SubreadSet
log = logging.getLogger(__name__)
@mpkocher
mpkocher / compute_core_hours.py
Last active December 28, 2017 17:36
Compute Core Hours
#!/usr/bin/env python
import json
import sys
import argparse
import os
import operator
def extract_table_values(dt, column_id):
for column_d in dt['columns']:
@mpkocher
mpkocher / smrtlink-scraper.py
Last active July 10, 2018 23:53
smrtlink-scraper.py
@mpkocher
mpkocher / Readme.md
Last active October 2, 2019 15:06
SMRT Link System and Test Dependencies

SMRT Link Dependencies

DOT Legend

Shape (and Color) Description
RECT DOTTED Third party dependency
OVAL GREEN Build Output
RECT BitBucket Repo
@mpkocher
mpkocher / output_example.txt
Last active June 28, 2017 16:34
pbcommand validation example of commandline arg directory
09:33 $ python /Users/mkocher/repos/pbcommand/extras/validation_argparse_option_example.py log
(pbsmrtpipe_test) ✔ ~/scratch_pad/verify-bugs/SL-1512
09:33 $ python /Users/mkocher/repos/pbcommand/extras/validation_argparse_option_example.py dir-that-does-not-exist
ls: cannot access 'dir-that-does-not-exist': No such file or directory
Traceback (most recent call last):
File "/Users/mkocher/repos/pbcommand/extras/validation_argparse_option_example.py", line 19, in <module>
sys.exit(main(argv=sys.argv[1:]))
File "/Users/mkocher/repos/pbcommand/extras/validation_argparse_option_example.py", line 14, in main
p.parse_args(argv)
File "/Users/mkocher/miniconda2/envs/pbsmrtpipe_test/lib/python2.7/argparse.py", line 1701, in parse_args
@mpkocher
mpkocher / install-zeppelin-r-dep.sh
Created May 4, 2017 18:40
Install the Zeppelin R dependencies for 0.7.1
#!/bin/bash
declare -a packages=("devtools" "knitr" "ggplot2" "mplot" "googleVis" "data.table" "caret" "pRoc" "sqldf" "glmnet")
declare -a ghpackages=("ramnathv/rCharts")
for i in "${packages[$@]}"; do
echo "Attempting to install '${i}'"
R -e "install.packages('${i}', repos = 'http://cran.us.r-project.org')"
done
@mpkocher
mpkocher / hmac_example.py
Created April 26, 2017 04:04
Example HMAC for Eve and SL Auth
import hashlib
import hmac
import math
import datetime
import base64
def to_h(secret, method, segment, t=None):
"""
Example: