recallSpots.py bug

2014-06-19
2014-06-19
  • Nick Booher
    Nick Booher
    2014-06-19

    recallSpots.py in PBSuite_14.5.1 gives this error:

    Traceback (most recent call last):
      File "/opt/PBSuite_14.5.13/bin/recallSpots.py", line 27, in <module>
        if spot.tags["label"] == "INS" and filterINSZ(container, bam, spot, args):
    TypeError: filterINSZ() takes exactly 3 arguments (4 given)
    

    Copying stuff over from HSpots.py seems to fix it:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    #!/usr/bin/env python
    
    import sys, logging, argparse
    import pysam
    from pbsuite.honey.HSpots import *
    from pbsuite.utils.setupLogging import setupLogging
    USAGE = "Recall spots in a hon.h5 file"
    
    args = parseArgs(sys.argv[1:], established=True)
    
    setupLogging(args.debug)
    
    f = h5py.File(args.hon,'a')
    bam = pysam.Samfile(args.bam)
    tsp = 0
    makeKernals(args.binsize)
    print "#CHROM\tOUTERSTART\tSTART\tINNERSTART\tINNEREND\tEND\tOUTEREND\tINFO"
    for chrom in f.keys():
        logging.info("Calling %s" % (chrom))
        container = f[chrom]["data"]
        spots = callHotSpots(container, f[chrom].attrs["start"], args)
        logging.info("Filtering INSZ Spots")
        fspot = 0
        for spot in spots:
            spot.chrom = chrom
            #add tags for pval and container stats etc
            spot.offset(f[chrom].attrs["start"])
    
            if spot.tags["label"] == "INS" and filterINSZ(bam, spot, args):
                continue
            if (spot.size < args.sizeMin or spot.size == -1) or spot.size > args.sizeMax:
                continue
            fspot += 1 
            print spot
        tsp += fspot
        logging.info("Found %d spots" % (fspot))
    logging.info("Finished %d spots" % (tsp))
    
     
  • Adam English
    Adam English
    2014-06-19

    Hey Nick,

    Thanks for reporting this. I'll put in a ticket to have recallSpots.py refactored.

    --
    ~/Adam English