BioSAK 1.98.2__tar.gz → 1.99.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/SankeyTaxon.py +1 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/VERSION +4 -1
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/sra.py +25 -5
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/tmp_3.py +0 -3
- BioSAK-1.99.0/BioSAK/vis_color_scheme.py +78 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK.egg-info/PKG-INFO +2 -2
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK.egg-info/SOURCES.txt +1 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/PKG-INFO +2 -2
- {BioSAK-1.98.2 → BioSAK-1.99.0}/bin/BioSAK +10 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/BLCA_op_parser.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/BioSAK_config.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/COG2020.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/COG_boxplot_last1row.R +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/COG_boxplot_last2row.R +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/CheckM.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/Combine_KEGG_arCOG.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/DendroDF.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/DnaFeaturesViewer.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/FastaSplitler_by_num.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/FastaSplitler_by_size.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/GTDB_for_BLCA.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/Gene2Ctg.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/KEGG.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/KEGG_boxplot_last1row.R +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/KEGG_get_eukaryotic_kos.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/KeepRemovingTmp.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/MeanMappingDepth.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/MetaBiosample.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/MetaCHIP_phylo.hmm +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/MetaCyc_reactions_with_ec.txt +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/NetEnzymes.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/Prodigal.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/Reads_simulator.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/RunGraphMB.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/SILVA_for_BLCA.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/SubsampleLongReads.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/Tax4Fun2IndOTU.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/UNITE_for_BLCA.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/VisBlastOp.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/VisGeneFlk.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/__init__.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/add_desc.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/arCOG.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/bam2reads.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/boxplot.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/boxplot_last1row.R +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/boxplot_matrix_COG.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/boxplot_matrix_COG_backup.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/boxplot_matrix_KEGG.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/boxplot_matrix_dbCAN.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/cat_fa.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/cdd2cog.pl +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/checkm_marker.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/compare_sets.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/count_num.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/cross_link_seqs.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/dbCAN.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/download_GenBank_genome_subset_prokaryotes_csv.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/enrich.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/exe_cmds.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/ezaai2mat.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/fa2id.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/fastaai.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/format_converter.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/fq2fa.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/gapseq.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/gbk2faa.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/gbk2ffn.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/gbk2fna.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/gbk2gff.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/gbk_to_ffn_faa.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/gc.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_EC_from_ko_stats_D.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_GTDB_taxon_gnm.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_MAG_reads_long.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_Pfam_hmms.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_TopHits_taxonomy.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_aa_composition.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_bin_abundance copy.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_data_matrix.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_gene_depth.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_genome_GTDB.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_genome_NCBI.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_genome_NCBI_v1.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_genome_NCBI_v2.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_gnm_size.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_ko_gene_seqs.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_krona_plot.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_reads_from_sam.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_reads_id_in_sam.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_top_hit.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/get_total_length.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/gff2chrom.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/global_functions.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/hpc3.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/js_cmds.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/js_hpc3.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/keep_best_hit.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/ko00001.keg +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/koala.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/link_16S_MAG.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/magabund.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/magabund2.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/manipulator_fasta.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/manipulator_msa.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/manipulator_newick.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/manipulator_sam.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/mann_whitney_u.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/mean_MAG_cov.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/merge_df.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/merge_seq.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/metaAssembly.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/metabat2concoct.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/metabat2maxbin.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/msa_to_distance_matrix.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/ncbi_dataset.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/odp.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/parse_MetaCyc_RxnDB.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/parse_mmseqs_tsv.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/plot_mag.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/plot_sam_depth.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/plot_tree.R +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/prefix_file.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/prefix_seq_by_file_name.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/prokka.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/reads2bam.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/rename_reads_for_Reago.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/rename_seq.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/ribbon.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/sam2bam.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/sampling_GTDB_gnms.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/sankey.R +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/sankey.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/select_seq.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/sep_reads_by_barcode.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/slice_seq.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/split_fasta.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/split_folder.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/split_sam.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/srun.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/statsTaxa.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/stats_arcog.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/stats_ko.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/submitHPC.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/subset_GTDB_meta.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/subset_df.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/subset_tree.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/tmp_1.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/tmp_2.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/top_16S_hits.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/top_hits_in_a_group.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/transpose.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/usearch_uc.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK/wilcox.py +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK.egg-info/dependency_links.txt +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK.egg-info/requires.txt +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/BioSAK.egg-info/top_level.txt +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/LICENSE +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/MANIFEST.in +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/README.md +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/setup.cfg +0 -0
- {BioSAK-1.98.2 → BioSAK-1.99.0}/setup.py +0 -0
|
@@ -146,6 +146,7 @@ def SankeyTaxon(args):
|
|
|
146
146
|
if plot_height < 600:
|
|
147
147
|
plot_height = 600
|
|
148
148
|
|
|
149
|
+
print('Rscript %s -f %s -x %s -y %s' % (pwd_get_sankey_plot_R, output_file_txt, plot_width, plot_height))
|
|
149
150
|
os.system('Rscript %s -f %s -x %s -y %s' % (pwd_get_sankey_plot_R, output_file_txt, plot_width, plot_height))
|
|
150
151
|
|
|
151
152
|
|
|
@@ -20,6 +20,9 @@ def sra(args):
|
|
|
20
20
|
num_threads = args['t']
|
|
21
21
|
force_create_op_dir = args['f']
|
|
22
22
|
|
|
23
|
+
fasterq_dump_tmp = '%s/fasterq_dump_tmp' % op_dir
|
|
24
|
+
cmd_txt = '%s/cmds.txt' % op_dir
|
|
25
|
+
|
|
23
26
|
# create output folder
|
|
24
27
|
if os.path.isdir(op_dir) is True:
|
|
25
28
|
if force_create_op_dir is True:
|
|
@@ -28,20 +31,37 @@ def sra(args):
|
|
|
28
31
|
print('Output folder detected, program exited!')
|
|
29
32
|
exit()
|
|
30
33
|
os.system('mkdir %s' % op_dir)
|
|
34
|
+
os.system('mkdir %s' % fasterq_dump_tmp)
|
|
31
35
|
|
|
32
36
|
id_set = set()
|
|
33
37
|
for each_id in open(id_txt):
|
|
34
38
|
id_set.add(each_id.strip().split()[0])
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
prefetch_cmd_list = []
|
|
41
|
+
fasterq_dump_cmd_list = []
|
|
37
42
|
for each_id in id_set:
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
prefetch_cmd = 'prefetch %s -O %s' % (each_id, op_dir)
|
|
44
|
+
fasterq_dump_cmd = 'fasterq-dump %s/%s --split-3 -O %s -t %s' % (op_dir, each_id, op_dir, fasterq_dump_tmp)
|
|
45
|
+
prefetch_cmd_list.append(prefetch_cmd)
|
|
46
|
+
fasterq_dump_cmd_list.append(fasterq_dump_cmd)
|
|
47
|
+
|
|
48
|
+
# write out commands
|
|
49
|
+
cmd_txt_handle = open(cmd_txt, 'w')
|
|
50
|
+
for each in sorted(prefetch_cmd_list):
|
|
51
|
+
cmd_txt_handle.write(each + '\n')
|
|
52
|
+
for each in sorted(fasterq_dump_cmd_list):
|
|
53
|
+
cmd_txt_handle.write(each + '\n')
|
|
54
|
+
cmd_txt_handle.close()
|
|
40
55
|
|
|
41
56
|
# download files with multiprocessing
|
|
42
|
-
os.chdir(op_dir)
|
|
43
57
|
pool = mp.Pool(processes=num_threads)
|
|
44
|
-
pool.map(os.system,
|
|
58
|
+
pool.map(os.system, prefetch_cmd_list)
|
|
59
|
+
pool.close()
|
|
60
|
+
pool.join()
|
|
61
|
+
|
|
62
|
+
# extract fastq file from SRA with multiprocessing
|
|
63
|
+
pool = mp.Pool(processes=num_threads)
|
|
64
|
+
pool.map(os.system, fasterq_dump_cmd_list)
|
|
45
65
|
pool.close()
|
|
46
66
|
pool.join()
|
|
47
67
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import matplotlib as mpl
|
|
3
|
+
mpl.use('Agg')
|
|
4
|
+
import matplotlib.pyplot as plt
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
vis_color_scheme_usage = '''
|
|
8
|
+
=================== vis_color_scheme example commands ===================
|
|
9
|
+
|
|
10
|
+
BioSAK vis_color_scheme -i lineage.txt -c tax_color.txt -o output.pdf
|
|
11
|
+
BioSAK vis_color_scheme -i Sponge_full_lineage_GTDB_format.txt -c color_code_sponge.txt -o color_code_sponge.pdf
|
|
12
|
+
|
|
13
|
+
=========================================================================
|
|
14
|
+
'''
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def vis_color_scheme(args):
|
|
18
|
+
|
|
19
|
+
tax_full_lineage_txt = args['i']
|
|
20
|
+
tax_to_color_txt = args['c']
|
|
21
|
+
output_plot = args['o']
|
|
22
|
+
|
|
23
|
+
# read in taxon to color info
|
|
24
|
+
taxon_to_color_dict = dict()
|
|
25
|
+
for each_taxon in open(tax_to_color_txt):
|
|
26
|
+
each_taxon_split = each_taxon.strip().split('\t')
|
|
27
|
+
taxon_to_color_dict[each_taxon_split[0]] = each_taxon_split[1]
|
|
28
|
+
|
|
29
|
+
max_lineage_len = 0
|
|
30
|
+
full_lineage_list = []
|
|
31
|
+
max_label_len = 0
|
|
32
|
+
for each_lineage in open(tax_full_lineage_txt):
|
|
33
|
+
each_lineage_split = each_lineage.strip().split(';')
|
|
34
|
+
if len(each_lineage_split) > max_lineage_len:
|
|
35
|
+
max_lineage_len = len(each_lineage_split)
|
|
36
|
+
full_lineage_list.append(each_lineage_split)
|
|
37
|
+
for each_rank in each_lineage_split:
|
|
38
|
+
if len(each_rank) > max_label_len:
|
|
39
|
+
max_label_len = len(each_rank)
|
|
40
|
+
|
|
41
|
+
fig = plt.figure(1, figsize=(42, 22))
|
|
42
|
+
ax = fig.add_subplot(111)
|
|
43
|
+
|
|
44
|
+
y_pos = 0.97
|
|
45
|
+
for each_lineage in full_lineage_list:
|
|
46
|
+
x_pos = 0.005
|
|
47
|
+
for each_rank in each_lineage:
|
|
48
|
+
current_color = taxon_to_color_dict.get(each_rank, 'white')
|
|
49
|
+
|
|
50
|
+
if current_color == 'white':
|
|
51
|
+
label_txt = each_rank
|
|
52
|
+
label_txt += ' '*((max_label_len - len(each_rank)) + 10)
|
|
53
|
+
else:
|
|
54
|
+
extra_space_str = ' '*(max_label_len - len(each_rank))
|
|
55
|
+
label_txt = '%s %s(%s)' % (each_rank, extra_space_str, current_color)
|
|
56
|
+
|
|
57
|
+
if current_color == 'white':
|
|
58
|
+
ax.text(x_pos, y_pos, label_txt, color='black', family='monospace', bbox=dict(facecolor=current_color, edgecolor='black'))
|
|
59
|
+
else:
|
|
60
|
+
ax.text(x_pos, y_pos, label_txt, color='black', family='monospace', bbox=dict(facecolor=current_color, edgecolor=current_color))
|
|
61
|
+
|
|
62
|
+
x_pos += (1/max_lineage_len)
|
|
63
|
+
y_pos -= (1/(len(full_lineage_list)+2))
|
|
64
|
+
|
|
65
|
+
# export plot
|
|
66
|
+
plt.margins(tight=True)
|
|
67
|
+
plt.savefig(output_plot, dpi=1000)
|
|
68
|
+
plt.close()
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
if __name__ == '__main__':
|
|
72
|
+
|
|
73
|
+
vis_color_scheme_parser = argparse.ArgumentParser(usage=vis_color_scheme_usage)
|
|
74
|
+
vis_color_scheme_parser.add_argument('-i', required=True, help='lineage file')
|
|
75
|
+
vis_color_scheme_parser.add_argument('-c', required=True, help='taxon color file')
|
|
76
|
+
vis_color_scheme_parser.add_argument('-o', required=True, help='output pdf')
|
|
77
|
+
args = vars(vis_color_scheme_parser.parse_args())
|
|
78
|
+
vis_color_scheme(args)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: BioSAK
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.99.0
|
|
4
4
|
Summary: BioSAK
|
|
5
5
|
Home-page: https://github.com/songweizhi/BioSAK
|
|
6
6
|
Author: Weizhi Song
|
|
@@ -20,4 +20,4 @@ Requires-Dist: beautifulsoup4
|
|
|
20
20
|
Requires-Dist: ete3
|
|
21
21
|
Requires-Dist: statsmodels
|
|
22
22
|
|
|
23
|
-
BioSAK v1.
|
|
23
|
+
BioSAK v1.99.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: BioSAK
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.99.0
|
|
4
4
|
Summary: BioSAK
|
|
5
5
|
Home-page: https://github.com/songweizhi/BioSAK
|
|
6
6
|
Author: Weizhi Song
|
|
@@ -20,4 +20,4 @@ Requires-Dist: beautifulsoup4
|
|
|
20
20
|
Requires-Dist: ete3
|
|
21
21
|
Requires-Dist: statsmodels
|
|
22
22
|
|
|
23
|
-
BioSAK v1.
|
|
23
|
+
BioSAK v1.99.0
|
|
@@ -131,6 +131,7 @@ def print_main_help():
|
|
|
131
131
|
compare_sets -> compare_sets
|
|
132
132
|
sankey -> get sankey plot
|
|
133
133
|
sra -> Download reads with sratoolkit
|
|
134
|
+
vis_color_scheme -> Visualize color scheme
|
|
134
135
|
|
|
135
136
|
1. Phylogenetic tree-related modules have been moved to TreeSAK
|
|
136
137
|
2. Upgrade with: pip3 install --upgrade BioSAK
|
|
@@ -1059,6 +1060,15 @@ if __name__ == '__main__':
|
|
|
1059
1060
|
args = vars(parser.parse_args())
|
|
1060
1061
|
sra.sra(args)
|
|
1061
1062
|
|
|
1063
|
+
elif sys.argv[1] == 'vis_color_scheme':
|
|
1064
|
+
from BioSAK import vis_color_scheme
|
|
1065
|
+
vis_color_scheme_parser = subparsers.add_parser('vis_color_scheme', usage=vis_color_scheme.vis_color_scheme_usage)
|
|
1066
|
+
vis_color_scheme_parser.add_argument('-i', required=True, help='lineage file')
|
|
1067
|
+
vis_color_scheme_parser.add_argument('-c', required=True, help='taxon color file')
|
|
1068
|
+
vis_color_scheme_parser.add_argument('-o', required=True, help='output pdf')
|
|
1069
|
+
args = vars(parser.parse_args())
|
|
1070
|
+
vis_color_scheme.vis_color_scheme(args)
|
|
1071
|
+
|
|
1062
1072
|
else:
|
|
1063
1073
|
print('Unrecognized module: %s, program exited' % sys.argv[1])
|
|
1064
1074
|
exit()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|