Mic | 1 Mar 2012 02:40
Picon

[Biopython] samtools does not return correct exit code

Hallo,
Samtools does not return correct the exit code:

import subprocess
import logging
import sys

def run_cmd(args):
        if subprocess.call(args,shell=True) != 0:
                print 'hello'
                logging.error("Error copying sequence file args='%s'" %
str(args))
                return 1
        print 'e', sys.stderr
        print 'o', sys.stdout
        return 0

def runSamtools( cmd ):
    '''run a samtools command'''

    try:
        retcode = subprocess.call(cmd, shell=True)
        print retcode
        if retcode < 0:
            print >>sys.stderr, "Child was terminated by signal", -retcode
    except OSError, e:
        print >>sys.stderr, "Execution failed:", e

print run_cmd("samtools faidx ex1.fa")
print runSamtools("samtools faidx ex1.fa")
(Continue reading)

Mic | 1 Mar 2012 08:50
Picon

[Biopython] coverage calculating from BAM

Hello,
How is it possible to calculate coverage from a BAM file in format eg.
10x coverage?

Thank you in advance.
_______________________________________________
Biopython mailing list  -  Biopython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Mic | 1 Mar 2012 09:14
Picon

[Biopython] Google Summer of Code

Hello,
Is it possible to use PyPy with:
* BioPython
* Pysam
* Matplotlib
* etc

If not than it might be good idea to get a support for it with help of
Google Summer of Code, because PyPy getting faster and faster.

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

Peter Cock | 1 Mar 2012 12:00
Gravatar

Re: [Biopython] samtools does not return correct exit code

On Thu, Mar 1, 2012 at 1:40 AM, Mic <mictadlo <at> gmail.com> wrote:
> Hallo,
> Samtools does not return correct the exit code:
>
> import subprocess
> import logging
> import sys
>
> def run_cmd(args):
>        if subprocess.call(args,shell=True) != 0:
>                print 'hello'
>                logging.error("Error copying sequence file args='%s'" %
> str(args))
>                return 1
>        print 'e', sys.stderr
>        print 'o', sys.stdout
>        return 0
>
>
> def runSamtools( cmd ):
>    '''run a samtools command'''
>
>    try:
>        retcode = subprocess.call(cmd, shell=True)
>        print retcode
>        if retcode < 0:
>            print >>sys.stderr, "Child was terminated by signal", -retcode
>    except OSError, e:
>        print >>sys.stderr, "Execution failed:", e
>
(Continue reading)

Peter Cock | 1 Mar 2012 12:02
Gravatar

Re: [Biopython] coverage calculating from BAM

On Thu, Mar 1, 2012 at 7:50 AM, Mic <mictadlo <at> gmail.com> wrote:
> Hello,
> How is it possible to calculate coverage from a BAM file in format eg.
> 10x coverage?
>
> Thank you in advance.

Normally we'd talk about coverage as it varies along the genome,
perhaps using a sliding window. This is often represented using
a wiggle file or a BigWig file - and there are scripts for computing
these from SAM/BAM alignments.

Are you looking for a single number the entire BAM file?

Peter

P.S. What does this have to do with pysam or Biopython?

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

Peter Cock | 1 Mar 2012 12:11
Gravatar

Re: [Biopython] Google Summer of Code

On Thu, Mar 1, 2012 at 8:14 AM, Mic <mictadlo <at> gmail.com> wrote:
> Hello,
> Is it possible to use PyPy with:
> * BioPython
> * Pysam
> * Matplotlib
> * etc
>
> If not than it might be good idea to get a support for it with help of
> Google Summer of Code, because PyPy getting faster and faster.

Most of Biopython is working under PyPy (ignoring the C extensions,
much like our situation under Jython). This was mentioned in the
release notice for Bioython 1.59 - early adopters may be able to
find other problems that we're not aware of from the unit tests:
http://news.open-bio.org/news/2012/02/biopython-1-59-released/
I doubt there is enough work here alone to make a GSoC project.

I'm not sure about pysam under PyPy - but I would be interested
to know, because here interfacing with the samtools C code is the
essence of pysam. My impression from the PyPy mailing lists
calling external C libraries from PyPy is that this is another area
of active work.

For matplotlib, you would need NumPy under PyPy. That is an
area of active work for the PyPy team who are currently trying
to re-implement a pure-python version of NumPy which they are
calling NumPyPy (originally it was called micronumpy) sufficient
for other libraries using just the Python numpy API to run. A
problem with this is many Python libraries also use the NumPy
(Continue reading)

Mic | 1 Mar 2012 12:56
Picon

Re: [Biopython] samtools does not return correct exit code

Thank you, pysam has similar problems and I posted already a bug report.
http://code.google.com/p/pysam/issues/detail?id=89
http://code.google.com/p/pysam/issues/detail?id=90

I am going to post on samtools mailing list the problem.

Cheers,

On Thu, Mar 1, 2012 at 9:00 PM, Peter Cock <p.j.a.cock <at> googlemail.com>wrote:

> On Thu, Mar 1, 2012 at 1:40 AM, Mic <mictadlo <at> gmail.com> wrote:
> > Hallo,
> > Samtools does not return correct the exit code:
> >
> > import subprocess
> > import logging
> > import sys
> >
> > def run_cmd(args):
> >        if subprocess.call(args,shell=True) != 0:
> >                print 'hello'
> >                logging.error("Error copying sequence file args='%s'" %
> > str(args))
> >                return 1
> >        print 'e', sys.stderr
> >        print 'o', sys.stdout
> >        return 0
> >
> >
> > def runSamtools( cmd ):
(Continue reading)

Mariam Reyad Rizkallah | 2 Mar 2012 14:41
Picon
Gravatar

Re: [Biopython] Bio.Phylo bugs & pain points

Dear Biopython list,

I am facing similar problem with Phylo in the context of your thread. I am
using Biopython 1.58 - Ubuntu 32 bit system. I have created a newick using
phyml command-line and want to visualize it using Bio.Phylo. I read the
newick, draw_ascii and draw_graphiz perfectly but not draw(). I have
networkx, and pylab installed.

my_view_tree = Phylo.read("myseq.phy_phyml_tree.txt", "newick")
Phylo.draw_ascii(my_view_tree)
my_view_tree_xml = my_view_tree.as_phyloxml()
Phylo.draw(my_view_tree_xml, do_show=True, show_confidence=True, axes=None)

*Error:*

Traceback (most recent call last):
  File "itree/itree2/iTree2.py", line 563, in view_tree
    Phylo.draw(my_view_tree_xml, do_show=True, show_confidence=True,
axes=None)
AttributeError: 'module' object has no attribute 'draw'

Thank you.

On Sat, Feb 18, 2012 at 7:11 PM, Eric Talevich <eric.talevich <at> gmail.com>wrote:

> On Sat, Feb 18, 2012 at 11:34 AM, Eric Talevich <eric.talevich <at> gmail.com
> >wrote:
>
> > So -- do the trees drawn by Phylo.draw() look right?
> >
(Continue reading)

Mariam Reyad Rizkallah | 2 Mar 2012 14:48
Picon
Gravatar

[Biopython] Bio.Phylo AttributeError: 'module' object has no attribute 'draw'

>
> Dear Biopython list,
>
> I am facing similar problem with Phylo in the context of your thread. I am
> using Biopython 1.58 - Ubuntu 32 bit system. I have created a newick using
> phyml command-line and want to visualize it using Bio.Phylo. I read the
> newick, draw_ascii and draw_graphiz perfectly but not draw(). I have
> networkx, and pylab installed.
>
> my_view_tree = Phylo.read("myseq.phy_phyml_tree.txt", "newick")
> Phylo.draw_ascii(my_view_tree)
> my_view_tree_xml = my_view_tree.as_phyloxml()
> Phylo.draw(my_view_tree_xml, do_show=True, show_confidence=True, axes=None)
>
> *Error:*
>
> Traceback (most recent call last):
>   File "itree/itree2/iTree2.py", line 563, in view_tree
>     Phylo.draw(my_view_tree_xml, do_show=True, show_confidence=True,
> axes=None)
> AttributeError: 'module' object has no attribute 'draw'
>
>
Thank you.

Mariam
_______________________________________________
Biopython mailing list  -  Biopython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

(Continue reading)

Eric Talevich | 2 Mar 2012 15:53
Picon
Gravatar

Re: [Biopython] Bio.Phylo AttributeError: 'module' object has no attribute 'draw'

On Fri, Mar 2, 2012 at 8:48 AM, Mariam Reyad Rizkallah <mrrizkalla <at> gmail.com
> wrote:

> >
> > Dear Biopython list,
> >
> > I am facing similar problem with Phylo in the context of your thread. I
> am
> > using Biopython 1.58 - Ubuntu 32 bit system. I have created a newick
> using
> > phyml command-line and want to visualize it using Bio.Phylo. I read the
> > newick, draw_ascii and draw_graphiz perfectly but not draw(). I have
> > networkx, and pylab installed.
> >
> > my_view_tree = Phylo.read("myseq.phy_phyml_tree.txt", "newick")
> > Phylo.draw_ascii(my_view_tree)
> > my_view_tree_xml = my_view_tree.as_phyloxml()
> > Phylo.draw(my_view_tree_xml, do_show=True, show_confidence=True,
> axes=None)
> >
> > *Error:*
> >
> > Traceback (most recent call last):
> >   File "itree/itree2/iTree2.py", line 563, in view_tree
> >     Phylo.draw(my_view_tree_xml, do_show=True, show_confidence=True,
> > axes=None)
> > AttributeError: 'module' object has no attribute 'draw'
> >
> >
> Thank you.
(Continue reading)


Gmane