BioSAK 1.79.2__tar.gz → 1.80.0__tar.gz

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.
Files changed (154) hide show
  1. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/KEGG.py +21 -15
  2. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/VERSION +4 -1
  3. BioSAK-1.80.0/BioSAK/add_desc.py +79 -0
  4. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/iTOL.py +1 -1
  5. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK.egg-info/PKG-INFO +2 -2
  6. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK.egg-info/SOURCES.txt +1 -0
  7. {BioSAK-1.79.2 → BioSAK-1.80.0}/PKG-INFO +2 -2
  8. {BioSAK-1.79.2 → BioSAK-1.80.0}/bin/BioSAK +13 -3
  9. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/BLCA_op_parser.py +0 -0
  10. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/BioSAK_config.py +0 -0
  11. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/COG2020.py +0 -0
  12. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/COG_boxplot_last1row.R +0 -0
  13. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/COG_boxplot_last2row.R +0 -0
  14. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/CheckM.py +0 -0
  15. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/ConvertMSA.py +0 -0
  16. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/DnaFeaturesViewer.py +0 -0
  17. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/FastaSplitler_by_num.py +0 -0
  18. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/FastaSplitler_by_size.py +0 -0
  19. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/GTDB_for_BLCA.py +0 -0
  20. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/Gene2Ctg.py +0 -0
  21. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/KEGG_boxplot_last1row.R +0 -0
  22. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/KEGG_get_eukaryotic_kos.py +0 -0
  23. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/KeepRemovingTmp.py +0 -0
  24. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/MeanMappingDepth.py +0 -0
  25. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/MetaBiosample.py +0 -0
  26. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/MetaCHIP_phylo.hmm +0 -0
  27. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/MetaCyc_reactions_with_ec.txt +0 -0
  28. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/NetEnzymes.py +0 -0
  29. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/Newick_tree_plotter.py +0 -0
  30. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/OneLineAln.py +0 -0
  31. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/Prodigal.py +0 -0
  32. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/Reads_simulator.py +0 -0
  33. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/RunGraphMB.py +0 -0
  34. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/SILVA_for_BLCA.py +0 -0
  35. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/SankeyTaxon.py +0 -0
  36. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/SliceMSA.py +0 -0
  37. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/SubsampleLongReads.py +0 -0
  38. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/Tax4Fun2IndOTU.py +0 -0
  39. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/VisBlastOp.py +0 -0
  40. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/VisGeneFlk.py +0 -0
  41. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/__init__.py +0 -0
  42. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/arCOG.py +0 -0
  43. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/bam2reads.py +0 -0
  44. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/boxplot.py +0 -0
  45. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/boxplot_last1row.R +0 -0
  46. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/boxplot_matrix_COG.py +0 -0
  47. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/boxplot_matrix_COG_backup.py +0 -0
  48. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/boxplot_matrix_KEGG.py +0 -0
  49. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/boxplot_matrix_dbCAN.py +0 -0
  50. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/cat_fa.py +0 -0
  51. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/cdd2cog.pl +0 -0
  52. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/checkm_marker.py +0 -0
  53. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/compare_trees.R +0 -0
  54. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/compare_trees.py +0 -0
  55. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/cross_link_seqs.py +0 -0
  56. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/dbCAN.py +0 -0
  57. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/download_GenBank_genome_subset_prokaryotes_csv.py +0 -0
  58. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/dwnld_sra_reads.py +0 -0
  59. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/enrich.py +0 -0
  60. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/exe_cmds.py +0 -0
  61. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/ezaai2mat.py +0 -0
  62. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/fa2id.py +0 -0
  63. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/fa2phy.py +0 -0
  64. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/fa2tree.py +0 -0
  65. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/format_converter.py +0 -0
  66. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/format_leaf_name.py +0 -0
  67. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/fq2fa.py +0 -0
  68. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/gbk2faa.py +0 -0
  69. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/gbk2ffn.py +0 -0
  70. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/gbk2fna.py +0 -0
  71. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/gbk_to_ffn_faa.py +0 -0
  72. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_EC_from_ko_stats_D.py +0 -0
  73. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_GTDB_taxon_gnm.py +0 -0
  74. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_MAG_reads_long.py +0 -0
  75. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_Pfam_hmms.py +0 -0
  76. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_SCG_tree.py +0 -0
  77. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_TopHits_taxonomy.py +0 -0
  78. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_aa_composition.py +0 -0
  79. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_bin_abundance copy.py +0 -0
  80. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_data_matrix.py +0 -0
  81. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_gc.py +0 -0
  82. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_gene_depth.py +0 -0
  83. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_genome_GTDB.py +0 -0
  84. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_genome_NCBI.py +0 -0
  85. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_genome_NCBI_v1.py +0 -0
  86. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_genome_NCBI_v2.py +0 -0
  87. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_gnm_size.py +0 -0
  88. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_ko_gene_seqs.py +0 -0
  89. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_krona_plot.py +0 -0
  90. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_reads_from_sam.py +0 -0
  91. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_reads_id_in_sam.py +0 -0
  92. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_sankey_plot.R +0 -0
  93. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_top_hit.py +0 -0
  94. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/get_total_length.py +0 -0
  95. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/global_functions.py +0 -0
  96. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/hpc3.py +0 -0
  97. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/js_cmds.py +0 -0
  98. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/js_hpc3.py +0 -0
  99. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/keep_best_hit.py +0 -0
  100. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/ko00001.keg +0 -0
  101. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/koala.py +0 -0
  102. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/label_tree.R +0 -0
  103. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/label_tree.py +0 -0
  104. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/link_16S_MAG.py +0 -0
  105. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/magabund.py +0 -0
  106. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/magabund2.py +0 -0
  107. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/manipulator_fasta.py +0 -0
  108. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/manipulator_msa.py +0 -0
  109. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/manipulator_newick.py +0 -0
  110. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/manipulator_sam.py +0 -0
  111. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/mean_MAG_cov.py +0 -0
  112. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/merge_seq.py +0 -0
  113. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/metaAssembly.py +0 -0
  114. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/metabat2concoct.py +0 -0
  115. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/metabat2maxbin.py +0 -0
  116. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/msa_to_distance_matrix.py +0 -0
  117. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/ncbi_dataset.py +0 -0
  118. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/odp.py +0 -0
  119. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/parse_MetaCyc_RxnDB.py +0 -0
  120. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/parse_mmseqs_tsv.py +0 -0
  121. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/plot_mag.py +0 -0
  122. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/plot_sam_depth.py +0 -0
  123. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/plot_tree.R +0 -0
  124. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/prefix_file.py +0 -0
  125. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/prokka.py +0 -0
  126. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/reads2bam.py +0 -0
  127. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/rename_leaves.py +0 -0
  128. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/rename_reads_for_Reago.py +0 -0
  129. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/rename_seq.py +0 -0
  130. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/rename_seqs.py +0 -0
  131. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/ribbon.py +0 -0
  132. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/sam2bam.py +0 -0
  133. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/sampling_GTDB_gnms.py +0 -0
  134. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/select_seq.py +0 -0
  135. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/sep_reads_by_barcode.py +0 -0
  136. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/slice_seq.py +0 -0
  137. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/split_fasta.py +0 -0
  138. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/split_folder.py +0 -0
  139. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/split_sam.py +0 -0
  140. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/submitHPC.py +0 -0
  141. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/subset_GTDB_meta.py +0 -0
  142. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/subset_df.py +0 -0
  143. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/subset_tree.py +0 -0
  144. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/top_16S_hits.py +0 -0
  145. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/top_hits_in_a_group.py +0 -0
  146. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK/usearch_uc.py +0 -0
  147. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK.egg-info/dependency_links.txt +0 -0
  148. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK.egg-info/requires.txt +0 -0
  149. {BioSAK-1.79.2 → BioSAK-1.80.0}/BioSAK.egg-info/top_level.txt +0 -0
  150. {BioSAK-1.79.2 → BioSAK-1.80.0}/LICENSE +0 -0
  151. {BioSAK-1.79.2 → BioSAK-1.80.0}/MANIFEST.in +0 -0
  152. {BioSAK-1.79.2 → BioSAK-1.80.0}/README.md +0 -0
  153. {BioSAK-1.79.2 → BioSAK-1.80.0}/setup.cfg +0 -0
  154. {BioSAK-1.79.2 → BioSAK-1.80.0}/setup.py +0 -0
@@ -396,7 +396,7 @@ def parse_blast_op_worker(argument_list):
396
396
  AnnotateNorm(stats_file_D_TotalDepth, True, 2, total_depth_for_all_query_genes, stats_file_D_TotalDepth_pct_by_all, 'KO\tTotalDepth_pct_by_all\tDescription\n')
397
397
 
398
398
 
399
- def get_KEGG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, annotation_df_pct, annotation_df_pct_by_all, ABCD_description_dict, with_depth, pct_by_all):
399
+ def get_KEGG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, annotation_df_pct, annotation_df_pct_by_all, ABCD_description_dict, with_depth, pct_by_all, include_ko_fun):
400
400
 
401
401
  annotation_dir_re = '%s/*_KEGG_wd' % annotation_dir
402
402
  annotation_folder_list = [os.path.basename(file_name) for file_name in glob.glob(annotation_dir_re)]
@@ -456,13 +456,17 @@ def get_KEGG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, a
456
456
  ko_with_desc = ko_with_desc.replace(' ', '_')
457
457
  all_identified_ko_list_with_description.append(ko_with_desc)
458
458
 
459
+ list_to_use = all_identified_ko_list
460
+ if include_ko_fun is True:
461
+ list_to_use = all_identified_ko_list_with_description
462
+
459
463
  annotation_df_absolute_num_handle = open(annotation_df_absolute_num, 'w')
460
- annotation_df_absolute_num_handle.write('\t%s\n' % '\t'.join(all_identified_ko_list_with_description))
464
+ annotation_df_absolute_num_handle.write('\t%s\n' % '\t'.join(list_to_use))
461
465
  annotation_df_percentage_handle = open(annotation_df_pct, 'w')
462
- annotation_df_percentage_handle.write('\t%s\n' % '\t'.join(all_identified_ko_list_with_description))
466
+ annotation_df_percentage_handle.write('\t%s\n' % '\t'.join(list_to_use))
463
467
  if pct_by_all is True:
464
468
  annotation_df_percentage_by_all_handle = open(annotation_df_pct_by_all, 'w')
465
- annotation_df_percentage_by_all_handle.write('\t%s\n' % '\t'.join(all_identified_ko_list_with_description))
469
+ annotation_df_percentage_by_all_handle.write('\t%s\n' % '\t'.join(list_to_use))
466
470
  for annotation_folder in sorted(annotation_folder_list):
467
471
 
468
472
  annotation_folder_basename = annotation_folder.split('_KEGG_wd')[0]
@@ -505,15 +509,16 @@ def get_KEGG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, a
505
509
 
506
510
  def Annotation_KEGG(args):
507
511
 
508
- input_file_faa = args['seq_in']
509
- input_file_user_ko = args['ko_in']
510
- file_extension = args['x']
511
- depth_file = args['d']
512
- pct_by_all = args['pct_by_all']
513
- KEGG_DB_folder = args['db_dir']
514
- run_diamond = args['diamond']
515
- num_threads = args['t']
516
- evalue_cutoff = args['evalue']
512
+ input_file_faa = args['seq_in']
513
+ input_file_user_ko = args['ko_in']
514
+ file_extension = args['x']
515
+ depth_file = args['d']
516
+ pct_by_all = args['pct_by_all']
517
+ KEGG_DB_folder = args['db_dir']
518
+ run_diamond = args['diamond']
519
+ num_threads = args['t']
520
+ evalue_cutoff = args['evalue']
521
+ include_desc = args['desc']
517
522
 
518
523
  run_blast = None
519
524
  if (input_file_faa is not None) and (input_file_user_ko is None):
@@ -769,7 +774,7 @@ def Annotation_KEGG(args):
769
774
 
770
775
  #################### get GeneNumber df and report ####################
771
776
 
772
- get_KEGG_annot_df(output_folder, ko_level, annotation_df_GeneNumber, annotation_df_GeneNumber_pct, annotation_df_GeneNumber_pct_by_all, ABCD_description_dict, with_depth=False, pct_by_all=pct_by_all)
777
+ get_KEGG_annot_df(output_folder, ko_level, annotation_df_GeneNumber, annotation_df_GeneNumber_pct, annotation_df_GeneNumber_pct_by_all, ABCD_description_dict, with_depth=False, pct_by_all=pct_by_all, include_ko_fun=include_desc)
773
778
 
774
779
  print(annotation_df_GeneNumber.split('/')[-1])
775
780
  print(annotation_df_GeneNumber_pct.split('/')[-1])
@@ -779,7 +784,7 @@ def Annotation_KEGG(args):
779
784
  #################### get TotalDepth df and report ####################
780
785
 
781
786
  if depth_file is not None:
782
- get_KEGG_annot_df(output_folder, ko_level, annotation_df_TotalDepth, annotation_df_TotalDepth_pct, annotation_df_TotalDepth_pct_by_all, ABCD_description_dict, with_depth=True, pct_by_all=pct_by_all)
787
+ get_KEGG_annot_df(output_folder, ko_level, annotation_df_TotalDepth, annotation_df_TotalDepth_pct, annotation_df_TotalDepth_pct_by_all, ABCD_description_dict, with_depth=True, pct_by_all=pct_by_all, include_ko_fun=include_desc)
783
788
 
784
789
  print(annotation_df_TotalDepth.split('/')[-1])
785
790
  print(annotation_df_TotalDepth_pct.split('/')[-1])
@@ -803,5 +808,6 @@ if __name__ == "__main__":
803
808
  parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default is NCBI blastp')
804
809
  parser.add_argument('-t', required=False, default=1, type=int, help='number of threads, default: 1')
805
810
  parser.add_argument('-evalue', required=False, default=0.0001, type=float, help='evalue cutoff, default: 0.0001')
811
+ parser.add_argument('-desc', required=False, action='store_true', help='include KO functions in the final dataframe')
806
812
  args = vars(parser.parse_args())
807
813
  Annotation_KEGG(args)
@@ -1,4 +1,7 @@
1
- 1.79.2
1
+ 1.80.0
2
+ - new module added: add_desc
3
+
4
+ 1.79.3
2
5
  - fixed bugs
3
6
 
4
7
  1.79.0
@@ -0,0 +1,79 @@
1
+ import os
2
+ import argparse
3
+
4
+
5
+ add_desc_usage = '''
6
+ ====================== add_desc example commands ======================
7
+
8
+ BioSAK add_desc -i arCOG_df.txt -o arCOG_df_desc.txt -d arCOGdef.tab
9
+ BioSAK add_desc -i KEGG_df.txt -o KEGG_df_desc.txt -d ko00001.keg
10
+
11
+ =======================================================================
12
+ '''
13
+
14
+
15
+ def sep_path_basename_ext(file_in):
16
+
17
+ f_path, file_name = os.path.split(file_in)
18
+ if f_path == '':
19
+ f_path = '.'
20
+ f_base, f_ext = os.path.splitext(file_name)
21
+ return f_path, f_base, f_ext
22
+
23
+
24
+ def add_desc(args):
25
+
26
+ df_in = args['i']
27
+ df_out = args['o']
28
+ db_file = args['d']
29
+
30
+ f_path, f_base, f_ext = sep_path_basename_ext(db_file)
31
+
32
+ # read in cog_des_txt
33
+ description_dict = dict()
34
+ if f_base == 'arCOGdef':
35
+ for each_cog in open(db_file, encoding="ISO-8859-1"):
36
+ each_cog_split = each_cog.strip().split('\t')
37
+ cog_id = each_cog_split[0]
38
+ cog_cate_str = each_cog_split[1]
39
+ cog_desc = each_cog_split[3]
40
+ description_dict[cog_id] = cog_desc
41
+
42
+ elif f_base == 'ko00001':
43
+ description_dict = {}
44
+ for each_line in open(db_file):
45
+ if each_line[0] in ['A', 'B', 'C', 'D']:
46
+ each_line_split = each_line.strip().split(' ')
47
+ if each_line[0] == 'D':
48
+ current_D_id = each_line_split[6]
49
+ current_D_description = ' '.join(each_line_split[7:])
50
+ description_dict[current_D_id] = current_D_description
51
+ else:
52
+ print('Please provide the correct db file, either arCOGdef.tab or ko00001.keg')
53
+ print('Program exited!')
54
+ exit()
55
+
56
+ df_out_handle = open(df_out, 'w')
57
+ line_index = 0
58
+ for each_line in open(df_in):
59
+ each_line_split = each_line.strip().split('\t')
60
+ if line_index == 0:
61
+ list_with_desc = ['']
62
+ for each_id in each_line_split:
63
+ list_with_desc.append('%s__%s' % (each_id, description_dict[each_id]))
64
+ df_out_handle.write('\t'.join(list_with_desc) + '\n')
65
+ else:
66
+ df_out_handle.write(each_line)
67
+ line_index += 1
68
+ df_out_handle.close()
69
+
70
+
71
+ if __name__ == '__main__':
72
+
73
+ add_desc_parser = argparse.ArgumentParser()
74
+ add_desc_parser.add_argument('-i', required=True, help='input file ')
75
+ add_desc_parser.add_argument('-o', required=True, help='output file')
76
+ add_desc_parser.add_argument('-d', required=True, help='database file')
77
+ args = vars(add_desc_parser.parse_args())
78
+ add_desc(args)
79
+
@@ -10,7 +10,7 @@ iTOL_usage = '''
10
10
 
11
11
  # Example commands
12
12
  BioSAK iTOL -Labels -ll new_Mag_name.txt -o Mag_name_iTOL_Labels.txt
13
- BioSAK iTOL -Binary -lm Binary_matrix.txt -lt Enzyme -cc col_color_txt -o Presence_Absence_iTOL.txt
13
+ BioSAK iTOL -Binary -lm Binary_matrix.txt -lt Enzyme -o Presence_Absence_iTOL.txt
14
14
  BioSAK iTOL -Heatmap -lm MagAbundance.txt -lt Abundance -o Heatmap_abundance.txt
15
15
  BioSAK iTOL -SimpleBar -lv MagSize.txt -scale 0-3-6-9 -lt Size -o SimpleBar_size.txt
16
16
  BioSAK iTOL -ColorStrip -lg MagTaxon.txt -lt Phylum -o ColorStrip_taxon.txt
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: BioSAK
3
- Version: 1.79.2
3
+ Version: 1.80.0
4
4
  Summary: BioSAK
5
5
  Home-page: https://github.com/songweizhi/BioSAK
6
6
  Author: Weizhi Song
@@ -20,4 +20,4 @@ Requires-Dist: beautifulsoup4
20
20
  Requires-Dist: ete3
21
21
  Requires-Dist: statsmodels
22
22
 
23
- BioSAK v1.79.2
23
+ BioSAK v1.80.0
@@ -37,6 +37,7 @@ BioSAK/VERSION
37
37
  BioSAK/VisBlastOp.py
38
38
  BioSAK/VisGeneFlk.py
39
39
  BioSAK/__init__.py
40
+ BioSAK/add_desc.py
40
41
  BioSAK/arCOG.py
41
42
  BioSAK/bam2reads.py
42
43
  BioSAK/boxplot.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: BioSAK
3
- Version: 1.79.2
3
+ Version: 1.80.0
4
4
  Summary: BioSAK
5
5
  Home-page: https://github.com/songweizhi/BioSAK
6
6
  Author: Weizhi Song
@@ -20,4 +20,4 @@ Requires-Dist: beautifulsoup4
20
20
  Requires-Dist: ete3
21
21
  Requires-Dist: statsmodels
22
22
 
23
- BioSAK v1.79.2
23
+ BioSAK v1.80.0
@@ -108,8 +108,9 @@ def print_main_help():
108
108
  cross_link_seqs -> Cross link matched regions between two sequences
109
109
  submitHPC -> A wrapper for submitHPC.sh
110
110
  KeepRemovingTmp -> Keep removing old files in a folder
111
- koala -> separate combined BlastKOALA or GhostKOALA output
111
+ koala -> Separate combined BlastKOALA or GhostKOALA output
112
112
  subset_df -> Subset dataframe
113
+ add_desc -> Add function description to input of the iTOL module
113
114
 
114
115
  1. Phylogenetic tree-related modules have been moved to TreeSAK
115
116
  2. Use "pip3 install --upgrade BioSAK" to get the latest version
@@ -120,8 +121,6 @@ def print_main_help():
120
121
 
121
122
  if __name__ == '__main__':
122
123
 
123
- ########################################################################################### initialize subparsers ############################################################################################
124
-
125
124
  # initialize the options parser
126
125
  parser = argparse.ArgumentParser()
127
126
  subparsers = parser.add_subparsers(help="--", dest='subparser_name')
@@ -176,6 +175,7 @@ if __name__ == '__main__':
176
175
  KEGG_parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default is NCBI blastp')
177
176
  KEGG_parser.add_argument('-t', required=False, default=1, type=int, help='number of threads, default: 1')
178
177
  KEGG_parser.add_argument('-evalue', required=False, default=0.0001, type=float, help='evalue cutoff, default: 0.0001')
178
+ KEGG_parser.add_argument('-desc', required=False, action='store_true', help='include KO functions in the final dataframe')
179
179
  args = vars(parser.parse_args())
180
180
  KEGG.Annotation_KEGG(args)
181
181
 
@@ -929,11 +929,21 @@ if __name__ == '__main__':
929
929
  args = vars(parser.parse_args())
930
930
  subset_df.subset_df(args)
931
931
 
932
+ elif sys.argv[1] == 'add_desc':
933
+ from BioSAK import add_desc
934
+ add_desc_parser = subparsers.add_parser('add_desc', usage=add_desc.add_desc_usage)
935
+ add_desc_parser.add_argument('-i', required=True, help='input file ')
936
+ add_desc_parser.add_argument('-o', required=True, help='output file')
937
+ add_desc_parser.add_argument('-d', required=True, help='database file')
938
+ args = vars(parser.parse_args())
939
+ add_desc.add_desc(args)
940
+
932
941
  else:
933
942
  print('Unrecognized command: %s, program exited' % sys.argv[1])
934
943
  exit()
935
944
 
936
945
 
946
+
937
947
  upload_to_pypi_cmd = '''
938
948
 
939
949
  cd /Users/songweizhi/PycharmProjects/BioSAK
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes