Skip to content

Instantly share code, notes, and snippets.

View louismullie's full-sized avatar

L louismullie

View GitHub Profile
@louismullie
louismullie / cell-biology-patterns.md
Last active July 27, 2024 17:45
Cell biology design patterns

Cell Biology Patterns

Summary

Pattern Cellular Biology Use Case
Singleton Cell Nucleus: Only one nucleus controls the cell's activities, maintaining a single source of genetic information.
Factory Method Ribosomes: Produce different proteins based on the mRNA template, acting as a factory for various protein products.
Abstract Factory Cell Differentiation: Stem cells differentiate into various types of specialized cells, each with its own set of organelles and functions.
Builder Protein Synthesis: Step-by-step assembly of proteins from amino acids, following the instructions in mRNA.
-- Function to split the input query and generate all contiguous combinations
CREATE FUNCTION split_to_table(@input_query VARCHAR(MAX))
RETURNS @result TABLE (combination VARCHAR(MAX))
AS
BEGIN
DECLARE @words TABLE (id INT IDENTITY(1,1), word VARCHAR(255))
DECLARE @total_words INT, @i INT, @j INT, @current_combination VARCHAR(MAX)
-- Step 1: Splitting the input string into words
INSERT INTO @words (word)
@louismullie
louismullie / carescape-parser.py
Last active June 15, 2023 20:08
CareScape parser
import re
from struct import iter_unpack
from quopri import decodestring
import magic
import matplotlib.pyplot as plt
import numpy as np
# Constants
UNITS = {
Hey dahani9091 (ChatGPT project)
novo_test = pd.read_csv("test.csv")
novo_test
df_cavity = pd.read_csv('/content/gdrive/MyDrive/Kaggle/cavity_pred_CUSTOM_A.csv', low_memory=False)
df_cavity = df_cavity.rename(columns={'variant': 'mutation_key'})
df_cavity
novo_test2 = novo_test.copy().rename({'protein_sequence': 'mutant_seq', 'seq_id': 'source_df_id'}, axis = 1)
novo_test2['sequence'] = 'VPVNPEPDATSVENVALKTGSGDSQSDPIKADLEVKGQSALPFDVDCWAILCKGAPNVLQRVNEKTKNSNRDRSGANKGPFKDPQKWGIKALPPKNPSWSAQDFKSPEEYAFASSLQGGTNAILAPVNLASQNSQGGVLNGFYSANKVAQFDPSKPQQTKGTWFQITKFTGAAGPYCKALGSNDKSVCDKNKNIAGDWGFDPAKWAYQYDEKNNKFNYVGK'
novo_test2 = novo_test2.apply(find_mut,axis=1)
@louismullie
louismullie / requests.js
Last active March 25, 2021 02:01
coda19-dashboard-requests
// Requête no. 1
{
"header": {},
"body": {
"selectors": [
{
"resource": "Patient",
"filters": [
{ "path": "code",
"operator": "matches",
def auc_roc(y_true, y_pred):
# can be any tensorflow metric
value, update_op = tf.contrib.metrics.streaming_auc(y_pred, y_true)
# find all variables created for this metric
metric_vars = [i for i in tf.local_variables() if 'auc_roc' in i.name.split('/')[1]]
# Add metric variables to GLOBAL_VARIABLES collection.
# They will be initialized for new session.
for v in metric_vars:
tf.add_to_collection(tf.GraphKeys.GLOBAL_VARIABLES, v)
Import libraries (tensorflow backend)
from keras.models import Sequential
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
from keras.preprocessing.image import ImageDataGenerator
import matplotlib.pyplot as plt
import numpy as np
# Lab data
query = "SELECT lab_data.patient_site_uid, lab_name, lab_sample_time, lab_result_value, lab_sample_type from lab_data " + \
" INNER JOIN patient_data ON " + \
" lab_data.patient_site_uid = patient_data.patient_site_uid WHERE " + \
" (lab_data.lab_sample_type = 'venous_blood' OR " + \
" lab_data.lab_sample_type = 'arterial_blood' OR " + \
" lab_data.lab_sample_type = 'unspecified_blood') AND " + \
" lab_data.lab_result_status = 'resulted' " + \
inclusion_flag
@louismullie
louismullie / example.js
Last active July 24, 2020 21:03
Example D3-Node-R stack
const R = require('r-script')
const express = require('express')
const app = module.exports = express()
app.use(app.router)
app.get("/dashboard", function (req, res, next) {
res.send("Some HTML with D3.js code")
})