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 support for the MEME psp format #4430

Merged
merged 6 commits into from Aug 17, 2017

Conversation

Projects
None yet
7 participants
@gregvonkuster
Copy link
Contributor

commented Aug 15, 2017

Ping @bgruening - this is in preparation for the tool you requested - http://meme-suite.org/doc/psp-gen.html

@galaxybot galaxybot added the triage label Aug 15, 2017

@galaxybot galaxybot added this to the 17.09 milestone Aug 15, 2017

@@ -269,6 +269,7 @@
<datatype extension="obo" type="galaxy.datatypes.text:Obo" mimetype="text/html" display_in_upload="true" />
<datatype extension="owl" type="galaxy.datatypes.xml:Owl" mimetype="text/html" display_in_upload="true" />
<datatype extension="png" type="galaxy.datatypes.images:Png" mimetype="image/png"/>
<datatype extension="psp" type="galaxy.datatypes.sequence:Psp" display_in_upload="true" description="The MEME Position Specific Priors (PSP) format includes the name of the sequence for which a prior distribution corresponds." description_url="http://meme-suite.org/doc/psp-format.html">

This comment has been minimized.

Copy link
@jmchilton

jmchilton Aug 16, 2017

Member

Need to close the datatype tag here.

@bgruening bgruening added area/datatypes and removed triage labels Aug 16, 2017

@bgruening
Copy link
Member

left a comment

Thanks @gregvonkuster!

@@ -8,6 +8,7 @@
import re
import string
import sys
from __builtin__ import False

This comment has been minimized.

Copy link
@bgruening

bgruening Aug 16, 2017

Member

Why is this needed?

This comment has been minimized.

Copy link
@gregvonkuster

gregvonkuster Aug 16, 2017

Author Contributor

Not sure - I didn't add it. I just changed the import order so that flake8 would be happy.

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Aug 16, 2017

Member

But that import doesn't appear anywhere else.


class Psp(Sequence):
"""Class representing MEME Position Specific Priors"""
file_ext = "psp"

This comment has been minimized.

Copy link
@bgruening

bgruening Aug 16, 2017

Member

Should we call it meme_psp and the class MemePsp?

return False
return True
try:
fh = open(filename)

This comment has been minimized.

Copy link
@bgruening

bgruening Aug 16, 2017

Member

can we use with open(filename) as fh:

# The line must not be blank, nor start with '>'
line = fh.readline().strip()
if line == '' or line.startswith( '>' ):
break

This comment has been minimized.

Copy link
@bgruening

bgruening Aug 16, 2017

Member

return False?

line = fh.readline().strip()
if line:
if not floats_verified(line):
break

This comment has been minimized.

Copy link
@bgruening

bgruening Aug 16, 2017

Member

return False

return True
try:
fh = open(filename)
while True:

This comment has been minimized.

Copy link
@bgruening

bgruening Aug 16, 2017

Member

We should not iterate through the entire file, maybe the top 100 lines?

@@ -691,6 +692,7 @@
<sniffer type="galaxy.datatypes.triples:Jsonld"/>
<sniffer type="galaxy.datatypes.sequence:Maf"/>
<sniffer type="galaxy.datatypes.sequence:Lav"/>
<sniffer type="galaxy.datatypes.sequence:Psp"/>

This comment has been minimized.

Copy link
@martenson

martenson Aug 16, 2017

Member

should this read MemePsp too?

gregvonkuster and others added some commits Aug 16, 2017

@bgruening
Copy link
Member

left a comment

Thanks Greg!

@dannon

This comment has been minimized.

Copy link
Member

commented Aug 17, 2017

Failing tests are unrelated to this.

@dannon dannon merged commit cca1f9e into galaxyproject:dev Aug 17, 2017

5 of 6 checks passed

api test Build finished. 281 tests run, 0 skipped, 4 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 153 tests run, 0 skipped, 0 failed.
Details
integration test Build finished. 44 tests run, 0 skipped, 0 failed.
Details
lgtm analysis: JavaScript No alert changes
Details
toolshed test Build finished. 579 tests run, 0 skipped, 0 failed.
Details
@dannon

This comment has been minimized.

Copy link
Member

commented Aug 17, 2017

Just realized the merge here will break our very new (overnight) lint guidelines, will open up a subsequent PR to fix the styling.

try:
num_lines = 0
with open(filename) as fh:
line = fh.readline()

This comment has been minimized.

Copy link
@jmchilton

jmchilton Aug 17, 2017

Member

Please limit these readlines in future - this will use an unbounded amount of memory on certain inputs.

@gregvonkuster gregvonkuster deleted the gregvonkuster:psp_format branch Jun 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.