Philip Machanick | 1 Apr 01:49 2011
Picon

[Biopython] extending Motif class

I want to add a new scoring function to the Motif class and in true
object-oriented spirit would like to do it by deriving a new class rather
than hacking the existing code.

The general structure of my test program (all in 1 file) is:

from Bio.Motif import Motif

class ScannableMotif(Motif):
    def pwm_score_hit(self,sequence,position):
    ## stuff to compute my new score

from Bio import Motif
def main ():
    for motif in
ScannableMotif.parse(open("/Users/philip/tmp/meme.txt"),"MEME"):
        for i in range(3):
          print
motif.pwm_score_hit("CCTGGGGTCCCATTTCTCTTTTCTCTCCTGGGGTCCC",i)

The two different imports appear to be necessary. I need the first to be
able to use the base class to derive a new one, and without the second when
I use metaclass methods, I get

TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)

The other problem: I can't directly invoke a metaclass method on a derived
instance as above. The snippet below works as expected, but looks like a
kludge to me. Is there a better way of accessing metaclass methods from a
(Continue reading)

Brad Chapman | 1 Apr 02:59 2011

Re: [Biopython] extending Motif class

Philip;

> I want to add a new scoring function to the Motif class and in true
> object-oriented spirit would like to do it by deriving a new class rather
> than hacking the existing code.

The approach you want to take here is to define a function
that takes a motif as an input:

def pwm_score_hit(motif, sequence, position):

instead of trying to inherit from Motif. What happens in 
your example is that you inherit from the Motif class:

> from Bio.Motif import Motif
> 
> class ScannableMotif(Motif):
>     def pwm_score_hit(self,sequence,position):
>     ## stuff to compute my new score

Then you call ScannableMotif as if it were the Motif namespace, when
it is actually a class. The parse function is defined in Bio.Motif
not the Motif class:

> from Bio import Motif
> def main ():
>     for motif in
> ScannableMotif.parse(open("/Users/philip/tmp/meme.txt"),"MEME"):
>         for i in range(3):
>           print
(Continue reading)

Bartek Wilczynski | 1 Apr 03:07 2011

Re: [Biopython] extending Motif class

Hi,

On Fri, Apr 1, 2011 at 1:49 AM, Philip Machanick <philip.machanick <at> gmail.com
> wrote:

> I want to add a new scoring function to the Motif class and in true
> object-oriented spirit would like to do it by deriving a new class rather
> than hacking the existing code.
>
> Well, if you want to keep your code separate from biopython and ba able to
use it with newer versions than maybe yes, but if you think tha your code
code be contributed to biopython and useful for other people, than I'd
consider just contributing via github.

> The general structure of my test program (all in 1 file) is:
>
> from Bio.Motif import Motif
>
> class ScannableMotif(Motif):
>    def pwm_score_hit(self,sequence,position):
>    ## stuff to compute my new score
>
> That's OK, although I suspect something fishy is hidden in your code here.
more later.

> from Bio import Motif
>

you shouldn't need to do that

(Continue reading)

Philip Machanick | 1 Apr 05:21 2011
Picon

Re: [Biopython] extending Motif class

Thanks.

The issue is that parse is not defined in the class but in the module and if
I understand this right, this makes it a metaclass method. More below.

On Fri, Apr 1, 2011 at 11:07 AM, Bartek Wilczynski <bartek <at> rezolwenta.eu.org
> wrote:

> Hi,
>
> On Fri, Apr 1, 2011 at 1:49 AM, Philip Machanick <
> philip.machanick <at> gmail.com> wrote:
>
>> I want to add a new scoring function to the Motif class and in true
>> object-oriented spirit would like to do it by deriving a new class rather
>> than hacking the existing code.
>>
>> Well, if you want to keep your code separate from biopython and ba able to
> use it with newer versions than maybe yes, but if you think tha your code
> code be contributed to biopython and useful for other people, than I'd
> consider just contributing via github.
>
>
>> The general structure of my test program (all in 1 file) is:
>>
>> from Bio.Motif import Motif
>>
>> class ScannableMotif(Motif):
>>    def pwm_score_hit(self,sequence,position):
>>    ## stuff to compute my new score
(Continue reading)

Eric Talevich | 1 Apr 05:53 2011
Picon

Re: [Biopython] [GSoC] Proposal: Mocapy++Biopython

Hi Michele,

On Fri, Mar 25, 2011 at 2:11 AM, Michele <michele.silva <at> gmail.com> wrote:

> Hello everyone,
>
> I'm Michele, a computer scientist and passionate developer who is
> currently enrolled in a biomedicine course. That's why I got in touch with
> the biopython project and have tried its tools for biological computation.
>

In case you haven't heard back from anyone about your proposal yet -- you
certainly sound qualified for this project and I encourage you to start an
application on the main GSoC site (if you haven't already):
http://www.google-melange.com/gsoc/homepage/google/gsoc2011

It's best to get the administrative bits out of the way and at least a stub
of a proposal online early, to ensure you don't get caught by the deadline
next week.

Another good initial step is to sign up on GitHub and fork the Biopython
source tree for yourself:
https://github.com/biopython/biopython
http://biopython.org/wiki/SourceCode

Regarding the experience in biomolecular structure, I'm a beginner. I have
> started studying biomedicine this year and therefore have a lot to learn. I
> know a bit about the PDB format and molecular biology. I'm sure I can count
> on your help to continue learning.
>
(Continue reading)

Justinas V. Daugmaudis | 1 Apr 06:55 2011
Picon

[Biopython] Mocapy++: Google Summer of Code 2011

Dear biopythoners,

My name is Justinas, I am a MSc bioinformatics student.

I have filled out the student application form for the GSoC 2011,
and I would be happy to hear any comments on the points that could
be elucidated.

I would be happy to provide any additional pertinent information and
if source code portfolio could be of any use, I could provide that, too.

Best regards,
J.
_______________________________________________
Biopython mailing list  -  Biopython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Peter Cock | 1 Apr 11:59 2011

Re: [Biopython] Public example FASTQ files (for Tutorial examples)?

On Fri, Mar 25, 2011 at 7:37 AM, Peter Cock <p.j.a.cock <at> googlemail.com> wrote:
> Hi all,
>
> One of the volunteers proof reading the Biopython tutorial
> noticed our links to specific example FASTQ files at the NCBI
> SRA don't work any more. They have withdrawn them from
> the FTP site, although you can still download the files in
> the compressed *.sra format and in in theory convert then
> to FASTQ locally with the NCBI's toolkit (which is cross
> platform).
>
> Another option is to download the FASTQ files via the
> NCBI's webinterface. Unless there is an obvious way to
> do this with a URL that I missed initially, we have a
> complicated situation to describe where the user can
> choose all the reads for an experiment or just the filtered
> set, and also choose to have them pre-trimmed or not.
> Plus for me at least, the HTPP download wasn't as
> robust as the FTP one was.

Brad pointed out we should be able to get the same reads
from the EBI's sequence read archive, the ENA.

I'm looking at that but the first example from the NCBI SRA,
a single 23MB  FASTQ file, which I had thought was single
ended Roche 454 data, :

ftp://ftp.ncbi.nlm.nih.gov/sra/static/SRX003/SRX003639/SRR014849.fastq.gz
[dead link]

(Continue reading)

Brad Chapman | 1 Apr 12:56 2011

Re: [Biopython] Google Summer of Code idea

Albert;

> I am a bioinformatics student and I would like to take part in Google Summer 
> of Code this year.

Thank you for the e-mail and interest in both Biopython and GSoC.

> I have an idea for a project that I could write. It would be a module for 
> synthetic biology, especially BioBrick standard used in iGEM competition 
> (http://ung.igem.org/Main_Page).

This sounds like a useful project. What type of functionality
specifically did you have in mind? Submitting your own project idea
is great and we'll just need more details about what you are
planning to tackle in order to find mentors. There are a couple of
Python libraries on GitHub dealing with BioBricks that might contain
some useful code:

https://github.com/alisue/pybiobrick
https://github.com/abiggerhammer/bbtools

I also have a repository of synthetic biology related code:

https://bitbucket.org/chapmanb/synbio

Thanks again,
Brad
_______________________________________________
Biopython mailing list  -  Biopython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython
(Continue reading)

Peter Cock | 1 Apr 15:57 2011

Re: [Biopython] Public example FASTQ files (for Tutorial examples)?

On Fri, Apr 1, 2011 at 10:59 AM, Peter Cock <p.j.a.cock <at> googlemail.com> wrote:
> On Fri, Mar 25, 2011 at 7:37 AM, Peter Cock <p.j.a.cock <at> googlemail.com> wrote:
>> Hi all,
>>
>> One of the volunteers proof reading the Biopython tutorial
>> noticed our links to specific example FASTQ files at the NCBI
>> SRA don't work any more. They have withdrawn them from
>> the FTP site, although you can still download the files in
>> the compressed *.sra format and in in theory convert then
>> to FASTQ locally with the NCBI's toolkit (which is cross
>> platform).
>>
>> Another option is to download the FASTQ files via the
>> NCBI's webinterface. Unless there is an obvious way to
>> do this with a URL that I missed initially, we have a
>> complicated situation to describe where the user can
>> choose all the reads for an experiment or just the filtered
>> set, and also choose to have them pre-trimmed or not.
>> Plus for me at least, the HTPP download wasn't as
>> robust as the FTP one was.
>
> Brad pointed out we should be able to get the same reads
> from the EBI's sequence read archive, the ENA.
>
> I'm looking at that but the first example from the NCBI SRA,
> a single 23MB  FASTQ file, which I had thought was single
> ended Roche 454 data, :
>
> ftp://ftp.ncbi.nlm.nih.gov/sra/static/SRX003/SRX003639/SRR014849.fastq.gz
> [dead link]
(Continue reading)

Hilmar Lapp | 1 Apr 17:39 2011
Picon

[Biopython] Fwd: Other: Tree class

Would someone mind updating this fellow on what the support in  
Biopython is for parsing trees? I don't have it all in my memory, but  
my recollection is that there is.

	-hilmar

Begin forwarded message:

> From: evoldir <at> evol.biology.mcmaster.ca
> Date: April 1, 2011 1:15:40 AM EDT
> Subject: Other: Tree class
>
>
> Anyone have experience in Python or in writing a tree class. I am
> particularly stuck on how to parse the tree (in newick format) and  
> how to
> join the node class and edge class together. Can anyone help?
>
> Aj
>
> Wasiu Akanni <waakanni13 <at> gmail.com>
>

--

-- 
===========================================================
: Hilmar Lapp -:- Durham, NC -:- hlapp at drycafe dot net :
===========================================================

_______________________________________________
Biopython mailing list  -  Biopython <at> lists.open-bio.org
(Continue reading)


Gmane