Note the APIs are still in flux. WIP.
PacBio library for common utils, models, and tools to interface with pbsmrtpipe workflow engine.
import spray.http.HttpMethods._ | |
import spray.http.{HttpResponse, HttpMethod, HttpMethods, AllOrigins} | |
import spray.http.HttpHeaders.{`Access-Control-Allow-Methods`, `Access-Control-Max-Age`, `Access-Control-Allow-Headers`, `Access-Control-Allow-Origin`} | |
import spray.routing._ | |
import spray.routing.directives.BasicDirectives | |
/** | |
* Forked from | |
* | |
* https://gist.github.com/joseraya/176821d856b43b1cfe19 |
from pbcore.io import FastaReader, BamReader | |
def to_records(reader_klass, transform_func, file_name): | |
with reader_klass(file_name) as r: | |
for record in r: | |
yield transform_func(record) | |
def bam_record_to_fasta_record(b_record): | |
# fill me in here | |
return b_record |
"""Simple CLI dev app for testing""" | |
import logging | |
import sys | |
from pbsystem.common.cmdline.core2 import (get_default_parser, | |
pacbio_args_or_contract_runner, | |
add_resolved_tool_contract_option) | |
from pbsystem.common.utils import setup_log | |
from pbsystem.common.validators import validate_file |
// This is all write by hand and probably has typos. | |
// The general idea is to show how it composes and how other | |
// system that extend the core services can choose which implementations | |
// of the coreservice DAOs to use | |
trait CoreServiceDaos { | |
val logDao: LogDao | |
val healthDao: HealthDao | |
} | |
import json | |
import logging | |
from pbcommand.models import TaskTypes, FileTypes, get_default_contract_parser | |
log = logging.getLogger(__name__) | |
TOOL_ID = "pbcommand.tools.dev_mixed_app" | |
__version__ = "0.2.0" |
from pbcommand.models import get_default_contract_parser, TaskTypes, ResourceTypes, FileTypes | |
from pbcommand.validators import validate_file | |
def get_pbparser(): | |
driver_exe = "my-exe" | |
p = get_default_contract_parser("pbexample.tasks.my_tool", "My Tool Desc", "0.1.0", driver_exe, TaskTypes.LOCAL, 1, ()) | |
return p | |
def add_common(p): | |
p.add_input_file_type(FileTypes.DS_BAM, "algn_ds", "Alignment DataSet", "Alignment Set Desc") |
library(methods) | |
#' @export | |
ExampleRegistry <- setRefClass("ExampleRegistry", fields=list(namespace="character", driver="character", rtcRunners="list", toolContracts="list")) | |
registerFunc <- function(r, funcId, func) { | |
r$rtcRunners[[funcId]] <- func | |
return(r) | |
} |
Note the APIs are still in flux. WIP.
PacBio library for common utils, models, and tools to interface with pbsmrtpipe workflow engine.
import os | |
import re | |
import abc | |
import logging | |
import h5py | |
import json | |
import collections | |
import gzip | |
from tarfile import TarFile | |
from xml.etree.ElementTree import ElementTree |
class InValidMetricError(Exception): | |
pass | |
class TestReportMetric(TestBase): | |
REPORT_ID = "" | |
DEFAULT_VALUES = {} | |
# this will be populated via metaclass or @monkey_metrics model | |
RULES = [] | |
def _apply_rules(self, rules): |