Skip to content

Commit

Permalink
Plotfingerprint na to nan (#1002)
Browse files Browse the repository at this point in the history
* change "NA" occurences in plotFingerprint.py to proper numpy.NAN

* update expected plotFingerprint output in galaxy from NA to nan
  • Loading branch information
dlaehnemann authored Sep 18, 2020
1 parent ec2a730 commit 57e61f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions deeptools/plotFingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ def getCHANCE(args, idx, mat):
"""
# Get the index of the reference sample
if args.JSDsample not in args.bamfiles:
return ["NA", "NA", "NA"]
return [np.NAN, np.NAN, np.NAN]
refIdx = args.bamfiles.index(args.JSDsample)
if refIdx == idx:
return ["NA", "NA", "NA"]
return [np.NAN, np.NAN, np.NAN]

subMatrix = np.copy(mat[:, [idx, refIdx]])
subMatrix[np.isnan(subMatrix)] = 0
Expand Down Expand Up @@ -271,10 +271,10 @@ def getJSD(args, idx, mat):

# Get the index of the reference sample
if args.JSDsample not in args.bamfiles:
return "NA"
return np.NAN
refIdx = args.bamfiles.index(args.JSDsample)
if refIdx == idx:
return "NA"
return np.NAN

# These will hold the coverage histograms
chip = np.zeros(MAXLEN, dtype=np.int)
Expand Down Expand Up @@ -338,7 +338,7 @@ def signalAndBinDist(x):

if abs(sum(PMFinput) - 1) > 0.01 or abs(sum(PMFchip) - 1) > 0.01:
sys.stderr.write("Warning: At least one PMF integral is significantly different from 1! The JSD will not be returned")
return "NA"
return np.NAN

# Compute the JSD from the PMFs
M = (PMFinput + PMFchip) / 2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Sample AUC Synthetic AUC X-intercept Synthetic X-intercept Elbow Point Synthetic Elbow Point JS Distance Synthetic JS Distance % genome enriched diff. enrichment CHANCE divergence
bowtie2 test1.bam 0.00493632029863651 0.481650684757865 0.984443061605476 1.1531044350267195e-24 0.9849408836341008 0.5232688298112538 NA 0.26900449806812143 NA NA NA
bowtie2 test1.bam 0.00493632029863651 0.481650684757865 0.984443061605476 1.1531044350267195e-24 0.9849408836341008 0.5232688298112538 nan 0.26900449806812143 nan nan nan
bowtie2 test1.bam 0.00493632029863651 0.481650684757865 0.984443061605476 1.1531044350267195e-24 0.9849408836341008 0.5232688298112538 0.0 0.26900449806812143 0 0 0

0 comments on commit 57e61f5

Please sign in to comment.