BioSAK 1.95.0__tar.gz → 1.95.2__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 (158) hide show
  1. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/VERSION +3 -3
  2. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/arCOG.py +48 -69
  3. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/PKG-INFO +2 -2
  4. {BioSAK-1.95.0 → BioSAK-1.95.2}/PKG-INFO +2 -2
  5. {BioSAK-1.95.0 → BioSAK-1.95.2}/bin/BioSAK +5 -1
  6. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/BLCA_op_parser.py +0 -0
  7. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/BioSAK_config.py +0 -0
  8. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/COG2020.py +0 -0
  9. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/COG_boxplot_last1row.R +0 -0
  10. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/COG_boxplot_last2row.R +0 -0
  11. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/CheckM.py +0 -0
  12. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/DnaFeaturesViewer.py +0 -0
  13. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/FastaSplitler_by_num.py +0 -0
  14. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/FastaSplitler_by_size.py +0 -0
  15. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/GTDB_for_BLCA.py +0 -0
  16. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/Gene2Ctg.py +0 -0
  17. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/KEGG.py +0 -0
  18. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/KEGG_boxplot_last1row.R +0 -0
  19. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/KEGG_get_eukaryotic_kos.py +0 -0
  20. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/KeepRemovingTmp.py +0 -0
  21. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/MeanMappingDepth.py +0 -0
  22. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/MetaBiosample.py +0 -0
  23. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/MetaCHIP_phylo.hmm +0 -0
  24. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/MetaCyc_reactions_with_ec.txt +0 -0
  25. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/NetEnzymes.py +0 -0
  26. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/Prodigal.py +0 -0
  27. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/Reads_simulator.py +0 -0
  28. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/RunGraphMB.py +0 -0
  29. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/SILVA_for_BLCA.py +0 -0
  30. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/SankeyTaxon.py +0 -0
  31. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/SubsampleLongReads.py +0 -0
  32. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/Tax4Fun2IndOTU.py +0 -0
  33. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/VisBlastOp.py +0 -0
  34. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/VisGeneFlk.py +0 -0
  35. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/__init__.py +0 -0
  36. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/add_desc.py +0 -0
  37. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/bam2reads.py +0 -0
  38. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot.py +0 -0
  39. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_last1row.R +0 -0
  40. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_matrix_COG.py +0 -0
  41. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_matrix_COG_backup.py +0 -0
  42. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_matrix_KEGG.py +0 -0
  43. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_matrix_dbCAN.py +0 -0
  44. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/cat_fa.py +0 -0
  45. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/cdd2cog.pl +0 -0
  46. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/checkm_marker.py +0 -0
  47. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/compare_sets.py +0 -0
  48. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/count_num.py +0 -0
  49. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/cross_link_seqs.py +0 -0
  50. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/dbCAN.py +0 -0
  51. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/download_GenBank_genome_subset_prokaryotes_csv.py +0 -0
  52. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/dwnld_sra_reads.py +0 -0
  53. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/enrich.py +0 -0
  54. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/exe_cmds.py +0 -0
  55. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/ezaai2mat.py +0 -0
  56. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/fa2id.py +0 -0
  57. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/fastaai.py +0 -0
  58. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/format_converter.py +0 -0
  59. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/fq2fa.py +0 -0
  60. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gapseq.py +0 -0
  61. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk2faa.py +0 -0
  62. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk2ffn.py +0 -0
  63. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk2fna.py +0 -0
  64. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk2gff.py +0 -0
  65. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk_to_ffn_faa.py +0 -0
  66. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gc.py +0 -0
  67. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_EC_from_ko_stats_D.py +0 -0
  68. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_GTDB_taxon_gnm.py +0 -0
  69. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_MAG_reads_long.py +0 -0
  70. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_Pfam_hmms.py +0 -0
  71. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_TopHits_taxonomy.py +0 -0
  72. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_aa_composition.py +0 -0
  73. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_bin_abundance copy.py +0 -0
  74. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_data_matrix.py +0 -0
  75. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_gene_depth.py +0 -0
  76. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_genome_GTDB.py +0 -0
  77. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_genome_NCBI.py +0 -0
  78. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_genome_NCBI_v1.py +0 -0
  79. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_genome_NCBI_v2.py +0 -0
  80. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_gnm_size.py +0 -0
  81. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_ko_gene_seqs.py +0 -0
  82. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_krona_plot.py +0 -0
  83. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_reads_from_sam.py +0 -0
  84. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_reads_id_in_sam.py +0 -0
  85. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_top_hit.py +0 -0
  86. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_total_length.py +0 -0
  87. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gff2chrom.py +0 -0
  88. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/global_functions.py +0 -0
  89. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/hpc3.py +0 -0
  90. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/js_cmds.py +0 -0
  91. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/js_hpc3.py +0 -0
  92. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/keep_best_hit.py +0 -0
  93. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/ko00001.keg +0 -0
  94. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/koala.py +0 -0
  95. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/link_16S_MAG.py +0 -0
  96. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/magabund.py +0 -0
  97. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/magabund2.py +0 -0
  98. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/manipulator_fasta.py +0 -0
  99. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/manipulator_msa.py +0 -0
  100. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/manipulator_newick.py +0 -0
  101. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/manipulator_sam.py +0 -0
  102. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/mann_whitney_u.py +0 -0
  103. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/mean_MAG_cov.py +0 -0
  104. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/merge_df.py +0 -0
  105. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/merge_seq.py +0 -0
  106. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/metaAssembly.py +0 -0
  107. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/metabat2concoct.py +0 -0
  108. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/metabat2maxbin.py +0 -0
  109. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/msa_to_distance_matrix.py +0 -0
  110. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/ncbi_dataset.py +0 -0
  111. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/odp.py +0 -0
  112. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/parse_MetaCyc_RxnDB.py +0 -0
  113. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/parse_mmseqs_tsv.py +0 -0
  114. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/plot_mag.py +0 -0
  115. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/plot_sam_depth.py +0 -0
  116. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/plot_tree.R +0 -0
  117. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/prefix_file.py +0 -0
  118. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/prefix_seq_by_file_name.py +0 -0
  119. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/prokka.py +0 -0
  120. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/reads2bam.py +0 -0
  121. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/rename_reads_for_Reago.py +0 -0
  122. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/rename_seq.py +0 -0
  123. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/ribbon.py +0 -0
  124. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sam2bam.py +0 -0
  125. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sampling_GTDB_gnms.py +0 -0
  126. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sankey.R +0 -0
  127. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sankey.py +0 -0
  128. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/select_seq.py +0 -0
  129. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sep_reads_by_barcode.py +0 -0
  130. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/slice_seq.py +0 -0
  131. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/split_fasta.py +0 -0
  132. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/split_folder.py +0 -0
  133. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/split_sam.py +0 -0
  134. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/srun.py +0 -0
  135. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/statsTaxa.py +0 -0
  136. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/stats_arcog.py +0 -0
  137. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/stats_ko.py +0 -0
  138. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/submitHPC.py +0 -0
  139. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/subset_GTDB_meta.py +0 -0
  140. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/subset_df.py +0 -0
  141. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/subset_tree.py +0 -0
  142. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/tmp_1.py +0 -0
  143. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/tmp_2.py +0 -0
  144. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/tmp_3.py +0 -0
  145. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/top_16S_hits.py +0 -0
  146. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/top_hits_in_a_group.py +0 -0
  147. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/transpose.py +0 -0
  148. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/usearch_uc.py +0 -0
  149. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/wilcox.py +0 -0
  150. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/SOURCES.txt +0 -0
  151. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/dependency_links.txt +0 -0
  152. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/requires.txt +0 -0
  153. {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/top_level.txt +0 -0
  154. {BioSAK-1.95.0 → BioSAK-1.95.2}/LICENSE +0 -0
  155. {BioSAK-1.95.0 → BioSAK-1.95.2}/MANIFEST.in +0 -0
  156. {BioSAK-1.95.0 → BioSAK-1.95.2}/README.md +0 -0
  157. {BioSAK-1.95.0 → BioSAK-1.95.2}/setup.cfg +0 -0
  158. {BioSAK-1.95.0 → BioSAK-1.95.2}/setup.py +0 -0
@@ -1,9 +1,9 @@
1
+ 1.95.2
2
+ - fixed bugs
3
+
1
4
  1.95.0
2
5
  - new modules added: prefix_seq_by_file_name
3
6
 
4
- 1.94.3
5
- - fixed bugs
6
-
7
7
  1.94.0
8
8
  - new modules added: stats_arcog
9
9
 
@@ -1,6 +1,5 @@
1
1
  import os
2
2
  import glob
3
- import shutil
4
3
  import argparse
5
4
  from Bio import SeqIO
6
5
  import multiprocessing as mp
@@ -14,19 +13,18 @@ arCOG_parser_usage = '''
14
13
  # Dependencies: blast+, diamond
15
14
 
16
15
  # annotate protein sequences
17
- BioSAK arCOG -m P -t 6 -db_dir arCOG18_db_dir -i genes.faa
18
- BioSAK arCOG -m P -t 6 -db_dir arCOG18_db_dir -i faa_files -x faa -d depth_files
16
+ BioSAK arCOG -m P -t 6 -db_dir arCOG18_db_dir -i genes.faa -o op_dir
17
+ BioSAK arCOG -m P -t 6 -db_dir arCOG18_db_dir -i faa_files -x faa -d depth_files -o op_dir
19
18
 
20
19
  # annotate DNA sequences (ORFs)
21
- BioSAK arCOG -m N -t 6 -db_dir arCOG18_db_dir -i genes.ffn -d gene.depth
22
- BioSAK arCOG -m N -t 6 -db_dir arCOG18_db_dir -i ffn_files -x ffn
23
-
24
- # Prepare DB files:
25
- cd path/to/your/arCOG_db_dir
26
- wget https://ftp.ncbi.nih.gov/pub/wolf/COGs/arCOG/tmp.ar18/ar18.fa.gz
27
- wget https://ftp.ncbi.nih.gov/pub/wolf/COGs/arCOG/tmp.ar18/ar18.ar14.02.csv
28
- wget https://ftp.ncbi.nih.gov/pub/wolf/COGs/arCOG/tmp.ar18/arCOGdef.tab
29
- wget https://ftp.ncbi.nih.gov/pub/COG/COG2020/data/fun-20.tab
20
+ BioSAK arCOG -m N -t 6 -db_dir arCOG18_db_dir -i genes.ffn -d gene.depth -o op_dir
21
+ BioSAK arCOG -m N -t 6 -db_dir arCOG18_db_dir -i ffn_files -x ffn -o op_dir
22
+
23
+ # Download the following files to your database directory:
24
+ https://ftp.ncbi.nih.gov/pub/COG/COG2020/data/fun-20.tab
25
+ https://ftp.ncbi.nih.gov/pub/wolf/COGs/arCOG/tmp.ar18/ar18.fa.gz
26
+ https://ftp.ncbi.nih.gov/pub/wolf/COGs/arCOG/tmp.ar18/arCOGdef.tab
27
+ https://ftp.ncbi.nih.gov/pub/wolf/COGs/arCOG/tmp.ar18/ar18.ar14.02.csv
30
28
  gunzip ar18.fa.gz
31
29
  makeblastdb -in ar18.fa -dbtype prot -parse_seqids -logfile ar18.fa.log
32
30
  diamond makedb --in ar18.fa --db ar18.fa.dmnd --quiet
@@ -39,26 +37,12 @@ diamond makedb --in ar18.fa --db ar18.fa.dmnd --quiet
39
37
  time_format = '[%Y-%m-%d %H:%M:%S] '
40
38
 
41
39
 
42
- def force_create_folder(folder_to_create):
43
- if os.path.isdir(folder_to_create):
44
- shutil.rmtree(folder_to_create, ignore_errors=True)
45
- if os.path.isdir(folder_to_create):
46
- shutil.rmtree(folder_to_create, ignore_errors=True)
47
- if os.path.isdir(folder_to_create):
48
- shutil.rmtree(folder_to_create, ignore_errors=True)
49
- if os.path.isdir(folder_to_create):
50
- shutil.rmtree(folder_to_create, ignore_errors=True)
51
-
52
- os.mkdir(folder_to_create)
53
-
54
-
55
40
  def sep_path_basename_ext(file_in):
56
41
 
57
42
  file_path, file_name = os.path.split(file_in)
58
43
  if file_path == '':
59
44
  file_path = '.'
60
45
  file_basename, file_ext = os.path.splitext(file_name)
61
-
62
46
  return file_path, file_basename, file_ext
63
47
 
64
48
 
@@ -86,7 +70,6 @@ def get_gene_list_depth(gene_list, gene_to_depth_dict):
86
70
  for gene in gene_list:
87
71
  gene_depth = gene_to_depth_dict[gene]
88
72
  total_depth += gene_depth
89
-
90
73
  return total_depth
91
74
 
92
75
 
@@ -101,10 +84,7 @@ def dna2aa(dna_file, aa_file):
101
84
  query_aa_handle.close()
102
85
 
103
86
 
104
- def best_hit(args):
105
-
106
- file_in = args['i']
107
- file_out = args['o']
87
+ def best_hit(file_in, file_out):
108
88
 
109
89
  file_out_handle = open(file_out, 'w')
110
90
  best_hit_line = ''
@@ -114,7 +94,6 @@ def best_hit(args):
114
94
  blast_hit_split = blast_hit.strip().split('\t')
115
95
  query_id = blast_hit_split[0]
116
96
  bit_score = float(blast_hit_split[11])
117
-
118
97
  if best_hit_query_id == '':
119
98
  best_hit_query_id = query_id
120
99
  best_hit_line = blast_hit
@@ -127,7 +106,6 @@ def best_hit(args):
127
106
  best_hit_query_id = query_id
128
107
  best_hit_line = blast_hit
129
108
  best_hit_score = bit_score
130
-
131
109
  file_out_handle.write(best_hit_line)
132
110
  file_out_handle.close()
133
111
 
@@ -168,7 +146,7 @@ def arCOG_worker(argument_list):
168
146
  pwd_func_stats_copy_pct_by_all = '%s/%s_func_stats_pct_by_all.txt' % (current_output_folder, input_seq_no_ext)
169
147
  pwd_func_stats_depth_pct_by_all = '%s/%s_func_stats_depth_pct_by_all.txt' % (current_output_folder, input_seq_no_ext)
170
148
 
171
- force_create_folder(current_output_folder)
149
+ os.system('mkdir %s' % current_output_folder)
172
150
 
173
151
  input_seq_aa = ''
174
152
  if sequence_type in ['N', 'n']:
@@ -187,7 +165,7 @@ def arCOG_worker(argument_list):
187
165
  os.system('diamond blastp -q %s --db %s.dmnd --out %s --evalue %s --outfmt 6 --threads %s --quiet' % (input_seq_aa, pwd_prot2003_2014, pwd_blastp_output, evalue_cutoff, thread_num))
188
166
 
189
167
  # keep only best hits
190
- best_hit({'i': pwd_blastp_output, 'o': pwd_blastp_output_besthits})
168
+ best_hit(pwd_blastp_output, pwd_blastp_output_besthits)
191
169
 
192
170
  # get query_to_ref_protein_dict
193
171
  query_to_ref_protein_dict = {}
@@ -212,15 +190,12 @@ def arCOG_worker(argument_list):
212
190
  pwd_query_to_cog_txt_handle = open(pwd_query_to_cog_txt, 'w')
213
191
  pwd_query_to_cog_txt_handle.write('Query\tarCOG\tCategory\tDescription\n')
214
192
  for query_gene in sorted(query_seq_list):
215
-
216
193
  if query_gene not in query_to_ref_protein_dict:
217
194
  pwd_query_to_cog_txt_handle.write('%s\n' % (query_gene))
218
-
219
195
  else:
220
196
  db_protein_id = query_to_ref_protein_dict[query_gene]
221
197
  if db_protein_id not in protein_id_to_cog_id_dict:
222
198
  pwd_query_to_cog_txt_handle.write('%s\n' % (query_gene))
223
-
224
199
  else:
225
200
  cog_id_list = protein_id_to_cog_id_dict[db_protein_id]
226
201
  for cog_id in cog_id_list:
@@ -335,10 +310,10 @@ def get_COG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, an
335
310
  cog_num_pct_by_all_dict = {}
336
311
  all_identified_cog = set()
337
312
  for annotation_folder in annotation_folder_list:
338
-
339
313
  annotation_folder_basename = annotation_folder.split('_arCOG_wd')[0]
340
314
  pwd_annotation_stats_file = ''
341
315
  pwd_annotation_stats_file_pct = ''
316
+
342
317
  if stats_level == 'cog_id':
343
318
  if with_depth is False:
344
319
  pwd_annotation_stats_file = '%s/%s/%s_arcog_stats.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
@@ -401,14 +376,11 @@ def get_COG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, an
401
376
  current_cog_num_list = []
402
377
  current_cog_num_list_pct = []
403
378
  for identified_cog in all_identified_cog_list:
404
-
405
- # get num list
406
379
  identified_cog_num = 0
407
380
  identified_cog_num_pct = 0
408
381
  if identified_cog in current_cog_num_dict:
409
382
  identified_cog_num = current_cog_num_dict[identified_cog]
410
383
  identified_cog_num_pct = current_cog_num_pct_dict[identified_cog]
411
-
412
384
  current_cog_num_list.append(identified_cog_num)
413
385
  current_cog_num_list_pct.append(identified_cog_num_pct)
414
386
 
@@ -441,15 +413,17 @@ def get_COG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, an
441
413
 
442
414
  def arCOG(args):
443
415
 
444
- file_in = args['i']
445
- file_extension = args['x']
446
- sequence_type = args['m']
447
- depth_file = args['d']
448
- pct_by_all = args['pct_by_all']
449
- DB_dir = args['db_dir']
450
- num_threads = args['t']
451
- run_diamond = args['diamond']
452
- evalue_cutoff = args['evalue']
416
+ file_in = args['i']
417
+ output_folder = args['o']
418
+ file_extension = args['x']
419
+ sequence_type = args['m']
420
+ depth_file = args['d']
421
+ pct_by_all = args['pct_by_all']
422
+ DB_dir = args['db_dir']
423
+ num_threads = args['t']
424
+ run_diamond = args['diamond']
425
+ evalue_cutoff = args['evalue']
426
+ force_create_op_dir = args['f']
453
427
 
454
428
  ar18_fa = '%s/ar18.fa' % DB_dir
455
429
  ar18_fa_diamond = '%s/ar18.fa.dmnd' % DB_dir
@@ -577,8 +551,13 @@ def arCOG(args):
577
551
  file_in_folder_name = file_in.split('/')[-1]
578
552
 
579
553
  # create output folder
580
- output_folder = '%s_arCOG_wd' % file_in_folder_name
581
- force_create_folder(output_folder)
554
+ if os.path.isdir(output_folder) is True:
555
+ if force_create_op_dir is True:
556
+ os.system('rm -r %s' % output_folder)
557
+ else:
558
+ print('Output folder detected, program exited!')
559
+ exit()
560
+ os.system('mkdir %s' % output_folder)
582
561
 
583
562
  ######################################################### main #########################################################
584
563
 
@@ -595,11 +574,9 @@ def arCOG(args):
595
574
  else:
596
575
  input_file_depth = '%s/%s.depth' % (depth_file, input_file_basename)
597
576
 
598
- list_for_multiple_arguments_COG.append([pwd_input_file, ar18_fa, protein_to_cog_dict,
599
- cog_id_to_category_dict, cog_id_to_description_dict,
600
- cog_category_list, cog_category_to_description_dict,
601
- sequence_type, output_folder, 1, run_diamond, evalue_cutoff,
602
- input_file_depth, pct_by_all])
577
+ list_for_multiple_arguments_COG.append([pwd_input_file, ar18_fa, protein_to_cog_dict, cog_id_to_category_dict, cog_id_to_description_dict,
578
+ cog_category_list, cog_category_to_description_dict, sequence_type, output_folder, 1, run_diamond,
579
+ evalue_cutoff, input_file_depth, pct_by_all])
603
580
 
604
581
  # run COG annotaion files with multiprocessing
605
582
  pool = mp.Pool(processes=num_threads)
@@ -661,15 +638,17 @@ def arCOG(args):
661
638
 
662
639
  if __name__ == '__main__':
663
640
 
664
- COG_parser = argparse.ArgumentParser(usage=arCOG_parser_usage)
665
- COG_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
666
- COG_parser.add_argument('-x', required=False, help='file extension')
667
- COG_parser.add_argument('-m', required=True, help='sequence type, "N/n" for "nucleotide", "P/p" for "protein"')
668
- COG_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
669
- COG_parser.add_argument('-pct_by_all', required=False, action='store_true', help='normalize by all query genes, including those without annotation')
670
- COG_parser.add_argument('-db_dir', required=True, help='COG_db_dir')
671
- COG_parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default: blastp from NCBI')
672
- COG_parser.add_argument('-t', required=False, type=int, default=1, help='number of threads')
673
- COG_parser.add_argument('-evalue', required=False, default=0.0001, type=float, help='evalue cutoff, default: 0.0001')
674
- args = vars(COG_parser.parse_args())
641
+ arCOG_parser = argparse.ArgumentParser(usage=arCOG_parser_usage)
642
+ arCOG_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
643
+ arCOG_parser.add_argument('-o', required=True, help='output directory')
644
+ arCOG_parser.add_argument('-x', required=False, help='file extension')
645
+ arCOG_parser.add_argument('-m', required=True, help='sequence type, "N/n" for "nucleotide", "P/p" for "protein"')
646
+ arCOG_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
647
+ arCOG_parser.add_argument('-db_dir', required=True, help='COG_db_dir')
648
+ arCOG_parser.add_argument('-pct_by_all', required=False, action='store_true', help='normalize by all query genes, including those without annotation')
649
+ arCOG_parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default: blastp from NCBI')
650
+ arCOG_parser.add_argument('-evalue', required=False, default=0.0001, help='evalue cutoff, accepted format 0.001, 1e-10, 1e-30, default: 0.0001')
651
+ arCOG_parser.add_argument('-t', required=False, type=int, default=1, help='number of threads')
652
+ arCOG_parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
653
+ args = vars(arCOG_parser.parse_args())
675
654
  arCOG(args)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: BioSAK
3
- Version: 1.95.0
3
+ Version: 1.95.2
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.95.0
23
+ BioSAK v1.95.2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: BioSAK
3
- Version: 1.95.0
3
+ Version: 1.95.2
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.95.0
23
+ BioSAK v1.95.2
@@ -172,6 +172,7 @@ if __name__ == '__main__':
172
172
  from BioSAK import arCOG
173
173
  arCOG_parser = subparsers.add_parser('arCOG', description='Wrapper for arCOG', usage=arCOG.arCOG_parser_usage)
174
174
  arCOG_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
175
+ arCOG_parser.add_argument('-o', required=True, help='output directory')
175
176
  arCOG_parser.add_argument('-x', required=False, help='file extension')
176
177
  arCOG_parser.add_argument('-m', required=True, help='sequence type, "N/n" for "nucleotide", "P/p" for "protein"')
177
178
  arCOG_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
@@ -179,7 +180,10 @@ if __name__ == '__main__':
179
180
  arCOG_parser.add_argument('-db_dir', required=True, help='DB folder')
180
181
  arCOG_parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default is NCBI blastp')
181
182
  arCOG_parser.add_argument('-t', required=False, default=1, type=int, help='number of threads')
182
- arCOG_parser.add_argument('-evalue', required=False, default=0.0001, type=float, help='evalue cutoff, default: 0.0001')
183
+ arCOG_parser.add_argument('-evalue', required=False, default=0.0001, type=float, help='evalue cutoff, default: 0.0001')
184
+ arCOG_parser.add_argument('-evalue', required=False, default=0.0001, help='evalue cutoff, accepted format 0.001, 1e-10, 1e-30, default: 0.0001')
185
+ arCOG_parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
186
+
183
187
  args = vars(parser.parse_args())
184
188
  arCOG.arCOG(args)
185
189
 
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes