GithubHelp home page GithubHelp logo

harmslab / gpseer Goto Github PK

View Code? Open in Web Editor NEW
5.0 7.0 3.0 1.61 MB

A tool to predict missing data in sparsely sampled genotype-phenotype maps

Home Page: https://gpseer.readthedocs.io

Python 100.00%
epistasis genotype-phenotype-map evolution prediction statistics python

gpseer's People

Contributors

harmsm avatar zsailer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpseer's Issues

binarize() TypeError when running Cross-validate with a low threshold

Hello!

While running through the GPseer tutorial, I experienced a bug while running the following command with the raw pfcrt data:

gpseer cross-validate pfcrt-raw-data.csv --spline_order 2 --spline_smoothness 100000 --threshold 5 --output_root linear_spline2_threshold5 --n_samples 1000

Output:

[GPSeer] Reading data from pfcrt-raw-data.csv...
[GPSeer] └──> Done reading data.
[GPSeer] Fitting all data data...
Traceback (most recent call last):
  File "/home/john/anaconda3/envs/gptest2/bin/gpseer", line 8, in <module>
    sys.exit(entrypoint())
  File "/home/john/anaconda3/envs/gptest2/lib/python3.8/site-packages/gpseer/main.py", line 180, in entrypoint
    run(parser)
  File "/home/john/anaconda3/envs/gptest2/lib/python3.8/site-packages/gpseer/main.py", line 174, in run
    main(logger, **kwargs)
  File "/home/john/anaconda3/envs/gptest2/lib/python3.8/site-packages/gpseer/cross_validate.py", line 131, in main
    full_model.fit()
  File "/home/john/.local/lib/python3.8/site-packages/epistasis/models/pipeline.py", line 49, in fit
    gpm = model.fit_transform(X=X, y=y)
  File "/home/john/.local/lib/python3.8/site-packages/epistasis/models/classifiers/base.py", line 52, in fit_transform
    self.fit(X=X, y=y, **kwargs)
  File "/home/john/.local/lib/python3.8/site-packages/epistasis/models/utils.py", line 52, in inner
    return method(self, **kws)
  File "/home/john/.local/lib/python3.8/site-packages/epistasis/models/classifiers/logistic.py", line 63, in fit
    self._fit_classifier(X=X, y=y)
  File "/home/john/.local/lib/python3.8/site-packages/epistasis/models/classifiers/base.py", line 44, in _fit_classifier
    y = binarize(y.reshape(1, -1), self.threshold)[0]
TypeError: binarize() takes 1 positional argument but 2 were given

A collaborator, Jamie Robertson has been in contact with @Zsailer on this bug. This is what Zach had to say:

The issue arises when trying to fit a dataset that doesn't have data points on both sides of the "activity threshold". For example, if the threshold is set too low, it may be unlikely that you detect any data points below that value and the model won't have enough information to perform a valid fit. I see a couple issues with our software—1) we should raise a more helpful error message when this happens and 2) we should probably skip this "threshold" fitting when cross-validating since it's inevitable that a sample dataset will be drawn that doesn't demonstrate a clear threshold. In the meantime, increasing your value for the threshold should help alleviate the issue when cross validating.

I've tried rerunning the command with thresholds from -5 to 130 at increments of 5, and all thresholds return the same error, which is not what I would expect as these values span from the minimum to the maximum values of the phenotypes in the pfcrt data.
The command works fine when the threshold argument is not specified.

Thanks for any help, and please let me know if there is more information I can provide

doc updates

Put io.html after basic example, but before full-interface

basic.html

  • note that the software automatically infers what genotypes are missing from the input file
  • link to io.html for the predictions.csv and scores.csv files

io.html

  • update the required inputs (stdeviations and n_replicates are now optional)
  • better docs on genotypes.txt (not csv?)
  • missing genotypes.txt
  • describe what the input columns are; sentence each
  • describe the columns of the output files; one sentence each
  • big question: what the heck is the 'score' in scores.csv?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.