Skip to content

RNA alphabet for meme parsing - #867

Closed
zaidurrehman wants to merge 4 commits into
biopython:masterfrom
zaidurrehman:rna-alphabet
Closed

zaidurrehman wants to merge 4 commits into
biopython:masterfrom
zaidurrehman:rna-alphabet

Conversation

@zaidurrehman

Copy link
Copy Markdown
Contributor

The latest meme tool also supports sequences with RNA alphabet. Biopython's meme parsing however only works for DNA alphabet. (Issue #865 )
I have added a few lines to Bio/motifs/meme.py and Bio/motifs/matrix.py which ensure that the parser can also support the RNA alphabet. Though I have not made any changes to the latter file's docstring, which explicitly mentions that some of the methods are solely defined for DNA alphabet.

I am attaching an example motif file with RNA alphabet. My proposed changes can be tested on this file.
meme.txt

@codecov-io

codecov-io commented Jul 3, 2016 •

Copy link
Copy Markdown

Current coverage is 88.77% (diff: 100%)

Merging #867 into master will increase coverage by 8.78%

@@             master       #867   diff @@
==========================================
  Files           312        524     +212   
  Lines         47560     114680   +67120   
  Methods           0          0            
  Messages          0          0            
  Branches          0          0            
==========================================
+ Hits          38043     101803   +63760   
- Misses         9517      12877    +3360   
  Partials          0          0            

Powered by Codecov. Last update ec2fd23...4a7257e

Comment thread Bio/motifs/matrix.py
def reverse_complement(self):
values = {}
if "U" in self.alphabet.letters:
if isinstance(self.alphabet, Alphabet.RNAAlphabet):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We probably don't have to worry about this in Bio.motifs, but this could use this private function in Bio.Alphabet to deal with the messy stuff about gaps etc:

if isinstance(Alphabet._get_base_alphabet(self.alphabet), Alphabet.RNAAlphabet):

@peterjc

peterjc commented Jul 4, 2016

Copy link
Copy Markdown
Member

This looks good. Are you familiar with the unittest framework? https://docs.python.org/2.6/library/unittest.html

Can you add your RNA meme file under Tests/motifs/ and add a test parsing it to Tests/test_motifs.py?

We also need tests in Tests/test_motifs.py using the reverse_complement() method with RNA, DNA etc.

@peterjc

peterjc commented Dec 9, 2016

Copy link
Copy Markdown
Member

If you're not familiar with writing tests, then we'd need to do that as part of merging this contribution.

Are you happy to dual licence your contributions under both the Biopython License Agreement and the BSD 3-Clause License? See #898.

Also, are you happy to be thanked by name in the NEWS and CONTRIB files?

@zaidurrehman

zaidurrehman commented Dec 30, 2016 via email

Copy link
Copy Markdown
Contributor Author

@peterjc

peterjc commented Jan 26, 2017

Copy link
Copy Markdown
Member

@mdehoon and/or @barwil does this look OK to merge?

@peterjc
peterjc requested review from barwil and mdehoon April 4, 2017 10:15
@peterjc

peterjc commented May 29, 2017

Copy link
Copy Markdown
Member

@mdehoon and/or @barwil any objections to merging this?

@j-andrews7

Copy link
Copy Markdown
Contributor

I am planning to fix several issues related to the MEME parser - this was one of them. Can this be merged if there are no issues? I don't want to redo work others have already done.

@peterjc

peterjc commented Oct 24, 2017

Copy link
Copy Markdown
Member

I have no objections, but I would like to have an OK from @mdehoon and/or @barwil as the module's maintainer and original author. There could be implications of this change I am unaware of.

@mdehoon

mdehoon commented Oct 24, 2017

Copy link
Copy Markdown
Contributor

I'm OK with it.

@peterjc

peterjc commented Oct 24, 2017

Copy link
Copy Markdown
Member

Thanks Michiel!

OK, I will look at merging this today (and dealing with the merge conflict).

@peterjc

peterjc commented Oct 24, 2017

Copy link
Copy Markdown
Member

@zaidurrehman do you want to be listed as Zaid ur Rehman (as on your GitHub profile), or Zaid Ur-Rehman (as in your message earlier)?

@zaidurrehman

Copy link
Copy Markdown
Contributor Author

Zaid Ur-Rehman would be better. Thanks

@peterjc

peterjc commented Oct 24, 2017

Copy link
Copy Markdown
Member

Changes applied via #1421, thank you.

@peterjc peterjc closed this Oct 24, 2017
@zaidurrehman
zaidurrehman deleted the rna-alphabet branch October 24, 2017 19:56
peterjc added a commit that referenced this pull request May 16, 2019
Original authors Bartek Wilczynski (CVS username bartek, on GitHub as @barwil)
and Jeff Chang (CVS username jchang, on GitHub as @jefftc) and other contributors
since have agreed:

 - Antony Lee (@anntzer)
   #898 (comment)
 - Ariel Aptekmann (@aralap)
   #1734
 - bartek (@barwil)
   http://mailman.open-bio.org/pipermail/biopython/2018-August/016533.html
 - Bertrand Néron (@bneron)
   #898 (comment)
 - Wibowo Arindrarto (@bow)
   #898 (comment)
 - Christian Brueffer (@cbrueffer)
   #898 (comment)
 - Gert Hulselmans (@ghuls)
   #898 (comment)
 - Jared Andrews (@j-andrews7)
   #898 (comment)
 - Jeff Chang (@jefftc)
   #898 (comment)
 - Michiel de Hoon (@mdehoon)
   #898 (comment)
 - Peter Cock (@peterjc)
   #898 (comment)
 - Zaid Ur-Rehman (@zaidurrehman)
   #867
peterjc added a commit to peterjc/biopython that referenced this pull request Dec 30, 2019
Originally checked in as Bio/Motif/Matrix.py the
original author Michiel de Hoon and contributors
since as tracked by version control have agreed:

 - Adhemar Zerlotini (@azneto)
   biopython#1412 (comment)
 - Andrey Raspopov (@Andrey-Raspopov)
   biopython#2444
 - Brian Osborne (@bosborne)
   biopython#898 (comment)
 - Carlos Pena (@carlosp420)
   biopython#898 (comment)
 - Christian Brueffer (@cbrueffer)
   biopython#898 (comment)
 - Francesco Gastaldello (@Gasta88)
   biopython#1063
 - Ilya Flyamer (@Phlya)
   biopython#2386
 - Matt Ruffalo (@mruffalo)
   biopython#898 (comment)
 - Michiel de Hoon (@mdehoon)
   biopython#898 (comment)
 - @morrme
   biopython#1172 (comment)
 - Nader Morshed (@naderm)
   biopython#898 (comment)
 - Peter Cock (@peterjc)
   biopython#898 (comment)
 - Sefa Kilic (@sefakilic)
   biopython#898 (comment)
 - Sergio Valqui (@svalqui)
   biopython#1749
 - Zaid Ur-Rehman (@zaidurrehman)
   biopython#867
peterjc added a commit that referenced this pull request Jan 1, 2020
Originally checked in as Bio/Motif/Matrix.py the
original author Michiel de Hoon and contributors
since as tracked by version control have agreed:

 - Adhemar Zerlotini (@azneto)
   #1412 (comment)
 - Andrey Raspopov (@Andrey-Raspopov)
   #2444
 - Brian Osborne (@bosborne)
   #898 (comment)
 - Carlos Pena (@carlosp420)
   #898 (comment)
 - Christian Brueffer (@cbrueffer)
   #898 (comment)
 - Francesco Gastaldello (@Gasta88)
   #1063
 - Ilya Flyamer (@Phlya)
   #2386
 - Matt Ruffalo (@mruffalo)
   #898 (comment)
 - Michiel de Hoon (@mdehoon)
   #898 (comment)
 - @morrme
   #1172 (comment)
 - Nader Morshed (@naderm)
   #898 (comment)
 - Peter Cock (@peterjc)
   #898 (comment)
 - Sefa Kilic (@sefakilic)
   #898 (comment)
 - Sergio Valqui (@svalqui)
   #1749
 - Zaid Ur-Rehman (@zaidurrehman)
   #867
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.

5 participants