Skip to content

Commit 8aeb7a5

Browse files
committed
passing tests
1 parent c2a5626 commit 8aeb7a5

File tree

5 files changed

+290
-289
lines changed

5 files changed

+290
-289
lines changed

mirtop/gff/convert.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ def convert_gff_counts(args):
8181
if extra == "Invalid":
8282
continue
8383
logger.debug("COUNTS::EXTRA:%s" % extra)
84-
cols_variants = [cols_variants] + _expand(extra, True)
85-
#import pdb; pdb.set_trace()
84+
cols_variants = cols_variants + _expand(extra, True)
8685
summary = [UID, Read, mirna, variant] + cols_variants + expression
8786
logger.debug(summary)
8887
all_lines.append(summary)
88+
#import pdb; pdb.set_trace()
8989
df = pd.DataFrame(all_lines, columns = ['UID', 'Read', 'miRNA', 'Variant'] + variant_header + samples)
9090
df = df.drop_duplicates()
9191
df.to_csv(out_file, sep="\t", index=False)

mirtop/gff/stats.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ def _add_missing(df):
107107
# ref_miRNA_mean
108108
category = "ref_miRNA_mean"
109109
if sum(df['category']==category) == 0:
110-
df2 = {'category': category, 'sample': df['sample'].iat[0], 'counts': 0}
111-
df = df.append(df2, ignore_index = True)
110+
df2 = pd.DataFrame({'category': category, 'sample': df['sample'].iat[0], 'counts': 0}, index=[0])
111+
df = pd.concat([df, df2], ignore_index = True)
112112

113113
category = "isomiR_sum"
114114
if sum(df['category']==category) == 0:
115-
df2 = {'category': category, 'sample': df['sample'].iat[0], 'counts': 0}
116-
df = df.append(df2, ignore_index = True)
115+
df2 = pd.DataFrame({'category': category, 'sample': df['sample'].iat[0], 'counts': 0}, index=[0])
116+
df = pd.concat([df, df2], ignore_index = True)
117117

118118
return df
119119

mirtop/mirna/realign.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import re
2-
from Bio.Align import PairwiseAligner
2+
from Bio import pairwise2
33
from Bio.Seq import Seq
44
from collections import defaultdict
55

@@ -94,7 +94,7 @@ def formatGFF(self):
9494
value.append("iso_3p:%s%s" % (direction, size))
9595
if not value:
9696
value = ["NA"]
97-
return ",".join(sorted(list(set(value))))
97+
return ",".join(list(set(value)))
9898

9999
def format(self, sep="\t"):
100100
"""Create tabular line from variant fields."""

0 commit comments

Comments
 (0)