Skip to content

Instantly share code, notes, and snippets.

View mwalzer's full-sized avatar

Mathias Walzer mwalzer

  • EMBL-EBI
  • Cambridge
View GitHub Profile
@mwalzer
mwalzer / textexporter2msstats.R
Last active March 13, 2017 20:52
OpenMS_TextExporter2MSstat
library(ggplot2)
library(dplyr)
library(tidyr)
msstats<- peptides.lfq.tutorial
# Assume cf_charge as PrecursorCharge for all features in one row of TextExporter output
msstats <- msstats %>% rename(PrecursorCharge=charge_cf)
# Drop useless cols
@mwalzer
mwalzer / init-test-pod-only.yaml
Created February 12, 2018 11:08
creates a k8s pod mounting a pvc (must be bound already)
apiVersion: v1
kind: Pod
metadata:
name: init-test-pod-only
spec:
containers:
- name: svn-pod
image: mwalzer/alpine-svn
imagePullPolicy: IfNotPresent
# container will "crash" if no command is present as there is no default entrypoint as e.g. would be in nginx
library(ggplot2)
# ggpie: draws a pie chart.
# give it:
# * `dat`: your dataframe
# * `by` {character}: the name of the fill column (factor)
# * `totals` {character}: the name of the column that tracks
# the time spent per level of `by` (percentages work too).
# returns: a plot object.
#credit http://mathematicalcoffee.blogspot.co.uk/2014/06/ggpie-pie-graphs-in-ggplot2.html
@mwalzer
mwalzer / Dockerfile
Last active May 28, 2018 14:20
windows dockerfile with container for pwiz instructions
FROM microsoft/dotnet-framework:3.5
#FROM microsoft/windowsservercore:10.0.14393.206
#WTF? seems .net 35 is not activated
SHELL ["powershell"]
COPY pwiz c:/pwiz/
COPY 06282014_JLB_UF_Run3.raw c:/temp/06282014_JLB_UF_Run3.raw
# Note: Add .NET + ASP.NET
@mwalzer
mwalzer / minikube.helm.sh
Last active May 4, 2018 13:23
get a minikube environment to play
#hypervisor requirements ...
# --vm-driver=none if docker is installed might be enough
#kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl ~/cloud-stuff/utils/
#minikube
curl -Lo minikube https://github.com/kubernetes/minikube/releases/download/$(curl -s "https://api.github.com/repos/kubernetes/minikube/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')/minikube-linux-amd64 && chmod +x minikube-linux-amd64 && sudo mv minikube-linux-amd64 ~/cloud-stuff/utils/minikube
#launch
@mwalzer
mwalzer / multi_file.json
Created September 20, 2018 14:06
just a draft exploring different representations
#1
"content": {
"_cvRef": "PSI-QC-CV",
"_accession": "QC:301_filespanning",
"_value": "{'filenames':[rawfile001,rawfile002,rawfile003,rawfile004,rawfile005],'MS:1000043':[123,456,789,666,901]}"
},
#2
"content": {
"_cvRef": "PSI-QC-CV",
/**
* Will add events per row from a spreadsheet in a calendar.
*
* Events are expected to start being described from row 'startRow' on,
* having the time in the first column in HH:MM format (full 24h!), the name of the event in
* second column (empty entries will make the row being ignored), and third and fourth column
* values added each as a line in the event description.
*/
function createCalendarEvent() {
var sheet = SpreadsheetApp.getActiveSheet();
import os
from hurry.filesize import size, si
filename = "test.txt"
limit = 1000000
var = "filenames.wiff"
with open(filename, 'w') as out:
for f in range(0,limit):
out.write(var + '\n')
s = os.path.getsize("/tmp/{x}".format(x=filename))
@mwalzer
mwalzer / iptables.sh
Last active June 7, 2019 11:30 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
{ "mzQC": {
"creationDate": "2019-08-15T11:35:23",
"version": "0_0_11",
"runQualities": [
{
"metadata": {
"inputFiles": [
{
"location": "file:///dev/null",
"name": "CPTAC_CompRef_00_iTRAQ_01_2Feb12_Cougar_11-10-09.raw",