Skip to content
Snippets Groups Projects
Commit 0bbfd80b authored by Delvigne Frank's avatar Delvigne Frank
Browse files

Upload New File

parent c6955b98
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 2 22:26:53 2023
@author: delvigne
"""
'''
Exercice 3.1
Analysis the adjacency martrix for three different systems
'''
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
'''
System 1: 30 RPAs in series to model a plug-flow reactor
'''
n= 30 # number of CSTRs or RPAs in series
a = np.ones(n)
d1 = np.diag(a)
b = np.ones(n-1)
d2 = np.diag(b,-1)
M2 = d1+d2
plt.spy(M2)
plt.show()
'''
System 2: 100 thermodynamic stages for modelling a S-L extractor
'''
n= 100 # number of extraction stages/thermodynamic equilibrium
a = np.ones(n)
d1 = np.diag(a)
b = np.ones(n-1)
d2 = np.diag(b,-1)
c = np.ones(n-1)
d3 = np.diag(c,1)
M3 = d1+d2+d3
plt.spy(M3)
plt.show()
'''
System 3: 100 proteins for modelling the rpoS response in E. coli
You need the file string_interactions_short_rpoS.xlsx
'''
df = pd.read_excel("string_interactions_short_rpoS.xlsx")
node1 = df['#node1']
node2 = df['node2']
adj_mat = pd.crosstab(df["#node1"], df["node2"], dropna=False)
A = adj_mat.transpose() + adj_mat > 0
plt.spy(A)
plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment