BioSAK 1.78.3__tar.gz → 1.78.5__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.
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/COG2020.py +13 -51
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/KEGG.py +4 -4
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/VERSION +1 -1
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/arCOG.py +18 -46
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/dbCAN.py +5 -5
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/enrich.py +9 -6
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK.egg-info/PKG-INFO +2 -2
- {BioSAK-1.78.3 → BioSAK-1.78.5}/PKG-INFO +2 -2
- {BioSAK-1.78.3 → BioSAK-1.78.5}/bin/BioSAK +4 -4
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/BLCA_op_parser.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/BioSAK_config.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/COG_boxplot_last1row.R +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/COG_boxplot_last2row.R +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/CheckM.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/ConvertMSA.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/DnaFeaturesViewer.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/FastaSplitler_by_num.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/FastaSplitler_by_size.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/GTDB_for_BLCA.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/Gene2Ctg.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/KEGG_boxplot_last1row.R +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/KEGG_get_eukaryotic_kos.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/KeepRemovingTmp.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/MeanMappingDepth.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/MetaBiosample.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/MetaCHIP_phylo.hmm +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/MetaCyc_reactions_with_ec.txt +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/NetEnzymes.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/Newick_tree_plotter.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/OneLineAln.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/Prodigal.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/Reads_simulator.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/RunGraphMB.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/SILVA_for_BLCA.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/SankeyTaxon.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/SliceMSA.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/SubsampleLongReads.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/Tax4Fun2IndOTU.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/VisBlastOp.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/VisGeneFlk.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/__init__.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/bam2reads.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/boxplot_last1row.R +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/boxplot_matrix_COG.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/boxplot_matrix_COG_backup.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/boxplot_matrix_KEGG.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/boxplot_matrix_dbCAN.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/cat_fa.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/cdd2cog.pl +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/checkm_marker.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/compare_trees.R +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/compare_trees.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/cross_link_seqs.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/download_GenBank_genome_subset_prokaryotes_csv.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/dwnld_sra_reads.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/exe_cmds.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/ezaai2mat.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/fa2id.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/fa2phy.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/fa2tree.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/format_converter.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/format_leaf_name.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/fq2fa.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/gbk2faa.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/gbk2ffn.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/gbk2fna.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/gbk_to_ffn_faa.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_EC_from_ko_stats_D.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_GTDB_taxon_gnm.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_MAG_reads_long.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_Pfam_hmms.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_SCG_tree.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_TopHits_taxonomy.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_aa_composition.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_bin_abundance copy.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_data_matrix.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_gc.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_gene_depth.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_genome_GTDB.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_genome_NCBI.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_genome_NCBI_v1.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_genome_NCBI_v2.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_gnm_size.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_ko_gene_seqs.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_krona_plot.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_reads_from_sam.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_reads_id_in_sam.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_sankey_plot.R +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_top_hit.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/get_total_length.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/global_functions.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/hpc3.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/iTOL.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/js_cmds.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/js_hpc3.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/keep_best_hit.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/ko00001.keg +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/koala.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/label_tree.R +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/label_tree.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/link_16S_MAG.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/magabund.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/magabund2.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/manipulator_fasta.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/manipulator_msa.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/manipulator_newick.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/manipulator_sam.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/mean_MAG_cov.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/merge_seq.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/metaAssembly.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/metabat2concoct.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/metabat2maxbin.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/msa_to_distance_matrix.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/ncbi_dataset.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/odp.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/parse_MetaCyc_RxnDB.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/parse_mmseqs_tsv.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/plot_mag.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/plot_sam_depth.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/plot_tree.R +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/prefix_file.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/prokka.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/reads2bam.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/rename_leaves.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/rename_reads_for_Reago.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/rename_seq.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/rename_seqs.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/ribbon.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/sam2bam.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/sampling_GTDB_gnms.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/select_seq.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/sep_reads_by_barcode.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/slice_seq.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/split_fasta.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/split_folder.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/split_sam.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/submitHPC.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/subset_GTDB_meta.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/subset_tree.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/top_16S_hits.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/top_hits_in_a_group.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK/usearch_uc.py +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK.egg-info/SOURCES.txt +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK.egg-info/dependency_links.txt +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK.egg-info/requires.txt +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/BioSAK.egg-info/top_level.txt +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/LICENSE +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/MANIFEST.in +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/README.md +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/setup.cfg +0 -0
- {BioSAK-1.78.3 → BioSAK-1.78.5}/setup.py +0 -0
|
@@ -22,10 +22,10 @@ module load diamond
|
|
|
22
22
|
|
|
23
23
|
# annotate protein sequences
|
|
24
24
|
BioSAK COG2020 -m P -t 6 -db_dir path/to/your/COG_db_dir -i genes.faa
|
|
25
|
-
BioSAK COG2020 -m P -t 6 -db_dir path/to/your/COG_db_dir -i faa_files -x faa -
|
|
25
|
+
BioSAK COG2020 -m P -t 6 -db_dir path/to/your/COG_db_dir -i faa_files -x faa -d depth_files
|
|
26
26
|
|
|
27
27
|
# annotate DNA sequences (ORFs)
|
|
28
|
-
BioSAK COG2020 -m N -t 6 -db_dir path/to/your/COG_db_dir -i genes.ffn -
|
|
28
|
+
BioSAK COG2020 -m N -t 6 -db_dir path/to/your/COG_db_dir -i genes.ffn -d gene.depth
|
|
29
29
|
BioSAK COG2020 -m N -t 6 -db_dir path/to/your/COG_db_dir -i ffn_files -x ffn
|
|
30
30
|
|
|
31
31
|
# Prepare DB files (version 2020):
|
|
@@ -434,7 +434,7 @@ def COG2020(args):
|
|
|
434
434
|
file_in = args['i']
|
|
435
435
|
file_extension = args['x']
|
|
436
436
|
sequence_type = args['m']
|
|
437
|
-
depth_file = args['
|
|
437
|
+
depth_file = args['d']
|
|
438
438
|
pct_by_all = args['pct_by_all']
|
|
439
439
|
DB_dir = args['db_dir']
|
|
440
440
|
num_threads = args['t']
|
|
@@ -447,7 +447,6 @@ def COG2020(args):
|
|
|
447
447
|
pwd_cog_20_def_tab = '%s/cog-20.def.tab' % DB_dir
|
|
448
448
|
pwd_fun_20_tab = '%s/fun-20.tab' % DB_dir
|
|
449
449
|
|
|
450
|
-
|
|
451
450
|
############################################ check whether db file exist ###########################################
|
|
452
451
|
|
|
453
452
|
# check whether db file exist
|
|
@@ -466,7 +465,6 @@ def COG2020(args):
|
|
|
466
465
|
print(datetime.now().strftime(time_format) + 'Program exited!')
|
|
467
466
|
exit()
|
|
468
467
|
|
|
469
|
-
|
|
470
468
|
################################################# read db into dict ################################################
|
|
471
469
|
|
|
472
470
|
# get protein_to_cog_dict (cog-20.cog.csv)
|
|
@@ -502,7 +500,6 @@ def COG2020(args):
|
|
|
502
500
|
cog_category_list.append(cog_category_split[0])
|
|
503
501
|
cog_category_to_description_dict[cog_category_split[0]] = cog_category_split[2]
|
|
504
502
|
|
|
505
|
-
|
|
506
503
|
################################################## if input is file ################################################
|
|
507
504
|
|
|
508
505
|
# if input is file
|
|
@@ -518,32 +515,18 @@ def COG2020(args):
|
|
|
518
515
|
|
|
519
516
|
file_in_path, file_in_basename, file_in_ext = sep_path_basename_ext(file_in)
|
|
520
517
|
|
|
521
|
-
COG2020_worker([file_in,
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
cog_id_to_category_dict,
|
|
525
|
-
cog_id_to_description_dict,
|
|
526
|
-
cog_category_list,
|
|
527
|
-
cog_category_to_description_dict,
|
|
528
|
-
sequence_type,
|
|
529
|
-
file_in_path,
|
|
530
|
-
num_threads,
|
|
531
|
-
run_diamond,
|
|
532
|
-
evalue_cutoff,
|
|
533
|
-
depth_file,
|
|
534
|
-
pct_by_all])
|
|
535
|
-
|
|
518
|
+
COG2020_worker([file_in, pwd_cog_20_fa, protein_to_cog_dict, cog_id_to_category_dict, cog_id_to_description_dict,
|
|
519
|
+
cog_category_list, cog_category_to_description_dict, sequence_type, file_in_path, num_threads,
|
|
520
|
+
run_diamond, evalue_cutoff, depth_file, pct_by_all])
|
|
536
521
|
|
|
537
522
|
################################################ if input is folder ################################################
|
|
538
523
|
|
|
539
524
|
# if input is folder
|
|
540
525
|
else:
|
|
541
|
-
|
|
542
526
|
# check whether input folder exist
|
|
543
527
|
if os.path.isdir(file_in) is False:
|
|
544
528
|
print(datetime.now().strftime(time_format) + 'input folder not found, program exited')
|
|
545
529
|
exit()
|
|
546
|
-
|
|
547
530
|
else:
|
|
548
531
|
# check whether input genome exist
|
|
549
532
|
input_file_re = '%s/*.%s' % (file_in, file_extension)
|
|
@@ -566,7 +549,6 @@ def COG2020(args):
|
|
|
566
549
|
exit()
|
|
567
550
|
|
|
568
551
|
if os.path.isdir(depth_file) is True:
|
|
569
|
-
|
|
570
552
|
undetected_depth_file = []
|
|
571
553
|
for input_seq_file in input_file_name_list:
|
|
572
554
|
input_seq_file_basename = '.'.join(input_seq_file.split('.')[:-1])
|
|
@@ -579,7 +561,6 @@ def COG2020(args):
|
|
|
579
561
|
print(','.join(undetected_depth_file))
|
|
580
562
|
exit()
|
|
581
563
|
|
|
582
|
-
|
|
583
564
|
################################################### define file name ###################################################
|
|
584
565
|
|
|
585
566
|
if '/' in file_in:
|
|
@@ -587,12 +568,10 @@ def COG2020(args):
|
|
|
587
568
|
else:
|
|
588
569
|
file_in_folder_name = file_in
|
|
589
570
|
|
|
590
|
-
output_folder =
|
|
571
|
+
output_folder = '%s_COG2020_wd' % file_in_folder_name
|
|
591
572
|
|
|
592
|
-
# create output folder
|
|
593
573
|
force_create_folder(output_folder)
|
|
594
574
|
|
|
595
|
-
|
|
596
575
|
######################################################### main #########################################################
|
|
597
576
|
|
|
598
577
|
print(datetime.now().strftime(time_format) + 'Running COG annotation for %s files with %s cores' % (len(input_file_name_list), num_threads))
|
|
@@ -603,27 +582,17 @@ def COG2020(args):
|
|
|
603
582
|
input_file_basename = '.'.join(input_file.split('.')[:-1])
|
|
604
583
|
pwd_input_file = '%s/%s' % (file_in, input_file)
|
|
605
584
|
|
|
606
|
-
|
|
607
585
|
# get path to current depth file
|
|
608
586
|
if depth_file is None:
|
|
609
587
|
input_file_depth = None
|
|
610
588
|
else:
|
|
611
589
|
input_file_depth = '%s/%s.depth' % (depth_file, input_file_basename)
|
|
612
590
|
|
|
613
|
-
list_for_multiple_arguments_COG.append([pwd_input_file,
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
cog_category_list,
|
|
619
|
-
cog_category_to_description_dict,
|
|
620
|
-
sequence_type,
|
|
621
|
-
output_folder,
|
|
622
|
-
1,
|
|
623
|
-
run_diamond,
|
|
624
|
-
evalue_cutoff,
|
|
625
|
-
input_file_depth,
|
|
626
|
-
pct_by_all])
|
|
591
|
+
list_for_multiple_arguments_COG.append([pwd_input_file, pwd_cog_20_fa, protein_to_cog_dict,
|
|
592
|
+
cog_id_to_category_dict, cog_id_to_description_dict,
|
|
593
|
+
cog_category_list, cog_category_to_description_dict,
|
|
594
|
+
sequence_type, output_folder, 1, run_diamond, evalue_cutoff,
|
|
595
|
+
input_file_depth, pct_by_all])
|
|
627
596
|
|
|
628
597
|
# run COG annotaion files with multiprocessing
|
|
629
598
|
pool = mp.Pool(processes=num_threads)
|
|
@@ -636,15 +605,12 @@ def COG2020(args):
|
|
|
636
605
|
annotation_df_cog_cate_GeneNumber = '%s/%s_COG2020_cate_GeneNumber.txt' % (output_folder, file_in_folder_name)
|
|
637
606
|
annotation_df_cog_cate_GeneNumber_pct = '%s/%s_COG2020_cate_GeneNumber_pct.txt' % (output_folder, file_in_folder_name)
|
|
638
607
|
annotation_df_cog_cate_GeneNumber_pct_by_all = '%s/%s_COG2020_cate_GeneNumber_pct_by_all.txt' % (output_folder, file_in_folder_name)
|
|
639
|
-
|
|
640
608
|
annotation_df_cog_cate_TotalDepth = '%s/%s_COG2020_cate_TotalDepth.txt' % (output_folder, file_in_folder_name)
|
|
641
609
|
annotation_df_cog_cate_TotalDepth_pct = '%s/%s_COG2020_cate_TotalDepth_pct.txt' % (output_folder, file_in_folder_name)
|
|
642
610
|
annotation_df_cog_cate_TotalDepth_pct_by_all = '%s/%s_COG2020_cate_TotalDepth_pct_by_all.txt' % (output_folder, file_in_folder_name)
|
|
643
|
-
|
|
644
611
|
annotation_df_cog_id_GeneNumber = '%s/%s_COG2020_id_GeneNumber.txt' % (output_folder, file_in_folder_name)
|
|
645
612
|
annotation_df_cog_id_GeneNumber_pct = '%s/%s_COG2020_id_GeneNumber_pct.txt' % (output_folder, file_in_folder_name)
|
|
646
613
|
annotation_df_cog_id_GeneNumber_pct_by_all = '%s/%s_COG2020_id_GeneNumber_pct_by_all.txt' % (output_folder, file_in_folder_name)
|
|
647
|
-
|
|
648
614
|
annotation_df_cog_id_TotalDepth = '%s/%s_COG2020_id_TotalDepth.txt' % (output_folder, file_in_folder_name)
|
|
649
615
|
annotation_df_cog_id_TotalDepth_pct = '%s/%s_COG2020_id_TotalDepth_pct.txt' % (output_folder, file_in_folder_name)
|
|
650
616
|
annotation_df_cog_id_TotalDepth_pct_by_all = '%s/%s_COG2020_id_TotalDepth_pct_by_all.txt' % (output_folder, file_in_folder_name)
|
|
@@ -689,18 +655,14 @@ def COG2020(args):
|
|
|
689
655
|
if __name__ == '__main__':
|
|
690
656
|
|
|
691
657
|
COG_parser = argparse.ArgumentParser(usage=COG2020_parser_usage)
|
|
692
|
-
|
|
693
|
-
# arguments for COG_parser
|
|
694
658
|
COG_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
|
|
695
659
|
COG_parser.add_argument('-x', required=False, help='file extension')
|
|
696
660
|
COG_parser.add_argument('-m', required=True, help='sequence type, "N/n" for "nucleotide", "P/p" for "protein"')
|
|
697
|
-
COG_parser.add_argument('-
|
|
661
|
+
COG_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
|
|
698
662
|
COG_parser.add_argument('-pct_by_all', required=False, action='store_true', help='normalize by all query genes, including those without COG assignment')
|
|
699
663
|
COG_parser.add_argument('-db_dir', required=True, help='COG_db_dir')
|
|
700
664
|
COG_parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default is NCBI blastp')
|
|
701
665
|
COG_parser.add_argument('-t', required=False, type=int, default=1, help='number of threads')
|
|
702
666
|
COG_parser.add_argument('-evalue', required=False, default=0.001, type=float, help='evalue cutoff, default: 0.001')
|
|
703
|
-
|
|
704
667
|
args = vars(COG_parser.parse_args())
|
|
705
|
-
|
|
706
668
|
COG2020(args)
|
|
@@ -18,10 +18,10 @@ KEGG_parser_usage = '''
|
|
|
18
18
|
# Dependencies: blast+ or diamond
|
|
19
19
|
|
|
20
20
|
# annotation with NCBI blastp (default, for small dataset)
|
|
21
|
-
BioSAK KEGG -db_dir path/to/your/KEGG_db_dir -t 6 -seq_in input.faa -
|
|
21
|
+
BioSAK KEGG -db_dir path/to/your/KEGG_db_dir -t 6 -seq_in input.faa -d input.depth
|
|
22
22
|
|
|
23
23
|
# annotation with Diamond blastp (for big dataset)
|
|
24
|
-
BioSAK KEGG -db_dir path/to/your/KEGG_db_dir -t 12 -seq_in faa_folder -x faa -
|
|
24
|
+
BioSAK KEGG -db_dir path/to/your/KEGG_db_dir -t 12 -seq_in faa_folder -x faa -d depth_files -diamond
|
|
25
25
|
|
|
26
26
|
# get summary for BlastKOALA/GhostKOALA produced results
|
|
27
27
|
BioSAK KEGG -db_dir path/to/your/KEGG_db_dir -t 9 -ko_in user_ko.txt
|
|
@@ -508,7 +508,7 @@ def Annotation_KEGG(args):
|
|
|
508
508
|
input_file_faa = args['seq_in']
|
|
509
509
|
input_file_user_ko = args['ko_in']
|
|
510
510
|
file_extension = args['x']
|
|
511
|
-
depth_file = args['
|
|
511
|
+
depth_file = args['d']
|
|
512
512
|
pct_by_all = args['pct_by_all']
|
|
513
513
|
KEGG_DB_folder = args['db_dir']
|
|
514
514
|
run_diamond = args['diamond']
|
|
@@ -797,7 +797,7 @@ if __name__ == "__main__":
|
|
|
797
797
|
parser.add_argument('-seq_in', required=False, help='faa file')
|
|
798
798
|
parser.add_argument('-ko_in', required=False, help='annotation results from BlastKOALA/GhostKOALA, normally with name user_ko.txt')
|
|
799
799
|
parser.add_argument('-x', required=False, help='file extension')
|
|
800
|
-
parser.add_argument('-
|
|
800
|
+
parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
|
|
801
801
|
parser.add_argument('-pct_by_all', required=False, action='store_true', help='normalize by all query genes, rather than those with ko assignment')
|
|
802
802
|
parser.add_argument('-db_dir', required=True, help='folder holds sequence, seq2ko and ko00001.keg files')
|
|
803
803
|
parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default is NCBI blastp')
|
|
@@ -14,12 +14,12 @@ arCOG_parser_usage = '''
|
|
|
14
14
|
# Dependencies: blast+, diamond
|
|
15
15
|
|
|
16
16
|
# annotate protein sequences
|
|
17
|
-
BioSAK arCOG -m P -t 6 -db_dir
|
|
18
|
-
BioSAK arCOG -m P -t 6 -db_dir
|
|
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
|
|
19
19
|
|
|
20
20
|
# annotate DNA sequences (ORFs)
|
|
21
|
-
BioSAK arCOG -m N -t 6 -db_dir
|
|
22
|
-
BioSAK arCOG -m N -t 6 -db_dir
|
|
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
23
|
|
|
24
24
|
# Prepare DB files:
|
|
25
25
|
cd path/to/your/arCOG_db_dir
|
|
@@ -54,12 +54,9 @@ def force_create_folder(folder_to_create):
|
|
|
54
54
|
|
|
55
55
|
def sep_path_basename_ext(file_in):
|
|
56
56
|
|
|
57
|
-
# separate path and file name
|
|
58
57
|
file_path, file_name = os.path.split(file_in)
|
|
59
58
|
if file_path == '':
|
|
60
59
|
file_path = '.'
|
|
61
|
-
|
|
62
|
-
# separate file basename and extension
|
|
63
60
|
file_basename, file_ext = os.path.splitext(file_name)
|
|
64
61
|
|
|
65
62
|
return file_path, file_basename, file_ext
|
|
@@ -71,20 +68,15 @@ def AnnotateNorm(file_in, skip_header, value_column, Divisor_value, file_out, fi
|
|
|
71
68
|
file_out_handle.write(file_out_header)
|
|
72
69
|
line_num = 0
|
|
73
70
|
for each_line in open(file_in):
|
|
74
|
-
|
|
75
71
|
each_line_split = each_line.strip().split('\t')
|
|
76
72
|
value_str = each_line_split[value_column - 1]
|
|
77
|
-
|
|
78
73
|
if (skip_header is True and line_num > 0) or (skip_header is False):
|
|
79
|
-
|
|
80
74
|
value_pct = 0
|
|
81
75
|
if Divisor_value != 0:
|
|
82
76
|
value_pct = float(value_str) * 100 / Divisor_value
|
|
83
77
|
each_line_split[value_column - 1] = str(float("{0:.2f}".format(value_pct)))
|
|
84
78
|
file_out_handle.write('%s\n' % '\t'.join(each_line_split))
|
|
85
|
-
|
|
86
79
|
line_num += 1
|
|
87
|
-
|
|
88
80
|
file_out_handle.close()
|
|
89
81
|
|
|
90
82
|
|
|
@@ -127,11 +119,9 @@ def best_hit(args):
|
|
|
127
119
|
best_hit_query_id = query_id
|
|
128
120
|
best_hit_line = blast_hit
|
|
129
121
|
best_hit_score = bit_score
|
|
130
|
-
|
|
131
122
|
elif (query_id == best_hit_query_id) and (bit_score > best_hit_score):
|
|
132
123
|
best_hit_score = bit_score
|
|
133
124
|
best_hit_line = blast_hit
|
|
134
|
-
|
|
135
125
|
elif query_id != best_hit_query_id:
|
|
136
126
|
file_out_handle.write(best_hit_line)
|
|
137
127
|
best_hit_query_id = query_id
|
|
@@ -165,20 +155,17 @@ def arCOG_worker(argument_list):
|
|
|
165
155
|
pwd_blastp_output = '%s/%s_blastp.tab' % (current_output_folder, input_seq_no_ext)
|
|
166
156
|
pwd_blastp_output_besthits = '%s/%s_blastp_besthits.tab' % (current_output_folder, input_seq_no_ext)
|
|
167
157
|
pwd_query_to_cog_txt = '%s/%s_query_to_cog.txt' % (current_output_folder, input_seq_no_ext)
|
|
168
|
-
|
|
169
|
-
pwd_cog_stats_copy = '%s/%s_arcog_stats_copy.txt' % (current_output_folder, input_seq_no_ext)
|
|
158
|
+
pwd_cog_stats_copy = '%s/%s_arcog_stats.txt' % (current_output_folder, input_seq_no_ext)
|
|
170
159
|
pwd_cog_stats_depth = '%s/%s_arcog_stats_depth.txt' % (current_output_folder, input_seq_no_ext)
|
|
171
|
-
pwd_func_stats_copy = '%s/%
|
|
160
|
+
pwd_func_stats_copy = '%s/%s_func_stats.txt' % (current_output_folder, input_seq_no_ext)
|
|
172
161
|
pwd_func_stats_depth = '%s/%s_func_stats_depth.txt' % (current_output_folder, input_seq_no_ext)
|
|
173
|
-
|
|
174
|
-
pwd_cog_stats_copy_pct = '%s/%s_arcog_stats_copy_pct.txt' % (current_output_folder, input_seq_no_ext)
|
|
162
|
+
pwd_cog_stats_copy_pct = '%s/%s_arcog_stats_pct.txt' % (current_output_folder, input_seq_no_ext)
|
|
175
163
|
pwd_cog_stats_depth_pct = '%s/%s_arcog_stats_depth_pct.txt' % (current_output_folder, input_seq_no_ext)
|
|
176
|
-
pwd_func_stats_copy_pct = '%s/%
|
|
164
|
+
pwd_func_stats_copy_pct = '%s/%s_func_stats_pct.txt' % (current_output_folder, input_seq_no_ext)
|
|
177
165
|
pwd_func_stats_depth_pct = '%s/%s_func_stats_depth_pct.txt' % (current_output_folder, input_seq_no_ext)
|
|
178
|
-
|
|
179
|
-
pwd_cog_stats_copy_pct_by_all = '%s/%s_arcog_stats_copy_pct_by_all.txt' % (current_output_folder, input_seq_no_ext)
|
|
166
|
+
pwd_cog_stats_copy_pct_by_all = '%s/%s_arcog_stats_pct_by_all.txt' % (current_output_folder, input_seq_no_ext)
|
|
180
167
|
pwd_cog_stats_depth_pct_by_all = '%s/%s_arcog_stats_depth_pct_by_all.txt' % (current_output_folder, input_seq_no_ext)
|
|
181
|
-
pwd_func_stats_copy_pct_by_all = '%s/%
|
|
168
|
+
pwd_func_stats_copy_pct_by_all = '%s/%s_func_stats_pct_by_all.txt' % (current_output_folder, input_seq_no_ext)
|
|
182
169
|
pwd_func_stats_depth_pct_by_all = '%s/%s_func_stats_depth_pct_by_all.txt' % (current_output_folder, input_seq_no_ext)
|
|
183
170
|
|
|
184
171
|
force_create_folder(current_output_folder)
|
|
@@ -211,9 +198,6 @@ def arCOG_worker(argument_list):
|
|
|
211
198
|
each_hit_subject_no_dot = '_'.join(each_hit_subject.split('.'))
|
|
212
199
|
query_to_ref_protein_dict[each_hit_query] = each_hit_subject_no_dot
|
|
213
200
|
|
|
214
|
-
# print('query_to_ref_protein_dict')
|
|
215
|
-
# print(query_to_ref_protein_dict)
|
|
216
|
-
|
|
217
201
|
# get query sequences list
|
|
218
202
|
query_seq_list = []
|
|
219
203
|
for query_seq in SeqIO.parse(pwd_input_file, 'fasta'):
|
|
@@ -221,8 +205,8 @@ def arCOG_worker(argument_list):
|
|
|
221
205
|
|
|
222
206
|
# export annotation
|
|
223
207
|
cog_id_num_dict = {}
|
|
224
|
-
cog_id_to_gene_member_dict = {}
|
|
225
208
|
cog_cate_num_dict = {}
|
|
209
|
+
cog_id_to_gene_member_dict = {}
|
|
226
210
|
cog_cate_to_gene_member_dict = {}
|
|
227
211
|
genes_with_cog = set()
|
|
228
212
|
pwd_query_to_cog_txt_handle = open(pwd_query_to_cog_txt, 'w')
|
|
@@ -357,9 +341,9 @@ def get_COG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, an
|
|
|
357
341
|
pwd_annotation_stats_file_pct = ''
|
|
358
342
|
if stats_level == 'cog_id':
|
|
359
343
|
if with_depth is False:
|
|
360
|
-
pwd_annotation_stats_file = '%s/%s/%
|
|
361
|
-
pwd_annotation_stats_file_pct = '%s/%s/%
|
|
362
|
-
pwd_annotation_stats_file_pct_by_all = '%s/%s/%
|
|
344
|
+
pwd_annotation_stats_file = '%s/%s/%s_arcog_stats.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
345
|
+
pwd_annotation_stats_file_pct = '%s/%s/%s_arcog_stats_pct.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
346
|
+
pwd_annotation_stats_file_pct_by_all = '%s/%s/%s_arcog_stats_pct_by_all.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
363
347
|
else:
|
|
364
348
|
pwd_annotation_stats_file = '%s/%s/%s_arcog_stats_depth.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
365
349
|
pwd_annotation_stats_file_pct = '%s/%s/%s_arcog_stats_depth_pct.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
@@ -367,9 +351,9 @@ def get_COG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, an
|
|
|
367
351
|
|
|
368
352
|
if stats_level == 'cog_cate':
|
|
369
353
|
if with_depth is False:
|
|
370
|
-
pwd_annotation_stats_file = '%s/%s/%
|
|
371
|
-
pwd_annotation_stats_file_pct = '%s/%s/%
|
|
372
|
-
pwd_annotation_stats_file_pct_by_all = '%s/%s/%
|
|
354
|
+
pwd_annotation_stats_file = '%s/%s/%s_func_stats.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
355
|
+
pwd_annotation_stats_file_pct = '%s/%s/%s_func_stats_pct.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
356
|
+
pwd_annotation_stats_file_pct_by_all = '%s/%s/%s_func_stats_pct_by_all.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
373
357
|
else:
|
|
374
358
|
pwd_annotation_stats_file = '%s/%s/%s_func_stats_depth.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
375
359
|
pwd_annotation_stats_file_pct = '%s/%s/%s_func_stats_depth_pct.txt' % (annotation_dir, annotation_folder, annotation_folder_basename)
|
|
@@ -410,7 +394,6 @@ def get_COG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, an
|
|
|
410
394
|
annotation_df_absolute_num_handle.write('\t%s\n' % '\t'.join(all_identified_cog_list))
|
|
411
395
|
annotation_df_percentage_handle.write('\t%s\n' % '\t'.join(all_identified_cog_list))
|
|
412
396
|
for annotation_folder in sorted(annotation_folder_list):
|
|
413
|
-
|
|
414
397
|
annotation_folder_basename = annotation_folder.split('_arCOG_wd')[0]
|
|
415
398
|
current_cog_num_dict = cog_num_dict[annotation_folder_basename]
|
|
416
399
|
current_cog_num_pct_dict = cog_num_pct_dict[annotation_folder_basename]
|
|
@@ -441,23 +424,18 @@ def get_COG_annot_df(annotation_dir, stats_level, annotation_df_absolute_num, an
|
|
|
441
424
|
annotation_df_percentage_by_all_handle = open(annotation_df_percentage_by_all, 'w')
|
|
442
425
|
annotation_df_percentage_by_all_handle.write('\t%s\n' % '\t'.join(all_identified_cog_list))
|
|
443
426
|
for annotation_folder in sorted(annotation_folder_list):
|
|
444
|
-
|
|
445
427
|
annotation_folder_basename = annotation_folder.split('_arCOG_wd')[0]
|
|
446
428
|
current_cog_num_pct_by_all_dict = cog_num_pct_by_all_dict[annotation_folder_basename]
|
|
447
429
|
|
|
448
430
|
current_cog_num_list_pct_by_all = []
|
|
449
431
|
for identified_cog in all_identified_cog_list:
|
|
450
|
-
|
|
451
|
-
# get num list
|
|
452
432
|
identified_cog_num_pct_by_all = 0
|
|
453
433
|
if identified_cog in current_cog_num_pct_by_all_dict:
|
|
454
434
|
identified_cog_num_pct_by_all = current_cog_num_pct_by_all_dict[identified_cog]
|
|
455
|
-
|
|
456
435
|
current_cog_num_list_pct_by_all.append(identified_cog_num_pct_by_all)
|
|
457
436
|
|
|
458
437
|
# write out
|
|
459
438
|
annotation_df_percentage_by_all_handle.write('%s\t%s\n' % (annotation_folder_basename, '\t'.join([str(i) for i in current_cog_num_list_pct_by_all])))
|
|
460
|
-
|
|
461
439
|
annotation_df_percentage_by_all_handle.close()
|
|
462
440
|
|
|
463
441
|
|
|
@@ -555,12 +533,10 @@ def arCOG(args):
|
|
|
555
533
|
|
|
556
534
|
# if input is folder
|
|
557
535
|
else:
|
|
558
|
-
# check whether input folder exist
|
|
559
536
|
if os.path.isdir(file_in) is False:
|
|
560
537
|
print(datetime.now().strftime(time_format) + 'input folder not found, program exited')
|
|
561
538
|
exit()
|
|
562
539
|
else:
|
|
563
|
-
# check whether input genome exist
|
|
564
540
|
input_file_re = '%s/*.%s' % (file_in, file_extension)
|
|
565
541
|
input_file_name_list = [os.path.basename(file_name) for file_name in glob.glob(input_file_re)]
|
|
566
542
|
|
|
@@ -610,7 +586,6 @@ def arCOG(args):
|
|
|
610
586
|
|
|
611
587
|
list_for_multiple_arguments_COG = []
|
|
612
588
|
for input_file in input_file_name_list:
|
|
613
|
-
|
|
614
589
|
input_file_basename = '.'.join(input_file.split('.')[:-1])
|
|
615
590
|
pwd_input_file = '%s/%s' % (file_in, input_file)
|
|
616
591
|
|
|
@@ -637,15 +612,12 @@ def arCOG(args):
|
|
|
637
612
|
annotation_df_cog_cate_copy = '%s/%s_arCOG_cate.txt' % (output_folder, file_in_folder_name)
|
|
638
613
|
annotation_df_cog_cate_copy_pct = '%s/%s_arCOG_cate_pct.txt' % (output_folder, file_in_folder_name)
|
|
639
614
|
annotation_df_cog_cate_copy_pct_by_all = '%s/%s_arCOG_cate_pct_by_all.txt' % (output_folder, file_in_folder_name)
|
|
640
|
-
|
|
641
615
|
annotation_df_cog_cate_depth = '%s/%s_arCOG_cate_depth.txt' % (output_folder, file_in_folder_name)
|
|
642
616
|
annotation_df_cog_cate_depth_pct = '%s/%s_arCOG_cate_depth_pct.txt' % (output_folder, file_in_folder_name)
|
|
643
617
|
annotation_df_cog_cate_depth_pct_by_all = '%s/%s_arCOG_cate_depth_pct_by_all.txt' % (output_folder, file_in_folder_name)
|
|
644
|
-
|
|
645
618
|
annotation_df_cog_id_copy = '%s/%s_arCOG_id.txt' % (output_folder, file_in_folder_name)
|
|
646
619
|
annotation_df_cog_id_copy_pct = '%s/%s_arCOG_id_pct.txt' % (output_folder, file_in_folder_name)
|
|
647
620
|
annotation_df_cog_id_copy_pct_by_all = '%s/%s_arCOG_id_pct_by_all.txt' % (output_folder, file_in_folder_name)
|
|
648
|
-
|
|
649
621
|
annotation_df_cog_id_depth = '%s/%s_arCOG_id_depth.txt' % (output_folder, file_in_folder_name)
|
|
650
622
|
annotation_df_cog_id_depth_pct = '%s/%s_arCOG_id_depth_pct.txt' % (output_folder, file_in_folder_name)
|
|
651
623
|
annotation_df_cog_id_depth_pct_by_all = '%s/%s_arCOG_id_depth_pct_by_all.txt' % (output_folder, file_in_folder_name)
|
|
@@ -693,7 +665,7 @@ if __name__ == '__main__':
|
|
|
693
665
|
COG_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
|
|
694
666
|
COG_parser.add_argument('-x', required=False, help='file extension')
|
|
695
667
|
COG_parser.add_argument('-m', required=True, help='sequence type, "N/n" for "nucleotide", "P/p" for "protein"')
|
|
696
|
-
COG_parser.add_argument('-
|
|
668
|
+
COG_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
|
|
697
669
|
COG_parser.add_argument('-pct_by_all', required=False, action='store_true', help='normalize by all query genes, including those without annotation')
|
|
698
670
|
COG_parser.add_argument('-db_dir', required=True, help='COG_db_dir')
|
|
699
671
|
COG_parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default: blastp from NCBI')
|
|
@@ -13,11 +13,11 @@ dbCAN_parser_usage = '''
|
|
|
13
13
|
|
|
14
14
|
# Dependency: hmmer
|
|
15
15
|
|
|
16
|
-
BioSAK dbCAN -m P -t 6 -db_dir
|
|
17
|
-
BioSAK dbCAN -m P -t 6 -db_dir
|
|
16
|
+
BioSAK dbCAN -m P -t 6 -db_dir dbCAN_db_v12 -i recipient.faa
|
|
17
|
+
BioSAK dbCAN -m P -t 6 -db_dir dbCAN_db_v12 -i faa_files -x faa
|
|
18
18
|
|
|
19
19
|
# Prepare DB files (v12):
|
|
20
|
-
cd
|
|
20
|
+
cd dbCAN_db_v12
|
|
21
21
|
wget https://bcb.unl.edu/dbCAN2/download/Databases/V12/hmmscan-parser.sh
|
|
22
22
|
wget https://bcb.unl.edu/dbCAN2/download/Databases/V12/CAZyDB.08062022.fam-activities.txt -O CAZyDB.fam-activities.txt
|
|
23
23
|
wget https://bcb.unl.edu/dbCAN2/download/Databases/V12/dbCAN-HMMdb-V12.txt -O dbCAN-fam-HMMs.txt
|
|
@@ -306,7 +306,7 @@ def dbCAN(args):
|
|
|
306
306
|
file_in = args['i']
|
|
307
307
|
file_extension = args['x']
|
|
308
308
|
sequence_type = args['m']
|
|
309
|
-
depth_file = args['
|
|
309
|
+
depth_file = args['d']
|
|
310
310
|
DB_dir = args['db_dir']
|
|
311
311
|
num_threads = args['t']
|
|
312
312
|
|
|
@@ -461,7 +461,7 @@ if __name__ == '__main__':
|
|
|
461
461
|
dbCAN_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
|
|
462
462
|
dbCAN_parser.add_argument('-x', required=False, help='file extension')
|
|
463
463
|
dbCAN_parser.add_argument('-m', required=False, default='P', help='input sequence type, "N/n" for "nucleotide", "P/p" for "protein"')
|
|
464
|
-
dbCAN_parser.add_argument('-
|
|
464
|
+
dbCAN_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
|
|
465
465
|
dbCAN_parser.add_argument('-db_dir', required=True, help='db folder')
|
|
466
466
|
dbCAN_parser.add_argument('-t', required=False, type=int, default=1, help='number of threads')
|
|
467
467
|
args = vars(dbCAN_parser.parse_args())
|
|
@@ -11,7 +11,9 @@ enrich_usage = '''
|
|
|
11
11
|
|
|
12
12
|
BioSAK enrich -i annotation_files -x txt -g grouping.txt -o output_dir -bc
|
|
13
13
|
|
|
14
|
-
#
|
|
14
|
+
# Note:
|
|
15
|
+
1. The number of genome groups has to be TWO!!!
|
|
16
|
+
2. Group name should NOT be 1 and 0. use some alphabet or words instead.
|
|
15
17
|
|
|
16
18
|
# Example input files:
|
|
17
19
|
https://github.com/songweizhi/BioSAK/tree/master/demo_data/enrich
|
|
@@ -234,16 +236,19 @@ def enrich(args):
|
|
|
234
236
|
ko_id_list = []
|
|
235
237
|
col_index = 0
|
|
236
238
|
for column in column_list:
|
|
237
|
-
if col_index >=
|
|
239
|
+
if col_index >= 1:
|
|
240
|
+
print('Processing %s/%s: %s' % ((col_index - 1), len(column_list)-1, column))
|
|
238
241
|
group1 = df.where(df.Group == group_1_id).dropna()[column]
|
|
239
242
|
group2 = df.where(df.Group == group_2_id).dropna()[column]
|
|
243
|
+
|
|
244
|
+
# to calculate the presence coverage, nothing about the enrichment stats
|
|
240
245
|
group1_no_zero_pct = len(remove_0_from_Pandas_Series(group1))*100/len(group1)
|
|
241
246
|
group2_no_zero_pct = len(remove_0_from_Pandas_Series(group2))*100/len(group2)
|
|
242
247
|
group1_no_zero_pct = float("{0:.2f}".format(group1_no_zero_pct))
|
|
243
248
|
group2_no_zero_pct = float("{0:.2f}".format(group2_no_zero_pct))
|
|
244
249
|
ko_to_group_detected_pct_dict[column] = [group1_no_zero_pct, group2_no_zero_pct]
|
|
245
|
-
|
|
246
|
-
print('
|
|
250
|
+
# print('%s\t%s\t%s' % (column, group_1_id, list(group1)))
|
|
251
|
+
# print('%s\t%s\t%s' % (column, group_2_id, list(group2)))
|
|
247
252
|
|
|
248
253
|
# store group mean into dict
|
|
249
254
|
group1_mean = float("{0:.2f}".format(sum(group1) / len(group1)))
|
|
@@ -271,12 +276,10 @@ def enrich(args):
|
|
|
271
276
|
current_p_adjusted = float("{0:.3f}".format(p_value_list_adjusted[x]))
|
|
272
277
|
current_p_group_mean = [str(i) for i in ko_to_group_mean_dict[ko_id_list[x]]]
|
|
273
278
|
current_p_detected_pct = [str(i) for i in ko_to_group_detected_pct_dict[ko_id_list[x]]]
|
|
274
|
-
|
|
275
279
|
group_1_mean = current_p_group_mean[0]
|
|
276
280
|
group_2_mean = current_p_group_mean[1]
|
|
277
281
|
group_1_no_zero_pct = current_p_detected_pct[0]
|
|
278
282
|
group_2_no_zero_pct = current_p_detected_pct[1]
|
|
279
|
-
|
|
280
283
|
output_test_handle.write('%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' % (ko_id_list[x], group_1_mean, group_1_no_zero_pct, group_2_mean, group_2_no_zero_pct, current_p, current_p_adjusted, ko_desc_dict[ko_id_list[x]]))
|
|
281
284
|
x += 1
|
|
282
285
|
output_test_handle.close()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: BioSAK
|
|
3
|
-
Version: 1.78.
|
|
3
|
+
Version: 1.78.5
|
|
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.78.
|
|
23
|
+
BioSAK v1.78.5
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: BioSAK
|
|
3
|
-
Version: 1.78.
|
|
3
|
+
Version: 1.78.5
|
|
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.78.
|
|
23
|
+
BioSAK v1.78.5
|
|
@@ -139,7 +139,7 @@ if __name__ == '__main__':
|
|
|
139
139
|
COG2020_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
|
|
140
140
|
COG2020_parser.add_argument('-x', required=False, help='file extension')
|
|
141
141
|
COG2020_parser.add_argument('-m', required=True, help='sequence type, "N/n" for "nucleotide", "P/p" for "protein"')
|
|
142
|
-
COG2020_parser.add_argument('-
|
|
142
|
+
COG2020_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
|
|
143
143
|
COG2020_parser.add_argument('-pct_by_all', required=False, action='store_true', help='normalize by all query genes, rather than those with COG assignment')
|
|
144
144
|
COG2020_parser.add_argument('-db_dir', required=True, help='DB folder')
|
|
145
145
|
COG2020_parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default is NCBI blastp')
|
|
@@ -154,7 +154,7 @@ if __name__ == '__main__':
|
|
|
154
154
|
arCOG_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
|
|
155
155
|
arCOG_parser.add_argument('-x', required=False, help='file extension')
|
|
156
156
|
arCOG_parser.add_argument('-m', required=True, help='sequence type, "N/n" for "nucleotide", "P/p" for "protein"')
|
|
157
|
-
arCOG_parser.add_argument('-
|
|
157
|
+
arCOG_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
|
|
158
158
|
arCOG_parser.add_argument('-pct_by_all', required=False, action='store_true', help='normalize by all query genes, rather than those with COG assignment')
|
|
159
159
|
arCOG_parser.add_argument('-db_dir', required=True, help='DB folder')
|
|
160
160
|
arCOG_parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default is NCBI blastp')
|
|
@@ -169,7 +169,7 @@ if __name__ == '__main__':
|
|
|
169
169
|
KEGG_parser.add_argument('-seq_in', required=False, help='faa file')
|
|
170
170
|
KEGG_parser.add_argument('-ko_in', required=False, help='annotation results from BlastKOALA/GhostKOALA, normally with name user_ko.txt')
|
|
171
171
|
KEGG_parser.add_argument('-x', required=False, help='file extension')
|
|
172
|
-
KEGG_parser.add_argument('-
|
|
172
|
+
KEGG_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
|
|
173
173
|
KEGG_parser.add_argument('-pct_by_all', required=False, action='store_true', help='normalize by all query genes, rather than those with ko assignment')
|
|
174
174
|
KEGG_parser.add_argument('-db_dir', required=True, help='folder holds sequence, seq2ko and ko00001.keg files')
|
|
175
175
|
KEGG_parser.add_argument('-diamond', required=False, action='store_true', help='run diamond (for big dataset), default is NCBI blastp')
|
|
@@ -184,7 +184,7 @@ if __name__ == '__main__':
|
|
|
184
184
|
dbCAN_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
|
|
185
185
|
dbCAN_parser.add_argument('-x', required=False, help='file extension')
|
|
186
186
|
dbCAN_parser.add_argument('-m', required=False, default='P', help='The type of input sequences, "N/n" for "nucleotide", "P/p" for "protein"')
|
|
187
|
-
dbCAN_parser.add_argument('-
|
|
187
|
+
dbCAN_parser.add_argument('-d', required=False, default=None, help='gene depth file/folder')
|
|
188
188
|
dbCAN_parser.add_argument('-db_dir', required=True, help='db folder')
|
|
189
189
|
dbCAN_parser.add_argument('-t', required=False, type=int, default=1, help='number of threads')
|
|
190
190
|
args = vars(parser.parse_args())
|
|
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
|
|
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
|