Skip to content

Instantly share code, notes, and snippets.

View RichardJActon's full-sized avatar

Richard James Acton RichardJActon

View GitHub Profile
$C3YlTaL7Gnbk9BJ1GvsliiDJqgBW9w1TWKjPdJuZ_jA
@RichardJActon
RichardJActon / proof.md
Last active May 13, 2026 12:27
github_proof

openpgp4fpr:5ee117648462e5a3610c19648e5defcfc3307916

@RichardJActon
RichardJActon / endpoint.json
Last active February 29, 2024 16:58
sheilds.io endpoint badge test
{ "schemaVersion": 1, "label": "🥉 12", "message": "RSSPDC: Software Package", "color": "#E27022", "link": {"left": "https://gitlab.com/HDBI/data-management/checklists/"} }
@RichardJActon
RichardJActon / ggpseudo.txt
Created February 26, 2023 12:17
Elendol peptide / peptidomics graphic modelling
# ggpseudo syntax, ad hoc ggplot like pseudocode language I'm making up
# the data
# 1 column per row, these need to be expanded with repeats / missing
# values to represent the whole graphic
data = table(
# columns
`one or many peptides` = ["Study of one", "peptidomics"],
# peptides / amino acids
@RichardJActon
RichardJActon / cutadapt_report_parser.pm
Created May 15, 2021 10:03
cutadapt report parser
# cutadapt report parser
#######################################
sub reptParser {
my $rept = $_[0];
my %parsedRept;
$rept =~ m/
(?<head> [\S\s]* ===\sSummary\s===) \n+
Total \s read \s pairs \s processed \: \s+
(?<totalReadPairs>[\d,]+) \n \s+
@RichardJActon
RichardJActon / legendGen.R
Created February 25, 2020 20:45
A function to generate colour legends
#' legendGen
#' A function to generate colour legends
#' @param z.range a numeric vector of length 2
#' @param col a list with elements names low, mid and high with character vectors of length 1 containing colour names DEFAULT \code{list(low = 'lightgrey', mid = 'purple', high='green')}
#' @param nbins the number of bins in which to split the colours DEFAULT 20
#' @param nticks the number of axis ticks to display on the legend DEFAULT 5, setting to NA yeild just high and low tags
#' @param smooth boolean should the colour gadient be interpolated or left discrete? DEFAULT FALSE
#' @param title the title of the legend
#' @param tickFormatFunc a function to format the axis ticks e.g \code{function(x) {sprintf("%.e",x)}}
#' @param draw draw the function directly or return a grob for use in larger plots DEFAULT TRUE
@RichardJActon
RichardJActon / add lin and karnani cord tissue reference
Created February 5, 2019 13:25
add lin and karnani cord tissue reference
# NB setwd to meffil/data-raw
library(devtools)
library(meffil)
library(minfi)
library(FlowSorted.CordTissueAndBlood.EPIC)
assign("reference.globals", new.env(), envir=environment())
load.env <- function(filename, env) {
if (file.exists(filename))
@RichardJActon
RichardJActon / createAnnotationPackage.rn6.R
Created February 4, 2019 15:26
Create RnBeads reference for the rn6 build of the rat genome (Not currently working...)
########################################################################################################################
## createAnnotationPackage.rn6.R
## created: 2019-02-04
## creator: Richard J. Acton
## ---------------------------------------------------------------------------------------------------------------------
## Annotation package creation for rn6.
########################################################################################################################
## F U N C T I O N S ###################################################################################################
@RichardJActon
RichardJActon / RtoUpSetWeb.R
Last active November 30, 2018 16:42
Take data in R (Named lists or data.frames with binary set membership data) and make the files needed to view them the web implementation of UpSet: https://github.com/VCG/upset
# Libs
library(UpSetR)
library(jsonlite)
# Functions
# from: https://github.com/hms-dbmi/UpSetR/issues/85#issuecomment-327900647
fromListNamed <- function (input) {
# Same as original fromList()...
elements <- unique(unlist(input))