Skip to content

Commit

Permalink
Merge pull request #33 from dpryan79/operator_precedance
Browse files Browse the repository at this point in the history
Fix some compiler warnings and test logic
  • Loading branch information
jpiper committed Mar 24, 2018
2 parents 155c58d + aacffec commit d2c4845
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 10 deletions.
12 changes: 6 additions & 6 deletions pyDNase/footprinting/WellingtonC.h
Expand Up @@ -188,7 +188,7 @@ struct tuple2 * wellington(unsigned int const * const f, unsigned int const * c
unsigned const int xBackward = b_bindingArray[i+halffpround+1];
unsigned const int nBackward = xBackward + rv_fpscores[i-halffpround];

if (xForward > 0 & xBackward > 0)
if (xForward > 0 && xBackward > 0)
{
float const p = (float)shoulder / (shoulder + fp_size);
float const score = bdtrc(xForward - 1, nForward, p) + bdtrc(xBackward - 1, nBackward, p);
Expand Down Expand Up @@ -238,7 +238,7 @@ struct tuple2 * wellington1D(unsigned int const * const f, unsigned int const *
unsigned const int xBackward = b_bindingArray[i+halffpround+1];
unsigned const int nBackward = xBackward + rv_fpscores[i-halffpround];

if (xForward > 0 & xBackward > 0)
if (xForward > 0 && xBackward > 0)
{
float const p = (float)(shoulder*2) / ((shoulder*2) + fp_size);
float const score = bdtrc(xForward + xBackward - 1, nForward + nBackward, p);
Expand Down Expand Up @@ -367,7 +367,7 @@ struct tuple2 * diff_wellington(unsigned int const * const f, unsigned int cons

// float t_score = 0.0;
//
// if (xForwardt > 0 & xBackwardt > 0)
// if (xForwardt > 0 && xBackwardt > 0)
// {
// float const p = (float)shoulder / (shoulder + fp_size);
// t_score = bdtrc(xForwardt - 1, nForwardt, p) + bdtrc(xBackwardt - 1, nBackwardt, p);
Expand Down Expand Up @@ -395,7 +395,7 @@ struct tuple2 * diff_wellington(unsigned int const * const f, unsigned int cons

float prior_score;

if (xForward > 0 & xBackward > 0)
if (xForward > 0 && xBackward > 0)
{
const float p = (float)shoulder / (shoulder + fp_size);
prior_score = bdtrc(xForward - 1, nForward, p) + bdtrc(xBackward - 1, nBackward, p);
Expand All @@ -417,7 +417,7 @@ struct tuple2 * diff_wellington(unsigned int const * const f, unsigned int cons
unsigned const int nForward = slice(t_f2,0,shoulder + fp_size);
unsigned const int xBackward = slice(t_r2,shoulder + fp_size,shoulder + shoulder + fp_size);
unsigned const int nBackward = slice(t_r2,shoulder,shoulder + shoulder + fp_size);
if (xForward > 0 & xBackward > 0)
if (xForward > 0 && xBackward > 0)
{
float const p = (float)shoulder / (shoulder + fp_size);
bootstrap_score[i] = bdtrc(xForward - 1, nForward, p) + bdtrc(xBackward - 1, nBackward, p);
Expand Down Expand Up @@ -448,4 +448,4 @@ struct tuple2 * diff_wellington(unsigned int const * const f, unsigned int cons
retarr->fpscores = scores;
retarr->mles = mle;
return retarr;
}
}
1 change: 1 addition & 0 deletions pyDNase/scripts/dnase_average_profile.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import argparse
import pyDNase
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions pyDNase/scripts/dnase_bias_estimator.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import os, argparse, tempfile, operator, pickle
from collections import defaultdict
import pybedtools, pysam
Expand Down
1 change: 1 addition & 0 deletions pyDNase/scripts/dnase_cut_counter.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import argparse
import pyDNase
from clint.textui import progress, puts
Expand Down
1 change: 1 addition & 0 deletions pyDNase/scripts/dnase_ddhs_scorer.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import argparse
import pyDNase
import math
Expand Down
1 change: 1 addition & 0 deletions pyDNase/scripts/dnase_fos_scorer.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import argparse
import pyDNase
from clint.textui import progress
Expand Down
3 changes: 2 additions & 1 deletion pyDNase/scripts/dnase_pretty_picture.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
__author__ = "Jason Piper"

"""
Expand Down Expand Up @@ -134,4 +135,4 @@

plt.tight_layout()
plt.savefig(args.output)
#plt.show()
#plt.show()
1 change: 1 addition & 0 deletions pyDNase/scripts/dnase_to_JSON.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import argparse, pyDNase
from clint.textui import puts, progress
parser = argparse.ArgumentParser(description='Writes a JSON file of DNase I cuts for regions from a BED file')
Expand Down
3 changes: 2 additions & 1 deletion pyDNase/scripts/dnase_to_javatreeview.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import argparse, pyDNase, csv, random
import numpy as np
from clint.textui import puts, progress
Expand Down Expand Up @@ -80,4 +81,4 @@ def normalise_cuts(cuts):

newarray = np.subtract(cuts["+"], cuts["-"])

outfile.writerow(["NULL","NULL",i.chromosome + ":" + str(i.startbp) + ":" + str(i.endbp)] + newarray.tolist())
outfile.writerow(["NULL","NULL",i.chromosome + ":" + str(i.startbp) + ":" + str(i.endbp)] + newarray.tolist())
3 changes: 2 additions & 1 deletion pyDNase/scripts/dnase_wig_tracks.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import argparse
from clint.textui import progress, puts
import pyDNase
Expand Down Expand Up @@ -38,4 +39,4 @@
print(-i, file=bwigout)

fwigout.close()
bwigout.close()
bwigout.close()
1 change: 1 addition & 0 deletions pyDNase/scripts/wellington_bootstrap.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import pyDNase, pyDNase.footprinting
import numpy as np
from clint.textui import progress
Expand Down
1 change: 1 addition & 0 deletions pyDNase/scripts/wellington_footprints.py
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import multiprocessing as mp
import argparse, os
from clint.textui import progress, puts_err
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -26,6 +26,7 @@

install_requires=[
# Not enforcing versions for numpy as it can be a bitch to upgrade
"Cython",
"numpy", # Tested on >=1.5.0
"matplotlib < 2.0.0", # mpl > 2.0 only works on py3
"pysam >= 0.8.1",
Expand All @@ -47,4 +48,4 @@
"pyDNase/scripts/dnase_to_JSON.py",
"pyDNase/scripts/dnase_bias_estimator.py"],
test_suite="test",
)
)

0 comments on commit d2c4845

Please sign in to comment.