Skip to content

Instantly share code, notes, and snippets.

View mpkocher's full-sized avatar

M. Kocher mpkocher

View GitHub Profile
@mpkocher
mpkocher / class_style_constants.py
Created December 5, 2013 21:47
Class style constants.
import sys
class FILE_FORMATS(object):
FOFN = "FOFN"
FASTA = "FASTA"
BAS = "BAS"
BAX = "BAX"
PLS = "PLS_H5"
PLX = "PLX_H5"
@mpkocher
mpkocher / filtering_example.xml
Created December 9, 2013 16:57
SMRTpipe RS Filtering workflow XML example
<smrtpipeSettings>
<module name="P_Fetch">
</module>
<module name="P_Filter">
<param name="minLength">
<value>50</value>
</param>
<param name="readScore">
<value>0.75</value>
</param>
@mpkocher
mpkocher / scrape_attributes.py
Created December 10, 2013 02:15
scrape attributes/metrics from job json report files.
import sys
import os
import json
import glob
def scrape_from_report(p):
with open(p, 'r') as f:
s = f.read()
import functools
import sys
def _record_starts_with(a_character, record):
"""Returns Bool"""
return record.startswith(a_character)
def _apply_filter_to_record(my_filter, record):
import os
import abc
import logging
import sys
import functools
import operator
import argparse
import time
import math
@mpkocher
mpkocher / fiter_stats_coroutine.py
Created December 24, 2013 05:26
Coroutine model for running the filter stats report.
"""Filter Stats Report using a Coroutine model"""
import os
import abc
import logging
import sys
import functools
import operator
import argparse
import time
import math
@mpkocher
mpkocher / example_table.py
Last active August 29, 2015 13:55
Example of using pbreports Table and Columns
import sys
import random
from pbreports.model.model import Table, Column
def get_columns():
cs = [Column('person', header="Person Name"),
Column('color', header="Favorite Color"),
Column('pid', header='User id')]
@mpkocher
mpkocher / new_protocols_sketch_idea.xml
Last active August 29, 2015 13:56
New protocol XML sketch idea.
<?xml version="1.0" encoding="UTF-8"?>
<workflow>
<!-- This is similar to the current RS protocol in Portal -->
<protocol id="pbsmrtpipe.protocols.rs_resequencing">
<inputs>
<input><type>MovieFofn</type></input>
<input><type>ReferenceEntry</type></input>
</inputs>
<options>
<option id="pbsmrtpipe.task_modules.filter.my_option">
@mpkocher
mpkocher / utils.py
Created February 6, 2014 01:03
Example logging setup util func with Handlers and Filters
# Basic tests
def setup_log(alog, level=logging.INFO, file_name=None, log_filter=None,
str_formatter='[%(levelname)s] %(asctime)-15s [%(name)s %(funcName)s %(lineno)d] %(message)s'):
"""Core Util to setup log handler
:param alog: a log instance
:param level: (int) Level of logging debug
:param file_name: (str, None) if None, stdout is used, str write to file
:param log_filter: (LogFilter, None)
:param str_formatter: (str) log formatting str
<?xml version="1.0" encoding="UTF-8"?>
<report>
<title>Motifs</title>
<table>
<thead>
<tr>
<th>Mof</th>
<th>Modified Position</th>
<th>Modification Type</th>
<th>% Motifs Detected</th>