Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulating tumor-colonising bacteria #25

Open
bnwlkr opened this issue Mar 24, 2021 · 9 comments
Open

Simulating tumor-colonising bacteria #25

bnwlkr opened this issue Mar 24, 2021 · 9 comments
Labels

Comments

@bnwlkr
Copy link

bnwlkr commented Mar 24, 2021

Hi Thierry,
I’m a university student at UBC, Vancouver working on the dry lab of UBC’s undegraduate iGEM team. Our project this year aims to use tumor-colonising salmonella to detect the presence of an immune response in a tumor. We’re looking at modelling a 3D tumor and its microenvironment, and this project looks like a really great starting point. We’d like to be able to add to the simulation different intratumoral chemical/nutrient profiles and the growth/motility of bacteria within a tumor. Do you think that is feasible using your tumorcode project? Any guidance would be much appreciated. Thanks!
Ben

P.S. I’ve got tumorcode running on ubuntu, but haven’t got the cells simulated yet. Could you give me any hints on how to get the vbl cell simulation integrated with my installation?

@thierry3000
Copy link
Owner

Hi Ben,
thank you for looking into my work. What you intend to do should be feasible (from theoretical point of view). Indeed I look into similar direction when I was at the project. Meanwhile I switch to a different position and therefore do not actively develop tumorcode or VBL, but I am happy to assist.
I updated the wiki for my tumorcode and VBL repository with some information concerning the combined simulation of tumorcode and VBL. I hope this gives you some directions.
For VBL, you can implement bacteria as different cell type by defining the parameter according to your needs. Probably the most work is to develop some sort of interaction between different cell types (tumorcells and bacteria).

Best, Thierry

@bnwlkr
Copy link
Author

bnwlkr commented Apr 8, 2021

edit:resolved

@bnwlkr
Copy link
Author

bnwlkr commented Apr 11, 2021

Hi Thierry, thanks for the response!
I followed along with the steps outlined in supplementary material to generate a bulk tissue model, but don't seem to able to visualize the actual tumour mass (only the blood vessels show). The steps I followed were:

  1. Generate vessel network: ./submitVesselgeneration -p default -t 8 -w 2000. Succeeded, producing vessels-default-typeI-15x19L130-sample00.h5.
  2. Generate bulk tissue model with vessel network: ./submitBulkTissue defaultconfig_bulktissue vessels−default−typeI−15x19L130−sample00.h5. Succeeded, producing tumBulk-default-typeI-sample00-defaultconfig_bulktissue.h5.
  3. Render the result: submitPovrayRender tumBulk−default−typeI−sample00−defaultconfig bulktissue .h5 out0005 −p ’figure_plos_tumor’. This produced this png:

drawing

What I'm wondering is why this doesn't show the actual tumor tissue as in the paper:
F4 medium

The contents of the bulk tissue hdf5 file looks like this:

Screen Shot 2021-04-11 at 4 31 17 PM

Maybe you can see something is missing from this? Or perhaps I just need to change something in the povray render step?

Thanks,

Ben

@thierry3000
Copy link
Owner

Hi Ben,
thank you for pointing in this direction. I confirm the problem of plotting a bulktissue tumor with the current version of the code. I put some efforts for a quick fix with e04899b, but I could not solve the issue immediately. There is still a problem with the coordinates or scale transformation.

The background: I did not use the visualization with bulk tissue tumor after I implemented the cell type tumors.

If I find the time, I will come back to this issue.

@bnwlkr
Copy link
Author

bnwlkr commented May 20, 2021

Thanks Thierry your effort is much appreciated. I tried manually adjusting the scale of the normalization transform, i.e.:

def calc_centering_normalization_trafo(bbox_xxyyzz):
    wb = bbox_xxyyzz
    wb = wb.reshape((3,2))
    sz = wb[:,1]-wb[:,0]
    center = 0.5*(wb[:,1]+wb[:,0])
    w = 1./max(*sz)
    w *= 1.2         # <--------
    return Transform(center, w)

and that causes the tumor to show up at least:

So it looks like some issue with scaling as you mentioned. Could you help me understand what the 'conc', 'necro', and 'ls' datasets represent? Plots of 'conc' and 'necro' look similar to me, and 'ls' (guessing levelset) is constants. In particular, I'm unsure about the difference between voldata_ls and voldata_cells and how they're being used in addBulkTissueTumor:

voldata_ls    = epv.declareVolumeData(ds_levelset, ld.GetWorldBox())
voldata_cells = epv.declareVolumeData(conc, ld.GetWorldBox())

value_bounds = voldata_cells.value_bounds
style = """
  texture {
    pigment {
      function { %f + %f*%s(x,y,z) }
      color_map {
        [0.0  color <0.3,0,0>]
        [0.5  color <1,0.8, 0.3>]
        [0.8  color <1,1,0.1>]
      }
    }
    finish {
      specular 0.3
    }
  }""" % (value_bounds[0], (value_bounds[1]-value_bounds[0]), voldata_cells.name)
epv.addIsosurface(voldata_ls, 0., lambda : style, None, style)

@thierry3000
Copy link
Owner

Hi Ben,
I am delighted that you made it work and found the right directions. Unfortunately most of the continuum/ level-set stuff was implemented by @DaWelter. Later I added a lot of hacks allowing me to reuse his scripts for the continuum stuff also in the case of the cell based simulations. If I remember correct, the voldata_cells was something like this. In essence the calculations of VBL and Tumorcode first happen on two individual lattices (world coordinates) and then second interact with each other. To reused the plotting scripts for the continuum part, I simple added all the VBL information on top and honestly never went back to check the implementation of the plotting stuff for consistency with the bulktumor stuff. Sorry.
Maybe @DaWelter could comment on the precise naming of "conc", "necro" and "ls" (which I assume also all the time as levelset).

@DaWelter
Copy link
Collaborator

Hello both of you,

It's amazing that this project still attracts interest.

You are right. "ls" means levelset function. As per the nature of the levelset approach the corresponding arrays should be filled with the approximate (signed) distance to the tumor-normal-tissue interface. Up to a certain limit that is.

IIRC conc and voldata_cells might refer to the overall density of cells. I believe things labeled necro refer to the fraction of necrotic tumor cells.

In the first stages of growth the necrotic cell fraction would be zero everywhere. Then a roughly circular necrotic core would develop. So at that point it would look indeed like the conc (or cells?) data because the density in the (circular) tumor would be higher than in normal tissue. The value ranges should be different though.

The code snippet you showed from addBulkTissueTumor generates the iso-surface from the levelset function and color codes it according to voldata_cells, which I'm pretty sure now is the cell density. The continuum model treats the tissue as slightly compressible.

Your change w *= 1.2 # <-------- is puzzeling though. How can a size increase of 20% make the isosurface suddenly appear. Sure you didn't change something else as well?

I hope I could help. Apologies for all the bad code :-< At least the naming could have been better.

On a general note: I think adding chemical concentration fields should not be that hard if they can be described similar to the oxygen concentration by solutions of steady-state diffusion-reaction equations. Then you can take the oxygen field as example. Even as time dependent problem it should be feasible.
Regarding bacteria, I cannot be of much help. It would be beneficial if they can be treated as additional "layer" "on top of" the tissue without mechanical interaction. Tbh. I was struggling to make a multi-phase model with the three interacting phases tumor. Perhaps a particle based approach like @thierry3000 did is better. But beware what he did is very compute and memory intensive. So only small systems were possible.

I wish you good luck @bnwlkr . :-)

Cheers
Michael

@bnwlkr
Copy link
Author

bnwlkr commented Jun 30, 2021

Thank you @DaWelter and @thierry3000 for your helpful feedback. edit:resolved

@thierry3000
Copy link
Owner

thierry3000 commented Jul 5, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants