Skip to content

Avoid __getitem__ speed overhead in motif search - #2361

Closed
peterjc wants to merge 1 commit into
biopython:masterfrom
peterjc:motif_speed
Closed

peterjc wants to merge 1 commit into
biopython:masterfrom
peterjc:motif_speed

Conversation

@peterjc

@peterjc peterjc commented Nov 27, 2019

Copy link
Copy Markdown
Member

This pull request addresses issue #2360

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file, have run flake8 locally, and
    understand that AppVeyor and TravisCI will be used to confirm the Biopython unit
    tests and style checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

Still a work in progress, but wanted to make it easier to discuss - and see the test output.

@peterjc
peterjc requested a review from mdehoon as a code owner November 27, 2019 17:11
@codecov

codecov Bot commented Nov 27, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #2361 into master will decrease coverage by 0.04%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2361      +/-   ##
=========================================
- Coverage   84.95%   84.9%   -0.05%     
=========================================
  Files         323     323              
  Lines       52690   52690              
=========================================
- Hits        44764   44738      -26     
- Misses       7926    7952      +26
Impacted Files Coverage Δ
Bio/motifs/matrix.py 77.22% <57.14%> (-5.24%) ⬇️
Bio/NaiveBayes.py 96.38% <0%> (-3.62%) ⬇️
Bio/PDB/PDBParser.py 88.13% <0%> (-1.7%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7844bca...499643b. Read the comment docs.

@mdehoon mdehoon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that instead of changing _calculate, we should change the search function such that it calls calculate only once (or twice, if the reverse complement is included). See my comment at issue #2360 .

@Phlya

Phlya commented Nov 28, 2019

Copy link
Copy Markdown
Contributor

I think both changes should be implemented - this would speed up the case when one wants to search for a motif in a large number of sequences, while what @mdehoon is suggesting would fix the slow-ness in the case of search in long sequences.

@mdehoon

mdehoon commented Dec 23, 2019

Copy link
Copy Markdown
Contributor

Closing this in favor of #2386

@mdehoon mdehoon closed this Dec 23, 2019
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.

3 participants