Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions jupyter_notebooks/createModel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"outputs": [],
"source": [
"# Antimony model name and information text\n",
"fileModel = open('SPARCED.txt','w') # file name\n",
"fileModelName = 'SPARCED.txt'\n",
"fileModel = open(fileModelName,'w') # file name\n",
"fileModel.write(\"# PanCancer Model by Birtwistle Lab \\n\") # some explanation\n",
"fileModel.write(\"model SPARCED()\\n\") # model name"
]
Expand Down Expand Up @@ -199,7 +200,7 @@
"outputs": [],
"source": [
"# Write species and assign compartments\n",
"species_sheet = np.array([np.array(line.strip().split(\"\\t\")) for line in open('Species.txt', encoding='latin-1')])"
"species_sheet = np.array([np.array(line.strip().split(\"\\t\")) for line in open(fileSpecies, encoding='latin-1')])"
]
},
{
Expand Down Expand Up @@ -253,10 +254,10 @@
"fileModel.write(\"\\n\\n # Reactions:\\n\") # Antimony Reactions module title\n",
"\n",
"#reads in file from excel and gets rid of first row and column (they're data labels)\n",
"stoic_sheet = np.array([np.array(line.strip().split(\"\\t\")) for line in open('StoicMat.txt')])\n",
"stoic_sheet = np.array([np.array(line.strip().split(\"\\t\")) for line in open(fileStoic)])\n",
"\n",
"#creates associated ratelaw data list\n",
"ratelaw_sheet = np.array([np.array(line.strip().split(\"\\t\")) for line in open('Ratelaws.txt')])\n",
"ratelaw_sheet = np.array([np.array(line.strip().split(\"\\t\")) for line in open(fileRatelaws)])\n",
"ratelaw_data = np.array([line[1:] for line in ratelaw_sheet[1:]])\n",
"\n",
"#gets first column minus blank space at the beginning, adds to stoic data list\n",
Expand Down Expand Up @@ -501,13 +502,13 @@
"outputs": [],
"source": [
"# load model and convert to SBML\n",
"if loadFile(\"SPARCED.txt\") == 1:\n",
"if loadFile(fileModelName) == 1:\n",
" print(\"Success loading antimony file\")\n",
"else:\n",
" print(\"Failed to load antimony file\")\n",
" exit(1)\n",
"\n",
"if writeSBMLFile(\"SPARCED.xml\",\"SPARCED\") == 1:\n",
"if writeSBMLFile(sbml_file,\"SPARCED\") == 1:\n",
" print(\"Success converting antimony to SBML\")\n",
"else:\n",
" print(\"Failure converting antimony to SBML\")\n",
Expand Down