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.
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/VERSION +3 -3
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/arCOG.py +48 -69
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/PKG-INFO +2 -2
- {BioSAK-1.95.0 → BioSAK-1.95.2}/PKG-INFO +2 -2
- {BioSAK-1.95.0 → BioSAK-1.95.2}/bin/BioSAK +5 -1
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/BLCA_op_parser.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/BioSAK_config.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/COG2020.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/COG_boxplot_last1row.R +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/COG_boxplot_last2row.R +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/CheckM.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/DnaFeaturesViewer.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/FastaSplitler_by_num.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/FastaSplitler_by_size.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/GTDB_for_BLCA.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/Gene2Ctg.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/KEGG.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/KEGG_boxplot_last1row.R +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/KEGG_get_eukaryotic_kos.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/KeepRemovingTmp.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/MeanMappingDepth.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/MetaBiosample.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/MetaCHIP_phylo.hmm +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/MetaCyc_reactions_with_ec.txt +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/NetEnzymes.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/Prodigal.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/Reads_simulator.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/RunGraphMB.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/SILVA_for_BLCA.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/SankeyTaxon.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/SubsampleLongReads.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/Tax4Fun2IndOTU.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/VisBlastOp.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/VisGeneFlk.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/__init__.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/add_desc.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/bam2reads.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_last1row.R +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_matrix_COG.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_matrix_COG_backup.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_matrix_KEGG.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/boxplot_matrix_dbCAN.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/cat_fa.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/cdd2cog.pl +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/checkm_marker.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/compare_sets.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/count_num.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/cross_link_seqs.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/dbCAN.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/download_GenBank_genome_subset_prokaryotes_csv.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/dwnld_sra_reads.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/enrich.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/exe_cmds.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/ezaai2mat.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/fa2id.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/fastaai.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/format_converter.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/fq2fa.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gapseq.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk2faa.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk2ffn.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk2fna.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk2gff.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gbk_to_ffn_faa.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gc.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_EC_from_ko_stats_D.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_GTDB_taxon_gnm.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_MAG_reads_long.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_Pfam_hmms.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_TopHits_taxonomy.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_aa_composition.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_bin_abundance copy.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_data_matrix.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_gene_depth.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_genome_GTDB.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_genome_NCBI.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_genome_NCBI_v1.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_genome_NCBI_v2.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_gnm_size.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_ko_gene_seqs.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_krona_plot.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_reads_from_sam.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_reads_id_in_sam.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_top_hit.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/get_total_length.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/gff2chrom.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/global_functions.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/hpc3.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/js_cmds.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/js_hpc3.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/keep_best_hit.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/ko00001.keg +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/koala.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/link_16S_MAG.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/magabund.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/magabund2.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/manipulator_fasta.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/manipulator_msa.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/manipulator_newick.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/manipulator_sam.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/mann_whitney_u.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/mean_MAG_cov.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/merge_df.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/merge_seq.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/metaAssembly.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/metabat2concoct.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/metabat2maxbin.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/msa_to_distance_matrix.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/ncbi_dataset.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/odp.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/parse_MetaCyc_RxnDB.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/parse_mmseqs_tsv.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/plot_mag.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/plot_sam_depth.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/plot_tree.R +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/prefix_file.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/prefix_seq_by_file_name.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/prokka.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/reads2bam.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/rename_reads_for_Reago.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/rename_seq.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/ribbon.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sam2bam.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sampling_GTDB_gnms.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sankey.R +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sankey.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/select_seq.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/sep_reads_by_barcode.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/slice_seq.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/split_fasta.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/split_folder.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/split_sam.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/srun.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/statsTaxa.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/stats_arcog.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/stats_ko.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/submitHPC.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/subset_GTDB_meta.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/subset_df.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/subset_tree.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/tmp_1.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/tmp_2.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/tmp_3.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/top_16S_hits.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/top_hits_in_a_group.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/transpose.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/usearch_uc.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK/wilcox.py +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/SOURCES.txt +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/dependency_links.txt +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/requires.txt +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/BioSAK.egg-info/top_level.txt +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/LICENSE +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/MANIFEST.in +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/README.md +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/setup.cfg +0 -0
- {BioSAK-1.95.0 → BioSAK-1.95.2}/setup.py +0 -0
|
@@ -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
|
-
#
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
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
|
|
581
|
-
|
|
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
|
-
|
|
600
|
-
|
|
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
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
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.
|
|
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.
|
|
23
|
+
BioSAK v1.95.2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: BioSAK
|
|
3
|
-
Version: 1.95.
|
|
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.
|
|
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,
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|