mgnify-pipelines-toolkit 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mgnify-pipelines-toolkit might be problematic. Click here for more details.
- mgnify_pipelines_toolkit/analysis/amplicon/make_asv_count_table.py +24 -14
- {mgnify_pipelines_toolkit-0.1.3.dist-info → mgnify_pipelines_toolkit-0.1.4.dist-info}/METADATA +1 -1
- {mgnify_pipelines_toolkit-0.1.3.dist-info → mgnify_pipelines_toolkit-0.1.4.dist-info}/RECORD +7 -7
- {mgnify_pipelines_toolkit-0.1.3.dist-info → mgnify_pipelines_toolkit-0.1.4.dist-info}/WHEEL +1 -1
- {mgnify_pipelines_toolkit-0.1.3.dist-info → mgnify_pipelines_toolkit-0.1.4.dist-info}/LICENSE +0 -0
- {mgnify_pipelines_toolkit-0.1.3.dist-info → mgnify_pipelines_toolkit-0.1.4.dist-info}/entry_points.txt +0 -0
- {mgnify_pipelines_toolkit-0.1.3.dist-info → mgnify_pipelines_toolkit-0.1.4.dist-info}/top_level.txt +0 -0
|
@@ -223,6 +223,25 @@ def make_tax_assignment_dict_pr2(taxa_df, asv_dict):
|
|
|
223
223
|
|
|
224
224
|
return tax_assignment_dict
|
|
225
225
|
|
|
226
|
+
def generate_asv_count_dict(asv_dict):
|
|
227
|
+
|
|
228
|
+
res_dict = defaultdict(list)
|
|
229
|
+
|
|
230
|
+
for asv_id, count in asv_dict.items():
|
|
231
|
+
|
|
232
|
+
if count == 0:
|
|
233
|
+
continue
|
|
234
|
+
|
|
235
|
+
res_dict['asv'].append(asv_id)
|
|
236
|
+
res_dict['count'].append(count)
|
|
237
|
+
|
|
238
|
+
res_df = pd.DataFrame.from_dict(res_dict)
|
|
239
|
+
res_df = res_df.sort_values(by='asv', ascending=True)
|
|
240
|
+
res_df = res_df.sort_values(by='count', ascending=False)
|
|
241
|
+
|
|
242
|
+
return res_df
|
|
243
|
+
|
|
244
|
+
|
|
226
245
|
def main():
|
|
227
246
|
_TAXA, _FWD, _REV, _AMP, _HEADERS, _SAMPLE = parse_args()
|
|
228
247
|
|
|
@@ -250,23 +269,12 @@ def main():
|
|
|
250
269
|
for line_fwd in fwd_fr:
|
|
251
270
|
counter += 1
|
|
252
271
|
line_fwd = line_fwd.strip()
|
|
253
|
-
fwd_asvs = line_fwd.split(",")
|
|
254
272
|
|
|
255
|
-
if
|
|
256
|
-
|
|
257
|
-
rev_asvs = line_rev.split(",")
|
|
258
|
-
asv_intersection = list(set(fwd_asvs).intersection(rev_asvs))
|
|
259
|
-
|
|
260
|
-
if len(asv_intersection) == 0:
|
|
261
|
-
continue
|
|
262
|
-
|
|
263
|
-
if len(asv_intersection) == 1 and asv_intersection[0] == "0":
|
|
264
|
-
continue
|
|
265
|
-
else:
|
|
266
|
-
asv_intersection = fwd_asvs
|
|
273
|
+
if line_fwd == '0':
|
|
274
|
+
continue
|
|
267
275
|
|
|
268
276
|
if headers[counter] in amp_reads:
|
|
269
|
-
asv_dict[f"seq_{
|
|
277
|
+
asv_dict[f"seq_{line_fwd}"] += 1
|
|
270
278
|
|
|
271
279
|
fwd_fr.close()
|
|
272
280
|
if paired_end:
|
|
@@ -285,6 +293,8 @@ def main():
|
|
|
285
293
|
for tax_assignment, count in tax_assignment_dict.items():
|
|
286
294
|
fw.write(f"{count}\t{tax_assignment}\n")
|
|
287
295
|
|
|
296
|
+
asv_count_df = generate_asv_count_dict(asv_dict)
|
|
297
|
+
asv_count_df.to_csv(f'./{_SAMPLE}_{amp_region}_asv_read_counts.tsv', sep='\t', index=False)
|
|
288
298
|
|
|
289
299
|
if __name__ == "__main__":
|
|
290
300
|
main()
|
{mgnify_pipelines_toolkit-0.1.3.dist-info → mgnify_pipelines_toolkit-0.1.4.dist-info}/RECORD
RENAMED
|
@@ -6,7 +6,7 @@ mgnify_pipelines_toolkit/analysis/amplicon/assess_inflection_point_mcp.py,sha256
|
|
|
6
6
|
mgnify_pipelines_toolkit/analysis/amplicon/assess_mcp_proportions.py,sha256=BCzLlfvRqiPC-YwzET901f_d0anYt1zpf5y0iOCQnvs,5191
|
|
7
7
|
mgnify_pipelines_toolkit/analysis/amplicon/classify_var_regions.py,sha256=89LKH4rvqRydAEGvfaWqIClcitJ1Vbu7b5d4FApzGp4,18392
|
|
8
8
|
mgnify_pipelines_toolkit/analysis/amplicon/find_mcp_inflection_points.py,sha256=5emeZjk8891IgyL5ygVcr8wMP-hGEJoEs2rcBbseWj0,3536
|
|
9
|
-
mgnify_pipelines_toolkit/analysis/amplicon/make_asv_count_table.py,sha256
|
|
9
|
+
mgnify_pipelines_toolkit/analysis/amplicon/make_asv_count_table.py,sha256=-Kh9KlEuWWFAWUaNjkCxl-L3IdEMURLM3UKb2Tf81CM,8605
|
|
10
10
|
mgnify_pipelines_toolkit/analysis/amplicon/mapseq_to_asv_table.py,sha256=lWVIhDxfsTuDzWjjUlMGx3RL7iD_Yy8m9Ppc9wjfCFg,4765
|
|
11
11
|
mgnify_pipelines_toolkit/analysis/amplicon/primer_val_classification.py,sha256=F4ALSuH8N-0hHUqPCFwHgoAnteb2Ft3tUN9j6DaD5h8,3539
|
|
12
12
|
mgnify_pipelines_toolkit/analysis/amplicon/remove_ambiguous_reads.py,sha256=yhDJFGD3t3TMfUlBCJGwzlK4IjFwm7Bporwp-aIM8uU,3139
|
|
@@ -20,9 +20,9 @@ mgnify_pipelines_toolkit/constants/regex_ambiguous_bases.py,sha256=oVeeCy33bY1WJ
|
|
|
20
20
|
mgnify_pipelines_toolkit/constants/tax_ranks.py,sha256=fP97JvlUdxJBakJ694VresIY8-N3pcU99m7kZ9buKys,867
|
|
21
21
|
mgnify_pipelines_toolkit/constants/thresholds.py,sha256=7J3caCikkEcLdKF4zSR0z8qMQw4-h9aSkSbFbS0LNg4,873
|
|
22
22
|
mgnify_pipelines_toolkit/constants/var_region_coordinates.py,sha256=E8Cd3A1Hj9M95zw9Ut-2x8sE6_PlH6RJJEoikyZUMaQ,1303
|
|
23
|
-
mgnify_pipelines_toolkit-0.1.
|
|
24
|
-
mgnify_pipelines_toolkit-0.1.
|
|
25
|
-
mgnify_pipelines_toolkit-0.1.
|
|
26
|
-
mgnify_pipelines_toolkit-0.1.
|
|
27
|
-
mgnify_pipelines_toolkit-0.1.
|
|
28
|
-
mgnify_pipelines_toolkit-0.1.
|
|
23
|
+
mgnify_pipelines_toolkit-0.1.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
24
|
+
mgnify_pipelines_toolkit-0.1.4.dist-info/METADATA,sha256=1s--DpsRsfAyM2HomRYTAfLF3shjuZ5o0CF-FoceZmw,4950
|
|
25
|
+
mgnify_pipelines_toolkit-0.1.4.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
|
26
|
+
mgnify_pipelines_toolkit-0.1.4.dist-info/entry_points.txt,sha256=K8nqnyAQG9jqHGgIfMIaCIe20u5a0FFCCqJWi4DoD2U,1306
|
|
27
|
+
mgnify_pipelines_toolkit-0.1.4.dist-info/top_level.txt,sha256=xA_wC7C01V3VwuDnqwRM2QYeJJ45WtvF6LVav4tYxuE,25
|
|
28
|
+
mgnify_pipelines_toolkit-0.1.4.dist-info/RECORD,,
|
{mgnify_pipelines_toolkit-0.1.3.dist-info → mgnify_pipelines_toolkit-0.1.4.dist-info}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
{mgnify_pipelines_toolkit-0.1.3.dist-info → mgnify_pipelines_toolkit-0.1.4.dist-info}/top_level.txt
RENAMED
|
File without changes
|