Skip to content

Instantly share code, notes, and snippets.

View MatthewRalston's full-sized avatar
😑
maybe webdev, maybe art. idgaf anymore

Matt Ralston MatthewRalston

😑
maybe webdev, maybe art. idgaf anymore
View GitHub Profile
@MatthewRalston
MatthewRalston / example.rb
Created November 16, 2015 17:08
log4r YAML configuration
require 'log4r'
require 'log4r/yamlconfigurator'
include Log4r
ycfg = YamlConfigurator
ycfg["LOGFILE"] = "/home/matt/logs/myapp.log"
ycfg.load_yaml_file("/home/matt/.config/ruby/logger.yaml")
root_logger = Logger['root_logger']
@MatthewRalston
MatthewRalston / log.conf
Created October 28, 2015 21:51
Python logging: configuration file and root_logger setup.
import logging
import logging.config
def get_root_logger(loglevel, logfile=None, log_config="log.conf"):
# Requires 'import logging' and 'import logging.config'
def log_level(loglevel):
case = {"DEBUG": logging.DEBUG,
"INFO": logging.INFO,
"WARNING": logging.WARNING,
@MatthewRalston
MatthewRalston / summarize_fastqc.xml
Created July 15, 2015 21:02
Galaxy tool for summarizing fastqc information
<tool name="Summarize FastQC" id="summarizeFastQCMetrics" version="0.0.1">
<description>summarizes data from FastQC</description>
<command>
#def pairfunc($theList)
#set $left = []
#set $right = []
#for $file1, $file2 in $theList
#$left.append(str($file1))
#$right.append(str($file2))
@MatthewRalston
MatthewRalston / Random_subsample.xml
Last active August 29, 2015 14:25
Galaxy tool for subsampling a fastq file.
<tool name="Random Subsample" id="subsample_fastq" version="0.0.1">
<description>Subsamples a fastq file</description>
<command>
RandomSubFq -w $readsRequested
-i $paired_fastq_files.forward
-i $paired_fastq_files.reverse
-o $paired_list_output.forward
-o $paired_list_output.reverse
</command>