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

Add the phenotype module #755

Closed

Conversation

mgalardini
Copy link
Contributor

Sorry, to have a cleaner history and avoid any mistake I preferred doing a new PR.

mgalardini and others added 30 commits January 20, 2016 18:14
Provides access to PlateRecord and WellRecord objects
PM data can be read from csv or JSON files
PM data can be written to JSON files
Three sigmoid functions are used
This approach needs scipy, a warning is raised if it's missing
An initial guess of the curve parameters are added: without
this, the sigmoid function fitting was incorrect in most
of the cases.
This reverts commit 28a0c3f.

The wrong file has been modified in the previous commit
Including more PEP8 changes
@codecov-io
Copy link

Current coverage is 78.77%

Merging #755 into master will increase coverage by +0.09% as of 4af4773

@@            master    #755   diff @@
======================================
  Files          315     318     +3
  Stmts        46600   47232   +632
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit          36666   37209   +543
  Partial          0       0       
- Missed        9934   10023    +89

Review entire Coverage Diff as of 4af4773

Powered by Codecov. Updated on successful CI builds.

@@ -390,6 +390,7 @@ def is_Numpy_installed():
'Bio.Affy',
'Bio.Cluster',
'Bio.KDTree',
'Bio.phenotype'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally that would have included a trailing comma, so that next time an entry is added to the list it is a one line change. But there's no real need to change it now.

@peterjc
Copy link
Member

peterjc commented Jan 21, 2016

Your code includes a lot of doctest style examples (formatted with >>>), which is great. Ideally we would include these in the test suite (by adding the modules to the numpy-dependent doctest list inside run_tests.py).

Is this something you've tried?

Unfortunately making doctests testable examples can be a lot more work due to things like this and cross-platform differences, and sometimes we have to make slightly less friendly examples - or use deliberately tiny example files (e.g. see the SeqIO docstrings with for loops). That might be needed for some of your for loop examples, e.g.

    >>> for well in plate.get_row('H'):
    ...     print("%s" % well.id)
    H01
    H02
    H03
    ...

Related to this, via test_Tutorial.py we can test the doctest style examples within the LaTeX tutorial. The advantage here is we can exclude problematic lines (e.g. where we only show part of the output) within a larger example. Also @tiagoantao and @vincentdavis have been working on automatically turning the LaTeX into run-able notebooks, see e.g. http://lists.open-bio.org/pipermail/biopython-dev/2015-December/021209.html http://lists.open-bio.org/pipermail/biopython-dev/2015-December/021247.html

Note: I don't think this potential polishing should delay merging the work so far.

>>> subplate = plate.subtract_control()
"""

def __init__(self, plateid, wells=[]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't use a mutable default argument, would wells=() work here? Otherwise use wells=None and set this to a (new) empty list within the __init__ method.

This is one of the problems checked for by the quantifiedcode automated checks, also pylint which calls it W0102, see e.g. http://pylint-messages.wikidot.com/messages:w0102

@mgalardini
Copy link
Contributor Author

Ok, all the suggested changes are in (except for the doctests, which could be added later I guess?)
Thank you very much for your review!

@mgalardini
Copy link
Contributor Author

Hi Peter,

I didn't see any comment on this PR so far; would you like me to inquiry a bit more to see if the changes are sound enough?

Best,
Marco

@mgalardini
Copy link
Contributor Author

Hi Peter,

so far I didn't see any comments regarding this proposed module. Did you see/hear anything?

Best,
Marco

@peterjc
Copy link
Member

peterjc commented Feb 9, 2016

I'm happy, just haven't had time outside of work to apply your changes yet. Sorry.

@mgalardini
Copy link
Contributor Author

Hi,

importing the phenotype module will now trigger a warning.

@peterjc peterjc mentioned this pull request May 19, 2016
@peterjc
Copy link
Member

peterjc commented May 19, 2016

I had some issues rebasing this - which I think was due to using a Mac with its default case insensitive file system (like Windows) and git not coping well with the folder renaming.

I ended up compressing your work into one commit with some minor changes included like removing trailing white space in the tutorial and renaming another module to be lower case (Bio/phenotype/phen_micro.py). This is on a new branch which I'd like you to look at please: #828

@peterjc peterjc closed this May 19, 2016
@mgalardini
Copy link
Contributor Author

Thanks, will have a look right now

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

Successfully merging this pull request may close these issues.

None yet

3 participants