BioSAK 1.78.2__tar.gz → 1.78.3__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.2 → BioSAK-1.78.3}/BioSAK/VERSION +1 -1
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/dbCAN.py +63 -56
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK.egg-info/PKG-INFO +2 -2
- {BioSAK-1.78.2 → BioSAK-1.78.3}/PKG-INFO +2 -2
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/BLCA_op_parser.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/BioSAK_config.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/COG2020.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/COG_boxplot_last1row.R +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/COG_boxplot_last2row.R +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/CheckM.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/ConvertMSA.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/DnaFeaturesViewer.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/FastaSplitler_by_num.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/FastaSplitler_by_size.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/GTDB_for_BLCA.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/Gene2Ctg.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/KEGG.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/KEGG_boxplot_last1row.R +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/KEGG_get_eukaryotic_kos.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/KeepRemovingTmp.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/MeanMappingDepth.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/MetaBiosample.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/MetaCHIP_phylo.hmm +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/MetaCyc_reactions_with_ec.txt +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/NetEnzymes.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/Newick_tree_plotter.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/OneLineAln.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/Prodigal.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/Reads_simulator.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/RunGraphMB.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/SILVA_for_BLCA.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/SankeyTaxon.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/SliceMSA.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/SubsampleLongReads.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/Tax4Fun2IndOTU.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/VisBlastOp.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/VisGeneFlk.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/__init__.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/arCOG.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/bam2reads.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/boxplot_last1row.R +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/boxplot_matrix_COG.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/boxplot_matrix_COG_backup.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/boxplot_matrix_KEGG.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/boxplot_matrix_dbCAN.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/cat_fa.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/cdd2cog.pl +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/checkm_marker.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/compare_trees.R +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/compare_trees.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/cross_link_seqs.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/download_GenBank_genome_subset_prokaryotes_csv.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/dwnld_sra_reads.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/enrich.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/exe_cmds.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/ezaai2mat.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/fa2id.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/fa2phy.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/fa2tree.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/format_converter.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/format_leaf_name.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/fq2fa.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/gbk2faa.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/gbk2ffn.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/gbk2fna.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/gbk_to_ffn_faa.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_EC_from_ko_stats_D.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_GTDB_taxon_gnm.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_MAG_reads_long.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_Pfam_hmms.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_SCG_tree.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_TopHits_taxonomy.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_aa_composition.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_bin_abundance copy.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_data_matrix.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_gc.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_gene_depth.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_genome_GTDB.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_genome_NCBI.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_genome_NCBI_v1.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_genome_NCBI_v2.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_gnm_size.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_ko_gene_seqs.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_krona_plot.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_reads_from_sam.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_reads_id_in_sam.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_sankey_plot.R +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_top_hit.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/get_total_length.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/global_functions.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/hpc3.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/iTOL.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/js_cmds.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/js_hpc3.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/keep_best_hit.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/ko00001.keg +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/koala.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/label_tree.R +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/label_tree.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/link_16S_MAG.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/magabund.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/magabund2.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/manipulator_fasta.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/manipulator_msa.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/manipulator_newick.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/manipulator_sam.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/mean_MAG_cov.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/merge_seq.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/metaAssembly.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/metabat2concoct.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/metabat2maxbin.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/msa_to_distance_matrix.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/ncbi_dataset.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/odp.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/parse_MetaCyc_RxnDB.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/parse_mmseqs_tsv.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/plot_mag.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/plot_sam_depth.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/plot_tree.R +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/prefix_file.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/prokka.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/reads2bam.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/rename_leaves.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/rename_reads_for_Reago.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/rename_seq.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/rename_seqs.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/ribbon.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/sam2bam.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/sampling_GTDB_gnms.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/select_seq.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/sep_reads_by_barcode.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/slice_seq.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/split_fasta.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/split_folder.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/split_sam.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/submitHPC.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/subset_GTDB_meta.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/subset_tree.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/top_16S_hits.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/top_hits_in_a_group.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK/usearch_uc.py +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK.egg-info/SOURCES.txt +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK.egg-info/dependency_links.txt +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK.egg-info/requires.txt +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/BioSAK.egg-info/top_level.txt +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/LICENSE +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/MANIFEST.in +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/README.md +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/bin/BioSAK +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/setup.cfg +0 -0
- {BioSAK-1.78.2 → BioSAK-1.78.3}/setup.py +0 -0
|
@@ -1,41 +1,26 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
1
|
import os
|
|
4
2
|
import glob
|
|
3
|
+
import shutil
|
|
5
4
|
import argparse
|
|
6
5
|
from Bio import SeqIO
|
|
7
6
|
import multiprocessing as mp
|
|
8
7
|
from datetime import datetime
|
|
9
8
|
from Bio.SeqRecord import SeqRecord
|
|
10
|
-
from BioSAK.global_functions import time_format
|
|
11
|
-
from BioSAK.global_functions import force_create_folder
|
|
12
|
-
from BioSAK.global_functions import sep_path_basename_ext
|
|
13
|
-
from BioSAK.global_functions import AnnotateNorm
|
|
14
9
|
|
|
15
10
|
|
|
16
11
|
dbCAN_parser_usage = '''
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
BioSAK dbCAN -m N -t 6 -db_dir /srv/scratch/z5039045/DB/dbCAN_V9 -i recipient.ffn
|
|
30
|
-
BioSAK dbCAN -m N -t 6 -db_dir /srv/scratch/z5039045/DB/dbCAN_V9 -i ffn_files -x ffn
|
|
31
|
-
|
|
32
|
-
# Prepare DB files (versions V9):
|
|
33
|
-
cd path/to/your/dbCAN_db_dir
|
|
34
|
-
wget http://bcb.unl.edu/dbCAN2/download/Databases/V9/hmmscan-parser.sh
|
|
35
|
-
wget http://bcb.unl.edu/dbCAN2/download/Databases/V9/CAZyDB.07302020.fam-activities.txt
|
|
36
|
-
wget http://bcb.unl.edu/dbCAN2/download/Databases/V9/dbCAN-HMMdb-V9.txt
|
|
37
|
-
mv CAZyDB.07302020.fam-activities.txt CAZyDB.fam-activities.txt
|
|
38
|
-
mv dbCAN-HMMdb-V9.txt dbCAN-fam-HMMs.txt
|
|
12
|
+
================================================ dbCAN example commands ================================================
|
|
13
|
+
|
|
14
|
+
# Dependency: hmmer
|
|
15
|
+
|
|
16
|
+
BioSAK dbCAN -m P -t 6 -db_dir dbCAN3_db_v12 -i recipient.faa
|
|
17
|
+
BioSAK dbCAN -m P -t 6 -db_dir dbCAN3_db_v12 -i faa_files -x faa
|
|
18
|
+
|
|
19
|
+
# Prepare DB files (v12):
|
|
20
|
+
cd dbCAN3_db_v12
|
|
21
|
+
wget https://bcb.unl.edu/dbCAN2/download/Databases/V12/hmmscan-parser.sh
|
|
22
|
+
wget https://bcb.unl.edu/dbCAN2/download/Databases/V12/CAZyDB.08062022.fam-activities.txt -O CAZyDB.fam-activities.txt
|
|
23
|
+
wget https://bcb.unl.edu/dbCAN2/download/Databases/V12/dbCAN-HMMdb-V12.txt -O dbCAN-fam-HMMs.txt
|
|
39
24
|
hmmpress dbCAN-fam-HMMs.txt
|
|
40
25
|
|
|
41
26
|
# How it works:
|
|
@@ -53,9 +38,50 @@ Name of the depth file needs to be exactly the same as its corresponding sequenc
|
|
|
53
38
|
gene_1 30
|
|
54
39
|
gene_2 10.58
|
|
55
40
|
|
|
56
|
-
|
|
41
|
+
========================================================================================================================
|
|
57
42
|
'''
|
|
58
43
|
|
|
44
|
+
time_format = '[%Y-%m-%d %H:%M:%S] '
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def force_create_folder(folder_to_create):
|
|
48
|
+
if os.path.isdir(folder_to_create):
|
|
49
|
+
shutil.rmtree(folder_to_create, ignore_errors=True)
|
|
50
|
+
os.mkdir(folder_to_create)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def sep_path_basename_ext(file_in):
|
|
54
|
+
|
|
55
|
+
f_path, file_name = os.path.split(file_in)
|
|
56
|
+
if f_path == '':
|
|
57
|
+
f_path = '.'
|
|
58
|
+
f_base, f_ext = os.path.splitext(file_name)
|
|
59
|
+
|
|
60
|
+
return f_path, f_base, f_ext
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def AnnotateNorm(file_in, skip_header, value_column, Divisor_value, file_out, file_out_header):
|
|
64
|
+
|
|
65
|
+
file_out_handle = open(file_out, 'w')
|
|
66
|
+
file_out_handle.write(file_out_header)
|
|
67
|
+
line_num = 0
|
|
68
|
+
for each_line in open(file_in):
|
|
69
|
+
|
|
70
|
+
each_line_split = each_line.strip().split('\t')
|
|
71
|
+
value_str = each_line_split[value_column - 1]
|
|
72
|
+
|
|
73
|
+
if (skip_header is True and line_num > 0) or (skip_header is False):
|
|
74
|
+
|
|
75
|
+
value_pct = 0
|
|
76
|
+
if Divisor_value != 0:
|
|
77
|
+
value_pct = float(value_str) * 100 / Divisor_value
|
|
78
|
+
each_line_split[value_column - 1] = str(float("{0:.2f}".format(value_pct)))
|
|
79
|
+
file_out_handle.write('%s\n' % '\t'.join(each_line_split))
|
|
80
|
+
|
|
81
|
+
line_num += 1
|
|
82
|
+
|
|
83
|
+
file_out_handle.close()
|
|
84
|
+
|
|
59
85
|
|
|
60
86
|
def dna2aa(dna_file, aa_file):
|
|
61
87
|
query_aa_handle = open(aa_file, 'w')
|
|
@@ -93,17 +119,9 @@ def dbCAN_worker(argument_list):
|
|
|
93
119
|
print('Specified input sequence type unrecognizable, program exited!')
|
|
94
120
|
exit()
|
|
95
121
|
|
|
96
|
-
hmmscan_cmd
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
hmmscan_parser_cmd = "sh %s %s/%s.out.dm > %s/%s.out.dm.ps" % (pwd_hmmscan_parser, current_output_folder,
|
|
101
|
-
input_seq_no_ext, current_output_folder,
|
|
102
|
-
input_seq_no_ext)
|
|
103
|
-
|
|
104
|
-
final_cat_cmd = "cat %s/%s.out.dm.ps | awk '$5<1e-18&&$10>0.35' > %s/%s.out.dm.ps.stringent" % (current_output_folder, input_seq_no_ext,
|
|
105
|
-
current_output_folder, input_seq_no_ext)
|
|
106
|
-
|
|
122
|
+
hmmscan_cmd = "hmmscan --domtblout %s/%s.out.dm %s %s > %s/%s.out" % (current_output_folder, input_seq_no_ext, pwd_dbCAN_fam_HMMs, input_seq_aa, current_output_folder, input_seq_no_ext)
|
|
123
|
+
hmmscan_parser_cmd = "sh %s %s/%s.out.dm > %s/%s.out.dm.ps" % (pwd_hmmscan_parser, current_output_folder, input_seq_no_ext, current_output_folder, input_seq_no_ext)
|
|
124
|
+
final_cat_cmd = "cat %s/%s.out.dm.ps | awk '$5<1e-18&&$10>0.35' > %s/%s.out.dm.ps.stringent" % (current_output_folder, input_seq_no_ext, current_output_folder, input_seq_no_ext)
|
|
107
125
|
os.system(hmmscan_cmd)
|
|
108
126
|
os.system(hmmscan_parser_cmd)
|
|
109
127
|
os.system(final_cat_cmd)
|
|
@@ -161,7 +179,6 @@ def dbCAN_worker(argument_list):
|
|
|
161
179
|
|
|
162
180
|
# write out
|
|
163
181
|
pwd_annotation_results_handle.write('%s\t%s\t%s\n' % (query_id, matched_hmm, matched_hmm_activities))
|
|
164
|
-
|
|
165
182
|
pwd_annotation_results_handle.close()
|
|
166
183
|
|
|
167
184
|
#################### get summary of annotation results GeneNumber ####################
|
|
@@ -172,14 +189,12 @@ def dbCAN_worker(argument_list):
|
|
|
172
189
|
for each_hmm in hmm_to_gene_member_dict:
|
|
173
190
|
each_hmm_id = each_hmm.split('.hmm')[0]
|
|
174
191
|
each_hmm_GeneNumber = len(hmm_to_gene_member_dict[each_hmm_id])
|
|
175
|
-
|
|
176
192
|
each_hmm_activities = 'NA'
|
|
177
193
|
matched_hmm_id_no_underscore = each_hmm_id
|
|
178
194
|
if '_' in matched_hmm_id_no_underscore:
|
|
179
195
|
matched_hmm_id_no_underscore = matched_hmm_id_no_underscore.split('_')[0]
|
|
180
196
|
if matched_hmm_id_no_underscore in fam_to_activities_dict:
|
|
181
197
|
each_hmm_activities = fam_to_activities_dict[matched_hmm_id_no_underscore]
|
|
182
|
-
|
|
183
198
|
pwd_annotation_results_stats_GeneNumber_handle.write('%s\t%s\t%s\n' % (each_hmm_id, each_hmm_GeneNumber, each_hmm_activities))
|
|
184
199
|
total_GeneNumber_identified += each_hmm_GeneNumber
|
|
185
200
|
pwd_annotation_results_stats_GeneNumber_handle.close()
|
|
@@ -211,7 +226,6 @@ def dbCAN_worker(argument_list):
|
|
|
211
226
|
|
|
212
227
|
pwd_annotation_results_stats_TotalDepth_handle.write('%s\t%s\t%s\n' % (each_hmm_id, each_hmm_TotalDepth, each_hmm_activities))
|
|
213
228
|
total_depth_identified += each_hmm_TotalDepth
|
|
214
|
-
|
|
215
229
|
pwd_annotation_results_stats_TotalDepth_handle.close()
|
|
216
230
|
|
|
217
231
|
#################### get summary of annotation results TotalDepth pct ####################
|
|
@@ -265,7 +279,6 @@ def get_dbCAN_annot_df(annotation_dir, annotation_df_absolute_num, annotation_df
|
|
|
265
279
|
annotation_df_absolute_num_handle.write('\t%s\n' % '\t'.join(all_identified_cazy_family_list))
|
|
266
280
|
annotation_df_percentage_handle.write('\t%s\n' % '\t'.join(all_identified_cazy_family_list))
|
|
267
281
|
for annotation_folder in sorted(annotation_folder_list):
|
|
268
|
-
|
|
269
282
|
annotation_folder_basename = annotation_folder.split('_dbCAN_wd')[0]
|
|
270
283
|
current_annotation_cazy_num_dict = cazy_family_to_num_dict[annotation_folder_basename]
|
|
271
284
|
current_annotation_cazy_num_pct_dict = cazy_family_to_num_pct_dict[annotation_folder_basename]
|
|
@@ -346,12 +359,10 @@ def dbCAN(args):
|
|
|
346
359
|
|
|
347
360
|
# if input is folder
|
|
348
361
|
else:
|
|
349
|
-
|
|
350
362
|
# check whether input folder exist
|
|
351
363
|
if os.path.isdir(file_in) is False:
|
|
352
364
|
print(datetime.now().strftime(time_format) + 'input folder not found, program exited!')
|
|
353
365
|
exit()
|
|
354
|
-
|
|
355
366
|
else:
|
|
356
367
|
# check whether input genome exist
|
|
357
368
|
input_file_re = '%s/*.%s' % (file_in, file_extension)
|
|
@@ -394,11 +405,11 @@ def dbCAN(args):
|
|
|
394
405
|
else:
|
|
395
406
|
file_in_folder_name = file_in
|
|
396
407
|
|
|
397
|
-
output_folder
|
|
398
|
-
annotation_df_GeneNumber
|
|
399
|
-
annotation_df_GeneNumber_pct
|
|
400
|
-
annotation_df_TotalDepth
|
|
401
|
-
annotation_df_TotalDepth_pct
|
|
408
|
+
output_folder = '%s_dbCAN_wd' % file_in_folder_name
|
|
409
|
+
annotation_df_GeneNumber = '%s/%s_GeneNumber.txt' % (output_folder, file_in_folder_name)
|
|
410
|
+
annotation_df_GeneNumber_pct = '%s/%s_GeneNumber_pct.txt' % (output_folder, file_in_folder_name)
|
|
411
|
+
annotation_df_TotalDepth = '%s/%s_TotalDepth.txt' % (output_folder, file_in_folder_name)
|
|
412
|
+
annotation_df_TotalDepth_pct = '%s/%s_TotalDepth_pct.txt' % (output_folder, file_in_folder_name)
|
|
402
413
|
|
|
403
414
|
# create output folder
|
|
404
415
|
force_create_folder(output_folder)
|
|
@@ -447,15 +458,11 @@ def dbCAN(args):
|
|
|
447
458
|
if __name__ == '__main__':
|
|
448
459
|
|
|
449
460
|
dbCAN_parser = argparse.ArgumentParser(usage=dbCAN_parser_usage)
|
|
450
|
-
|
|
451
|
-
# arguments for COG_parser
|
|
452
461
|
dbCAN_parser.add_argument('-i', required=True, help='path to input sequences (in multi-fasta format)')
|
|
453
462
|
dbCAN_parser.add_argument('-x', required=False, help='file extension')
|
|
454
463
|
dbCAN_parser.add_argument('-m', required=False, default='P', help='input sequence type, "N/n" for "nucleotide", "P/p" for "protein"')
|
|
455
464
|
dbCAN_parser.add_argument('-depth', required=False, default=None, help='gene depth file/folder')
|
|
456
465
|
dbCAN_parser.add_argument('-db_dir', required=True, help='db folder')
|
|
457
466
|
dbCAN_parser.add_argument('-t', required=False, type=int, default=1, help='number of threads')
|
|
458
|
-
|
|
459
467
|
args = vars(dbCAN_parser.parse_args())
|
|
460
|
-
|
|
461
468
|
dbCAN(args)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: BioSAK
|
|
3
|
-
Version: 1.78.
|
|
3
|
+
Version: 1.78.3
|
|
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.3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: BioSAK
|
|
3
|
-
Version: 1.78.
|
|
3
|
+
Version: 1.78.3
|
|
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.3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|