!!!---hivsim.nlogo

来自「NETLOGO」· NLOGO 代码 · 共 1,716 行 · 第 1/5 页

NLOGO
1,716
字号
            <!-- The wrapper table. It contains the three columns. There's a table-less           alternative in the plone_tableless skin layer that you can use if you           prefer layouts that don't use tables. -->      <table id="portal-columns">        <tbody>          <tr>            <!-- start of the left (by default at least) column -->                        <!-- end of the left (by default at least) column -->            <!-- start of main content block -->            <td id="portal-column-content">                              <div id="content" class="">                                    <div class="documentContent" id="region-content">                    <a name="documentContent"></a>                                                                        <h1 class="documentFirstHeading">HIVSIM.nlogo</h1>            <div class="documentActions">    <h5 class="hiddenStructure">Document Actions</h5>    <ul>            <li>            <a href="http://acces.inrp.fr/acces/equipes/dyna/travaux/dynacell%20plone/outils/netlogo/HIVSIM.nlogo/sendto_form">                            <img src="http://acces.inrp.fr/acces/mail_icon.gif"                     alt="Send this page to somebody"                     title="Send this page to somebody"                     height="16" width="16" />            </a>        </li>                <li>            <a href="javascript:this.print();">                            <img src="http://acces.inrp.fr/acces/print_icon.gif"                     alt="Print this page"                     title="Print this page" height="16"                     width="16" />            </a>        </li>        </ul>    </div>            <div class="documentDescription"></div>                        <div class="plain">            <p>globals 
[
  numAbs  ;; the number of antibodies secreted by plasma cells at each time step
  numCyto ;; the number of cytokines produced by effector T helper cells at each time step
  dom-epitope  ;; the dominant viral epitope
  entities ;; the number of all non-viral entities in the simulation
  life_B  ;; half-life of a B cell
  life_Plasma ;; half-life of a plasma cell 
  life_MemB ;; the half-life of a memory B cell
  life_Th  ;; the half-life of a naive T helper cell
  life_MemTh  ;; the half-life of a memory T helper cell
  life_EffTh  ;; the half-life of an effector T helper cell
  life_Tc ;; the half-life of a naive T cytotoxic (Tc) cell
  life_MemTc  ;; the half-life of a memory Tc cell
  life_EffTc  ;; the half-life of an effector Tc cell
  life_Ab  ;; the half-life of an antibody
  life_Cyto  ;; the half-life of a cytokine
  life_Apc  ;; the half-life of an antigen-presenting cell (apc)
  life_Virion ;; the half-life of a virion - an extracellular viral particle
  antibodies 
  cytokines
  plasmacells
  epcells
  infected ;; keeps track of the number of infected cells at any given time during the simulation
  steps
  neutralized ;; keeps track of the total number of virions neutralized by antibodies
  killed ;;  keeps track of the total number of infected cells killed by effector Tc cells
  pdissociation ;; the probability that an APC or, in this case, a follicular denritic cell bound to hiv will dissociate at a given time step
  p_nonspec ;; probability of successful binding in a nonspecific interaction, e.g., APC/Ag
  bystander_thr
  max_sti ;; the number of stimulations needed to render a B cell anergic
  life_anergy ;; the half-life of the anergic state
  mutB ;; the B cell hypermutation rate
  mutV ;; the viral mutation rate
  maxspec ;; the upper bound of the numerical values for the receptors, epitoptes, paratopes, etc, used in the simulation.
]</p><p>breeds 
[
  bCell ;; A B cell - they are a major component of the humoral immune response to hiv. Upon activation, B cells divide and give rise to memory and effector (or plasma) B cells.
  memB ;; memory B cells - these cells become activated upon successful interaction with a previously encountered virion and divide, producing plasma cells and new memory B cells
  plasma ;; plasma cells - these are short-lived cells that continuously secrete antibodies
  thCell ;; t helper (Th) cells - the orchestrators of the immune response to hiv. Upon activation, they divide and give rise to memory and effector Th cells
  memTh ;; memory Th cells - they assist in conferring long-term protection against previously encountered virions. Following successful interaction with such virions, memory Th cells divide and give rise to both effector and memory Th cells
  effTh ;; effector Th cells - they continuously secrete cytokines that activate other components of the immune response, including B cells and Tc cells
  tcCell ;; naive Tc cells - very important in controlling hiv infection. Divide upon activation, by cytokines, to produce effector and memory Tc cells.
  memTc  ;; memory Tc cells - divide upon activation to produce effector and memory Tc cells
  effTc ;; effector Tc cells - they recognize viral peptides complexed to HLA1 molecules of infected cells and secrete substances (e.g., perforin) that can kill these cells
  ab  ;; antibodies - recognize and neutralize cell-free virions, preventing these from infecting target cells in the body
  apc  ;; antigen-presenting cells - bind, nonsepecifically, to cell-free virions and aid in the activation of Th cells
  hiv 
  cyto ;; cytokines
  epCell  ;; epithelial cells
  ara ;; anti-retroviral agents - substances that can bind to and render cell-free virions incapable of replication. The virions can infect target cells but cannot cause these cells to produce new virions.
]</p><p>turtles-own 
[
  stimulated? 
  state 
  infected? 
  halfL ;; half-life
  numDivs 
  sinceInf ;; the number of time steps since the given turtle has been infected. The value of this variable, 
           ;; together with the viral replication rate, is used to calculate the number of viral particles present in a 
           ;; productively infected cell at any given time, post infection
  partner  ;; the virion with which this turtle is complexed, if any
  HLA1/pep
  HLA2/pep
  receptor ;; the numeric value of this cell's receptor
  inf_lethal_load ;; the viral load of the virion with which this cell is infected, if applicable
  inf_lethality ;; the infectivity/lethality of the virion with which this cell is infected, if applicable
  inf_rep_rate  ;; the replication rate of the virion with which this cell is infected, if applicable
  vLoad ;; viral load
]</p><p>patches-own
[
  cytos ;; the number of cytokines on a given patch - used to simulating chemotaxis
  inf ;; the number of infected cells on a given patch - used to simulate chemotaxis
]</p><p>hiv-own 
[
  neutralized? ;; determines if a virion has been neutralized by an antibody
  inactivated? ;; determines if the virion has been inactivated by an anti-retroviral agent - inactivated virions are incapable of replication of replication, following infection of a target cell
  lethality ;; the probability that a virion will infect a cell on contact
  lethal_load ;; the threshold of viral particles that elicits the lysis of an infected cell 
  rep_rate ;; the replication rate of this virion (in an infected cell)
  peptide ;; the numerical value of the viral peptides that is presented on HLA1/peptide and HLA2/peptide complexes
  epitope ;; the numerical value of the epitope of a virion
]
ab-own
[
  paratope
]
ara-own 
[ 
  effect ;; the effectiveness of an anti-retroviral agent
]
apc-own
[
  vRNA
]</p><p>to setup
  ca
  random-seed 250
  initialize-globals
  initialize-turtle-shapes
        create-cells
        initialize-patch-vars
        update-monitors
end</p><p>to initialize-globals
        set life_B 15
        set life_Plasma 5
        set life_MemB 10
        set life_Th 15
        set life_MemTh 10
        set life_EffTh 5
        set life_Tc 15
        set life_MemTc 10
        set life_EffTc 5
        set life_Ab 2
        set life_Cyto 2
        set life_Apc 15
        set life_Virion 1000
        set numAbs 2
        set numCyto 2
        set steps -1
        set neutralized 0
        set killed 0
        set pdissociation 0.001
        set p_nonspec .5
        set bystander_thr 5
        set life_anergy 10
        set mutV 0
        set mutB 0
        set maxspec 3
end</p><p>to initialize-patch-vars
  ask patches
  [
    set pcolor red
    set inf (count turtles-here with [ infected? ])
  ]
end  </p><p>to start
        ask turtles with [ breed != hiv and breed != epCell ] [ without-interruption [ do-interact] ]
        ask turtles with [ infected? and state != "anergic" ] [ do-viral-production ]
        ask turtles [ do-apoptosis ]
        ask ab [ do-ab-neutralization ]
        ask plasma with [ state != "anergic" ] [ do-ab-secretion ]
        ask effTh with [ state != "anergic" ] [ do-cyto-production ]
        ask turtles with [ stimulated? and not infected? and (breed != apc) and state != "anergic"] [ do-cell-division ]
        ask effTc [ do-ctl ]
        ask hiv with [ not neutralized? ] [ do-infection ]
        ask apc with [ state = "stimulated" ] [ do-dissociation ]
        do-resupply
        ask turtles with [ state = "anergic" ] [ remove-anergy ]
        ask turtles with [ breed = hiv or breed = cyto ] [ do-diffuse ]
        update-patch-vars
        ask turtles with [ breed != hiv and breed != cyto and breed != epCell ] [ do-diffuse ]
        ask ara [ do-ART ]
        ask apc [ do-dissociation ]
        if plots [ do-plots ]
        if monitors [ update-monitors ]
        ;;if((count hiv > count turtles with [ breed != hiv ]) or (count epCell < .5 * numEp) or (((count hiv with [ not neutralized? ]) = 0)  and (count turtles with [ infected? ]) = 0 and (count apc with [ vRNA != []]) = 0)    ) [ show "Simulation has reached a pre-configured end point" stop ]
end</p><p>to remove-anergy
  locals [ diff ]
        set diff ((ln 2) * life_anergy)
        if(prob exp (0 - diff)) [ set state "resting" ]
end</p><p>;; this procedure can be used to simulate antibody therapy; simply provide the specificity and number of
;; antibodies you wish to introduce into the simulation. Note that you can use the real-time information about the dominant epitope 
;; to guide you in your choice of specificity and quantity of antobodies to introduce.
to simulate-ABT [specificity number]
  create-custom-ab number
  [
    initialize-turtle-vars
    set paratope specificity    
  ]
  show number + " new antibodies added at time step " + steps
end</p><p>;; this procedure can be used to simulate anti-retriviral therapy; simply provide the specificity, effectiveness, and number of
;; anti-retroviral agents you wish to introduce into the simulation
to simulate-ART [efficacy number]
  create-custom-ara number
  [
    initialize-turtle-vars
    set effect efficacy
  ]
  show number + " new anti-retroviral agents added at time step " + steps
end</p><p>;; this procedure can be used to introduce into the simulation new virions of a particular specificity
to infect [ specificity leth bsize repRate number ]
  create-custom-hiv number
  [
    initialize-turtle-vars
    set receptor specificity
    set epitope specificity
    set lethality leth
    set lethal_load bsize
    set rep_rate repRate    
  ]
  show number + " new virions added at time step " + steps
end</p><p>to update-patch-vars
  ask patches 
  [ 
    set inf (count turtles-here with [ infected? ]) 
    set cytos (count cyto-here) 
  ]
end</p><p>to do-ART
        locals [ other ]
        set other random-one-of hiv in-radius 0.2 with [ not neutralized? ]
        if((other != nobody) and (prob effect)) [ ask other [ die ] ]
end     </p><p>to update-monitors
  ifelse(count hiv > 0) [ set dom-epitope get-dom-epitope ] [ set dom-epitope "------ NONE ------" ]
  set entities (count turtles with [ breed != hiv ])
  set antibodies (count ab)
  set cytokines (count cyto)
  set plasmacells (count plasma)
  set infected get-infected
  set epcells (count epCell)
  set steps (steps + 1)
end</p><p>to-report get-infected
  locals [ diff ]
  set diff 0
  if(not any? turtles with [ infected? ]) [ report "0 / 0" ]
  foreach values-from (turtles with [ infected? ]) [ vLoad ]
  [
    set diff (diff + ?)
  ]
  report (count turtles with [ infected? ]) + " / " + int(diff)
end</p><p>to-report get-dom-epitope
  locals [maximum value mspec aspec]
  set aspec 0
  set maximum 0
  set value 0
  while [ aspec < maxspec ]
  [
    set value count (hiv with [ epitope = aspec ])
    if(value > maximum) 
    [ 
      set maximum value 
      set mspec aspec
    ]
    set aspec (aspec + 1)
  ]
  report mspec + "           |   " + maximum + "       |   " + int((maximum / (max (list 1 count hiv))) * 100) + "%" + "     |   " + count (ab with [ exp(0 - abs(receptor - mspec)) >= .7 ])
end</p><p>to initialize-turtle-shapes
  set-default-shape turtles "cell"
end</p><p>to initialize-turtle-vars
        set infected? false
        set stimulated? false
        set state "resting"
        set numDivs 0
        set receptor random maxspec
        set sinceInf 0
        set partner nobody
        set halfL 1000
        if(breed = hiv) 
        [ 
          set neutralized? false 
          set inactivated? false 
          set color black 
          set peptide random maxspec 
          set epitope peptide 
          set lethality infectivity 
          set lethal_load 24 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?