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

SES method of bamCompare broken #405

Closed
robertamezquita opened this issue Aug 16, 2016 · 3 comments
Closed

SES method of bamCompare broken #405

robertamezquita opened this issue Aug 16, 2016 · 3 comments

Comments

@robertamezquita
Copy link

It seems like there's a small error in running bamCompare..seems to be an issue with the SES method being invoked, as it works with the readCounts method.

bamCompare \                                                                                       
    -b1 $BAM1 \                                                                                                                        
    -b2 $INPUT1 \                                                                                                                      
    --outFileName bamComp/K27Ac_MP_1.bw \                                                                                              
    --scaleFactorsMethod=SES \                                                                                                         
    --sampleLength=1000 \                                                                                                              
    --numberOfSamples=200000 \                                                                                                         
    --ratio=first \                                                                                                                    
    --binSize=10 \                                                                                                                     
    --smoothLength=30 \                                                                                                                
    --numberOfProcessors=8

Traceback (most recent call last):
  File "/home/ra364/.local/bin/bamCompare", line 7, in <module>
    main()
  File "/home/ra364/.local/lib/python2.7/site-packages/deeptools/bamCompare.py", line 309, in main
    scale_factors = get_scale_factors(args)
  File "/home/ra364/.local/lib/python2.7/site-packages/deeptools/bamCompare.py", line 199, in get_scale_factors
    mapped_reads = [bam1.mapped, bam2.mapped]
UnboundLocalError: local variable 'bam1' referenced before assignment

@dpryan79
Copy link
Collaborator

Oops, not sure how we missed that. I guess if you use -v then it works around the issue. That's not ideal, of course, but it'll work until we release a bugfix version.

@dpryan79
Copy link
Collaborator

Actually, can you try deleting line 199 in bamCompare.py and then changing theses lines: https://github.com/fidelram/deepTools/blob/master/deeptools/bamCompare.py#L233-L234

to this:

if mapped_reads is None:
    mapped_reads = get_num_kept_reads(args)

That should fix another issue there as well.

@dpryan79
Copy link
Collaborator

I've patched this in the hotfix/2.3.4 branch. The goal is to release a patched version early next week (it might take a while to get it on pypi and in bioconda, so you might have to install from github).

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

No branches or pull requests

2 participants