Skip to content

Instantly share code, notes, and snippets.

View MatteoLacki's full-sized avatar
💭
devel inside

Matteo MatteoLacki

💭
devel inside
  • Universitätsmedizin Mainz
  • Mainz
  • 07:22 (UTC +02:00)
View GitHub Profile
@MatteoLacki
MatteoLacki / imputations.R
Created December 7, 2023 12:59
test_downcentric_whatever.R
library("impute")
# simulating a matrix
peptideCnt = 1000
runsCnt = 6
expressions = matrix(
data=rnorm(peptideCnt*runsCnt, mean=1000, sd=400),
nrow=peptideCnt,
ncol=runsCnt
@MatteoLacki
MatteoLacki / results.sage.for.ms2rescore.tsv
Created November 16, 2023 11:47
results.sage.for.ms2rescore.tsv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 50 columns, instead of 24. in line 1.
peptide proteins num_proteins filename scannr precursor_id frame_id rank label expmass calcmass charge peptide_len missed_cleavages isotope_error precursor_ppm precursor_signed_ppm fragment_ppm fragment_signed_ppm hyperscore delta_next delta_best ion_mobility rt aligned_rt predicted_rt delta_rt_model matched_peaks longest_b longest_y longest_y_pct matched_intensity_pct scored_candidates poisson sage_discriminant_score posterior_error spectrum_q peptide_q protein_q ms1_intensity ms2_intensity longest_b_exp_mz longest_y_exp_mz longest_b_calc_mz longest_y_calc_mz matched_b_exp_mz matched_y_exp_mz matched_b_calc_mz matched_y_calc_mz MS1_ClusterID
HLHFTLVK sp|P00489|PYGM_RABIT;sp|P06737|PYGL_HUMAN;sp|P11216|PYGB_HUMAN;sp|P11217|PYGM_HUMAN 4 mz_recalibrated@xgboost.mgf "_.1796.1796.2 File:""G8027.d"", NativeID:""merged=8630 frame=8631 scanStart=794 scanEnd=821"", IonMobility:""0.7284""" 0 0 1 1 994.57874 993.576 3 8 0 1.00335 0.60733896 -0.60733896 0.365797 0.17182219 27.22087946471433 4.391146980615357 0.0 0.0 989
import numpy as np
# holy settings
K = 100
# static sequences
sequences = [
list(
# vim /etc/dnf/dnf.conf
# # speed optimizations
# fastestmirror=True
# max_parallel_downloads=10
# keepcache=True
sudo dnf install vim alacritty i3 byobu arandr flameshot arandr
sudo dnf copr enable kallepm/tuxedo-keyboard
sudo dnf install tuxedo-keyboard
sudo dnf install kallepm/tuxedo-control-center
"""
A single thread function to get the total amount of time spent being insured.
"""
def get_time_being_insured(intervals) -> float:
"""Get the time being insured"""
events = []
for start, end in intervals:
"""All this is meant to work only on Windows."""
import os
from pathlib import Path
import subprocess
import sys
import time
import hashlib
import argparse
import logging
install.packages(c('data.table','IsoSpecR','ggplot2','ggthemes'))
library(data.table)
library(IsoSpecR)
library(ggplot2)
library(ggthemes)
isoDist = function(mol, P=.99, ...) as.data.table(IsoSpecify(molecule=mol, P, showCounts=1,...))
marginal = function(mol, cutoff, space=0) isoDist(mol, cutoff, algo=3)[order(prob, decreasing=TRUE)][,rprob:=prob/prob[1]][,R:=cumsum(rprob) + (0:(nrow(.SD)-1))*space][,L:=R-rprob ]
# hello Ute, long time no see.
library(LFQBench2)
library(data.table)
library(readxl)
library(stringr)
library(rstatix)
library(readr)
# reading in the report
R = read_wide_report('2019-107_115 Renauld remeasure_user designed 20200306-122426_quantification_report_UD_sent.xlsx',
skip=1, sheet="TOP3 quantification")
@MatteoLacki
MatteoLacki / ohelahela.R
Created March 4, 2020 14:26
Running OHeLa500 Benchmark
# Comparing different executions of the same isoquant projects
# install.packages("igraph")
library(LFQBench2)
library(stringr)
library(igraph)
library(purrr)
is.error <- function(x) inherits(x, "try-error")
dp = "/mnt/ms/symphony/HELA_BENCHMARK/2020_02_18/REPEAT_WITH_SETTINGS_OF_TeslaS/"
comps = list.files(dp)
C1526H2425N439O435S15
C508H799N129O167S4
C732H1196N204O243S4
C1093H1729N301O327S19
C560H905N175O145S4
C286H477N99O65S2
C2333H3644N608O630S26
C1907H2967N507O481S14
C145H272N64O28S3
C2114H3535N663O561S15