Skip to main content

CoVIRA (Consensus by Voting with Iterative Re-weighting based on Agreement)

Project description

CoVIRA

Travis CI status

CoVIRA (Consensus by Voting with Iterative Re-weighting based on Agreement) is a method to identify weights and produce consensus predictions based on a collection of results from predictors for multiple samples. It employs a iterative recalculations of weights based on the weighted "agreement" between the predictors, and allows the calculation of a final prediction as well.

This algorithm was created to help on the integration of results from multiple prediction tools in a reverse vaccinology study where no validation dataset was available for all features been inferred. Therefore, we created a unsupervised way to estimate how accurate each predictor was for that particular case considering that the more the results of a predictor is "consfirmed" by the others, the higher it's accuracy.

Installing

From PyPI

$ pip install covira

From source code

$ git clone https://github.com/fredericokremer/covira
$ cd covira
$ python setup.py build
$ python setup.py install

Using

>>> import pandas as pd
>>> from covira import Covira
>>> df = pd.read_csv('test_data/dataset_1.csv')
>>> predictions = df.drop(['gene'], axis=1).values
>>> predictions                          # each column is represents the prediction from a different tool, while each row is a different sample
array([[1, 0, 0], 
       [0, 1, 0], 
       [1, 1, 0], 
       [1, 0, 0], 
       [1, 0, 0], 
       [1, 0, 0], 
       [1, 0, 0], 
       [1, 0, 1]])
>>> covira = Covira(max_iterations=1000) # max number of iterations in the weight calculation
>>> covira.fit(predictions)              # "fit" = calculates the weights
>>> covira.predict(predictions)          # calculates the consensus prediction
array([0.1875, 0.375 , 0.5625, 0.1875, 0.1875, 0.1875, 0.1875, 0.625 ])
>>> covira.weights                       # weights calculated for each predictor
array([0.1875, 0.375 , 0.4375])

Reference

Grassmann AA, Kremer FS, Dos Santos JC, Souza JD, Pinto LDS, McBride AJA. Discovery of Novel Leptospirosis Vaccine Candidates Using Reverse and Structural Vaccinology. Front Immunol. 2017;8:463. Published 2017 Apr 27. doi:10.3389/fimmu.2017.00463

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

covira-0.1.2-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file covira-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: covira-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for covira-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 12dfed4e44b2e354ebb8d0633da3ce232f6e1884befcb596de49bdc5740086a4
MD5 7a1ffcef33a066065bd9c2724ff54ee1
BLAKE2b-256 db6cb02c4e46e90dbcc0271290bd499d6e0eedb06ec1bc6c80afc82953c0cd1b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page