summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNilesh Patra <nilesh@debian.org>2022-05-29 11:23:21 +0530
committerNilesh Patra <nilesh@debian.org>2022-05-29 11:23:21 +0530
commit96ba217d0da6c00a5cc706fe27385c994464c095 (patch)
tree352d887e94920f41f0a31625018eb426a9b436d5
parent12537e29c0c59516d61ab36261af49841b5a7a1b (diff)
parenta3cd2ea9096f04e221cabff43b591229cd959293 (diff)
Update upstream source from tag 'upstream/0.4.25'
Update to upstream version '0.4.25' with Debian dir ef38550465f3cf1d76cf99637c633405deac509c
-rw-r--r--HISTORY.md4
-rw-r--r--mirtop/gff/stats.py17
-rw-r--r--setup.py2
3 files changed, 22 insertions, 1 deletions
diff --git a/HISTORY.md b/HISTORY.md
index a695984..b52dfbc 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,3 +1,7 @@
+0.4.25
+
+* [fix outliers samples](https://github.com/nf-core/smrnaseq/issues/137). When there is no identification of reference sequences or isomirs, the multiqc module will fails because it won't find the expected keys. Adding 0 when is the case.
+
0.4.24
* [fix bad](https://github.com/miRTop/mirtop/issues/64) annotation when 5 or more T/A at the end of the sequence by @DrHogart
diff --git a/mirtop/gff/stats.py b/mirtop/gff/stats.py
index ad3e7fe..d1d3c94 100644
--- a/mirtop/gff/stats.py
+++ b/mirtop/gff/stats.py
@@ -103,6 +103,20 @@ def _classify(srna_type, attr, samples):
return lines
+def _add_missing(df):
+ # ref_miRNA_mean
+ category = "ref_miRNA_mean"
+ if sum(df['category']==category) == 0:
+ df2 = {'category': category, 'sample': df['sample'].iat[0], 'counts': 0}
+ df = df.append(df2, ignore_index = True)
+
+ category = "isomiR_sum"
+ if sum(df['category']==category) == 0:
+ df2 = {'category': category, 'sample': df['sample'].iat[0], 'counts': 0}
+ df = df.append(df2, ignore_index = True)
+
+ return df
+
def _summary(lines):
"""
Summarize long table according to thresholds
@@ -113,10 +127,13 @@ def _summary(lines):
df.counts = df.counts.astype(int)
df_sum = df.groupby(['category', 'sample'], as_index=False).sum()
df_sum['category'] = ["%s_sum" % r for r in df_sum['category']]
+ df_sum = _add_missing(df_sum)
df_count = df.groupby(['category', 'sample'], as_index=False).count()
df_count['category'] = ["%s_count" % r for r in df_count['category']]
+ df_count = _add_missing(df_count)
df_mean = df.groupby(['category', 'sample'], as_index=False).mean()
df_mean['category'] = ["%s_mean" % r for r in df_mean['category']]
+ df_mean = _add_missing(df_mean)
df = pd.concat([df_sum, df_count, df_mean])
return df
diff --git a/setup.py b/setup.py
index 7ee2b42..596a3e3 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@
import os
from setuptools import setup, find_packages
-version = '0.4.24'
+version = '0.4.25'
url = 'http://github.com/mirtop/mirtop'