Skip to content

Instantly share code, notes, and snippets.

View SamStudio8's full-sized avatar

Sam Nicholls SamStudio8

View GitHub Profile
@SamStudio8
SamStudio8 / acct_parse.py
Last active November 28, 2023 16:12
SGE QACCT Parsing
"""
Provides functions for the purpose of parsing a Sun Grid Engine (SGE)
accounting file for job metadata.
"""
__author__ = "Sam Nicholls <msn@aber.ac.uk>"
__copyright__ = "Copyright (c) Sam Nicholls"
__version__ = "0.0.32"
__maintainer__ = "Sam Nicholls <msn@aber.ac.uk>"
@SamStudio8
SamStudio8 / cascade.py
Last active March 1, 2018 13:41
Cascade
y3 = [86,90,90,68,86,79,79,78,61,62,45,60]
y2 = [81,81,79,79,77,73,55,55,86,84,83,81]
# 8 modules per band
BAND_SIZE = 8
BAND_DELTA = len(y3) - BAND_SIZE
# Extract BAND_SIZE best year 3 modules
y3_sorted = sorted(y3)
band_3 = y3_sorted[-BAND_SIZE:]
@SamStudio8
SamStudio8 / awk
Last active August 29, 2015 14:07
Benchmarking reads over a pair of 42GB FASTQ files (~1.5 billion lines)
# awk 3.1.7
# 1hr 1m
awk '$1 ~ /@/ {++c} END {print c}' $1
# 1hr 1m
awk '/^@/ {c++} END {print c}' $1
# 55m
awk '{if (substr($0,0,1) == "@") { ++c }} END {print c}' $1