• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LoLab-VU / pysb / 786
79%

Build:
DEFAULT BRANCH: master
Ran 31 May 2018 07:53PM UTC
Jobs 2
Files 98
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
786

push

travis-ci

web-flow
Filtering for ComponentSets (#340)

`ComponentSet.filter()` can be used to filter a ComponentSet by properties
of its Components - filtering by name, pattern, module name, value, or rule
rate is supported. Some examples:

```python
>>> from pysb.examples.earm_1_0 import model
>>> from pysb.pattern import Name, Pattern, Module, Function
>>> m = model.monomers

# Find parameters exactly equal to 10000:
>>> model.parameters.filter(lambda c: c.value == 1e4) 
ComponentSet([
 Parameter('pC3_0', 10000.0),
 Parameter('pC6_0', 10000.0),
])

# Find rules with a forward rate < 1e-8, using a custom function:
>>> model.rules.filter(lambda c: c.rate_forward.value < 1e-8)
ComponentSet([
 Rule('bind_pC3_Apop', Apop(b=None) + pC3(b=None) | Apop(b=1) %
        pC3(b=1), kf25, kr25),
])

# We can also use some built in predicates for more complex matching
# scenarios, including combining multiple predicates.

# Find rules with a name beginning with "inhibit" that contain cSmac:
>>> model.rules.filter(Name('^inhibit') & Pattern(m.cSmac()))
ComponentSet([
 Rule('inhibit_cSmac_by_XIAP', cSmac(b=None) + XIAP(b=None) |
        cSmac(b=1) % XIAP(b=1), kf28, kr28),
])

# Find rules with any form of Bax (i.e. Bax, aBax, mBax):
>>> model.rules.filter(Pattern(m.Bax) | Pattern(m.aBax) | Pattern(m.MBax))
ComponentSet([
 Rule('bind_Bax_tBid', tBid(b=None) + Bax(b=None) |
      tBid(b=1) % Bax(b=1), kf12, kr12),
 Rule('produce_aBax_via_tBid', tBid(b=1) % Bax(b=1) >>
      tBid(b=None) + aBax(b=None), kc12),
 Rule('transloc_MBax_aBax', aBax(b=None) |
      MBax(b=None), kf13, kr13),
 Rule('inhibit_MBax_by_Bcl2', MBax(b=None) + Bcl2(b=None) |
      MBax(b=1) % Bcl2(b=1), kf14, kr14),
 Rule('dimerize_MBax_to_Bax2', MBax(b=None) + MBax(b=None) |
      Bax2(b=None), kf15, kr15),
 ])

# Count the number of parameter that don't start with kf (note the ~
# negation operator):
>>> len(model.parameters.filter(~Name('^kf')))
60

# Get compone... (continued)

7013 of 8921 relevant lines covered (78.61%)

1.57 hits per line

Jobs
ID Job ID Ran Files Coverage
1 786.1 31 May 2018 07:53PM UTC 0
78.61
Travis Job 786.1
2 786.2 31 May 2018 07:56PM UTC 0
78.32
Travis Job 786.2
Source Files on build 786
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #786
  • d98d2eef on github
  • Prev Build on master (#785)
  • Next Build on master (#787)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc