BioSAK 1.130.2__tar.gz → 1.131.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.130.2 → biosak-1.131.0}/BioSAK/VERSION +4 -1
- biosak-1.131.0/BioSAK/cluster_df.py +34 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/dbCAN3.py +13 -3
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_genome.py +1 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/subset_df.py +17 -2
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/tmp_1.py +13 -4
- biosak-1.131.0/PKG-INFO +11 -0
- {biosak-1.130.2 → biosak-1.131.0}/bin/BioSAK +11 -2
- biosak-1.131.0/biosak.egg-info/PKG-INFO +11 -0
- {biosak-1.130.2 → biosak-1.131.0}/biosak.egg-info/SOURCES.txt +1 -6
- biosak-1.130.2/BioSAK/COG_boxplot_last1row.R +0 -104
- biosak-1.130.2/BioSAK/COG_boxplot_last2row.R +0 -223
- biosak-1.130.2/BioSAK/KEGG_boxplot_last1row.R +0 -101
- biosak-1.130.2/BioSAK/boxplot_last1row.R +0 -93
- biosak-1.130.2/BioSAK/plot_tree.R +0 -51
- biosak-1.130.2/LICENSE +0 -674
- biosak-1.130.2/PKG-INFO +0 -24
- biosak-1.130.2/biosak.egg-info/PKG-INFO +0 -24
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/BLCA_op_parser.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/BioSAK_config.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/COG2020.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/COG2024.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/CheckM.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/Combine_KEGG_COG.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/Combine_KEGG_arCOG.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/DendroDF.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/DnaFeaturesViewer.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/FastaSplitler_by_num.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/FastaSplitler_by_size.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/FasterqDump.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/GTDB_for_BLCA.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/GenBank.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/Gene2Ctg.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/KEGG.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/KEGG_get_eukaryotic_kos.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/KeepRemovingTmp.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/MeanMappingDepth.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/MetaCHIP_phylo.hmm +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/MetaCyc_reactions_with_ec.txt +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/NetEnzymes.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/PebbleScout.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/Prodigal.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/Reads_simulator.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/RunGraphMB.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/SILVA_for_BLCA.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/SankeyTaxon.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/SubsampleLongReads.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/Tax4Fun2IndOTU.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/UNITE_for_BLCA.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/Usearch16S.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/VisBlastOp.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/VisGeneFlk.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/__init__.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/abd.backup.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/abd.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/abd_16s_amplicon.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/abd_16s_metagenome.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/abd_mask.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/abd_rename_and_combine.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/abund.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/add_desc.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/arCOG.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/bam2reads.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/biosample.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/blast.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/blca.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/blca_generate_abundance_table.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/blca_main.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/blca_subset_db_acc.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/blca_subset_db_gg.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/boxplot.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/boxplot_matrix_COG.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/boxplot_matrix_COG_backup.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/boxplot_matrix_KEGG.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/boxplot_matrix_dbCAN.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/cat_fa.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/cdb.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/cdb_to_itol_piechart.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/cdd2cog.pl +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/checkm_marker.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/combine_fun_stats.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/combine_low_abd_otu.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/compare.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/count_num.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/cross_link_seqs.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/dbCAN.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/download_GenBank_genome_subset_prokaryotes_csv.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/enrich.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/exe_cmds.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/ezaai2mat.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/fa2id.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/fastaai.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/format_converter.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/fq2fa.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/gapseq.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/gbk2faa.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/gbk2ffn.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/gbk2fna.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/gbk2gff.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/gbk_to_ffn_faa.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/gc.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_EC_from_ko_stats_D.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_GTDB_taxon_gnm.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_MAG_reads_long.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_Pfam_hmms.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_TopHits_taxonomy.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_aa_composition.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_abd1_mask.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_abd3_stats.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_bin_abundance copy.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_data_matrix.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_eu_otu.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_gene_depth.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_gnm_size.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_ko_gene_seqs.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_krona_plot.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_reads_from_sam.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_reads_id_in_sam.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_single_page_web.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_top_hit.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/get_total_length.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/gff2chrom.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/global_functions.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/hpc4.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/js_cmds.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/js_hpc3.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/keep_best_hit.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/ko00001.keg +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/koala.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/link_16S_MAG.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/link_16s.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/magabund.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/magabund2.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/manipulator_fasta.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/manipulator_msa.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/manipulator_newick.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/manipulator_sam.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/mann_whitney_u.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/mean_MAG_cov.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/merge_df.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/merge_seq.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/metaAssembly.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/metaBiosample.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/metabat2concoct.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/metabat2maxbin.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/metadata.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/mmseqs.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/msa_to_distance_matrix.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/ncbi_dataset.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/odp.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/parse_MetaCyc_RxnDB.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/parse_mmseqs_tsv.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/plot_mag.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/plot_sam_depth.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/prefix_file.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/prefix_seq_by_file_name.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/prokka.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/rc.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/reads2bam.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/rename_df_row.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/rename_reads_for_Reago.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/rename_seq.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/ribbon.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/rm_desc.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/rm_low_abd_otu.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/rm_low_depth_sample.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/rm_short.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/rstudio_color.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/sam2bam.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/sampling_GTDB_gnms.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/sankey.R +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/sankey.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/select_seqs.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/sep_reads_by_barcode.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/slice_seq.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/split_fa.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/split_folder.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/split_sam.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/sra.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/sra2biosample.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/srun.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/statsTaxa.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/stats_arcog.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/stats_blast_hit.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/stats_cog2024.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/stats_ko.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/submitHPC.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/subset_GTDB_meta.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/subset_gene_by_gnm.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/subset_tree.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/taxdump.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/top_16S_hits.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/top_hits_in_a_group.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/transpose.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/trim.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/usearch_uc.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/vis_color_scheme.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/BioSAK/wilcox.py +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/MANIFEST.in +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/README.md +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/biosak.egg-info/dependency_links.txt +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/biosak.egg-info/requires.txt +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/biosak.egg-info/top_level.txt +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/setup.cfg +0 -0
- {biosak-1.130.2 → biosak-1.131.0}/setup.py +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import argparse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
cluster_df_usage = '''
|
|
6
|
+
======== cluster_df example command ========
|
|
7
|
+
|
|
8
|
+
BioSAK cluster_df -i matrix.txt -o op.pdf
|
|
9
|
+
|
|
10
|
+
============================================
|
|
11
|
+
'''
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def cluster_df(args):
|
|
15
|
+
|
|
16
|
+
file_in = args['i']
|
|
17
|
+
file_out = args['o']
|
|
18
|
+
|
|
19
|
+
pwd_self = os.path.realpath(__file__)
|
|
20
|
+
self_path = '/'.join(pwd_self.split('/')[:-1])
|
|
21
|
+
pwd_cluster_df_R = '%s/cluster_df.R' % self_path
|
|
22
|
+
|
|
23
|
+
r_cmd = 'Rscript %s -i %s -o %s' % (pwd_cluster_df_R, file_in, file_out)
|
|
24
|
+
print(r_cmd)
|
|
25
|
+
os.system(r_cmd)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == '__main__':
|
|
29
|
+
|
|
30
|
+
cluster_df_parser = argparse.ArgumentParser(usage=cluster_df_usage)
|
|
31
|
+
cluster_df_parser.add_argument('-i', required=True, help='input data matrix file')
|
|
32
|
+
cluster_df_parser.add_argument('-o', required=True, help='output plot file')
|
|
33
|
+
args = vars(cluster_df_parser.parse_args())
|
|
34
|
+
cluster_df(args)
|
|
@@ -48,7 +48,7 @@ def dbCAN3_worker(argument_list):
|
|
|
48
48
|
os.system(dbcan3_cmd)
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
def get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_with_desc):
|
|
51
|
+
def get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_with_desc, op_stats_dir):
|
|
52
52
|
|
|
53
53
|
# read in CAZyDB.fam-activities.txt
|
|
54
54
|
cazy_desc_dict = {}
|
|
@@ -136,6 +136,15 @@ def get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_wit
|
|
|
136
136
|
op_df_txt_handle.close()
|
|
137
137
|
op_df_txt_with_desc_handle.close()
|
|
138
138
|
|
|
139
|
+
# write out stats file for each genome
|
|
140
|
+
for each_gnm in stats_dod:
|
|
141
|
+
stast_txt = '%s/%s.txt' % (op_stats_dir, each_gnm)
|
|
142
|
+
current_dict = stats_dod[each_gnm]
|
|
143
|
+
stast_txt_handle = open(stast_txt, 'w')
|
|
144
|
+
for each_id in sorted(list(current_dict.keys())):
|
|
145
|
+
stast_txt_handle.write('%s\t%s\t%s\n' % (each_id, current_dict[each_id], cazy_desc_dict.get(each_id, 'na')))
|
|
146
|
+
stast_txt_handle.close()
|
|
147
|
+
|
|
139
148
|
|
|
140
149
|
def dbCAN3(args):
|
|
141
150
|
|
|
@@ -188,6 +197,7 @@ def dbCAN3(args):
|
|
|
188
197
|
################################################### define file name ###################################################
|
|
189
198
|
|
|
190
199
|
tmp_dir = '%s/tmp' % op_dir
|
|
200
|
+
stats_dir = '%s/stats_files' % op_dir
|
|
191
201
|
op_df_txt = '%s/dbCAN3_df.txt' % op_dir
|
|
192
202
|
op_df_txt_with_desc = '%s/dbCAN3_df_with_desc.txt' % op_dir
|
|
193
203
|
os.system('mkdir %s' % tmp_dir)
|
|
@@ -206,7 +216,7 @@ def dbCAN3(args):
|
|
|
206
216
|
list_for_multiple_arguments_dbCAN3.append([pwd_input_faa, input_file_basename, current_op_dir, DB_dir, 1])
|
|
207
217
|
overview_file_list.append(overview_file)
|
|
208
218
|
|
|
209
|
-
# run
|
|
219
|
+
# run dbCAN3 annotaion files with multiprocessing
|
|
210
220
|
pool = mp.Pool(processes=num_threads)
|
|
211
221
|
pool.map(dbCAN3_worker, list_for_multiple_arguments_dbCAN3)
|
|
212
222
|
pool.close()
|
|
@@ -215,7 +225,7 @@ def dbCAN3(args):
|
|
|
215
225
|
######################################################### get dataframe #########################################################
|
|
216
226
|
|
|
217
227
|
# get dataframe
|
|
218
|
-
get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_with_desc)
|
|
228
|
+
get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_with_desc, stats_dir)
|
|
219
229
|
|
|
220
230
|
print(datetime.now().strftime(time_format) + 'Done!')
|
|
221
231
|
|
|
@@ -120,6 +120,7 @@ def get_genome(args):
|
|
|
120
120
|
datasets_worker_arg_lol.append([gnm_id, output_folder])
|
|
121
121
|
|
|
122
122
|
# run with multiprocessing
|
|
123
|
+
print('running with multiprocessing')
|
|
123
124
|
pool = mp.Pool(processes=num_threads)
|
|
124
125
|
pool.map(datasets_worker, datasets_worker_arg_lol)
|
|
125
126
|
pool.close()
|
|
@@ -102,11 +102,26 @@ def subset_df(args):
|
|
|
102
102
|
current_D_desc = ' '.join(each_line_split[7:])
|
|
103
103
|
col_desc_dict[current_D_id] = '%s__%s' % (current_D_id, current_D_desc)
|
|
104
104
|
elif col_desc_txt_name == 'CAZyDB.fam-activities.txt':
|
|
105
|
-
for each_fam in open(
|
|
105
|
+
for each_fam in open(col_desc_txt):
|
|
106
106
|
each_fam_split = each_fam.strip().split(' ')
|
|
107
107
|
if len(each_fam_split) == 2:
|
|
108
108
|
fam_id = each_fam_split[0]
|
|
109
109
|
fam_activities = each_fam_split[1]
|
|
110
|
+
fam_activities = fam_activities.replace('\t', '_')
|
|
111
|
+
fam_activities = fam_activities.replace(' ', '_')
|
|
112
|
+
fam_activities = fam_activities.replace('_/_', '/')
|
|
113
|
+
fam_activities = fam_activities.replace(';_', ';')
|
|
114
|
+
fam_activities = fam_activities.replace('_(', '(')
|
|
115
|
+
fam_activities = fam_activities.replace(');;', ');')
|
|
116
|
+
fam_activities = fam_activities.replace('._', '.')
|
|
117
|
+
fam_activities = fam_activities.replace('EC_', 'EC')
|
|
118
|
+
fam_activities = fam_activities.replace(':_', ':')
|
|
119
|
+
fam_activities = fam_activities.replace(';_', ';')
|
|
120
|
+
fam_activities = fam_activities.replace(',_', ',')
|
|
121
|
+
fam_activities = fam_activities.replace(':', '_')
|
|
122
|
+
fam_activities = fam_activities.replace('_;', ';')
|
|
123
|
+
fam_activities = fam_activities.replace('_[', '[')
|
|
124
|
+
fam_activities = fam_activities.strip()
|
|
110
125
|
col_desc_dict[fam_id] = fam_activities
|
|
111
126
|
col_desc_dict[fam_id] = '%s__%s' % (fam_id, fam_activities)
|
|
112
127
|
else:
|
|
@@ -228,7 +243,7 @@ def subset_df(args):
|
|
|
228
243
|
# rename columns
|
|
229
244
|
if len(col_desc_dict) > 0:
|
|
230
245
|
current_columns = subset_df.columns.tolist()
|
|
231
|
-
new_columns = [col_desc_dict
|
|
246
|
+
new_columns = [col_desc_dict.get(i, i) for i in current_columns]
|
|
232
247
|
subset_df.columns = new_columns
|
|
233
248
|
|
|
234
249
|
# rename rows
|
|
@@ -13,7 +13,8 @@ def sep_path_basename_ext(file_in):
|
|
|
13
13
|
return f_name, f_path, f_base, f_ext
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_with_desc):
|
|
16
|
+
def get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_with_desc, op_stats_dir):
|
|
17
|
+
|
|
17
18
|
# read in CAZyDB.fam-activities.txt
|
|
18
19
|
cazy_desc_dict = {}
|
|
19
20
|
for each_fam in open(cazy_fam_activities_txt):
|
|
@@ -100,19 +101,27 @@ def get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_wit
|
|
|
100
101
|
op_df_txt_handle.close()
|
|
101
102
|
op_df_txt_with_desc_handle.close()
|
|
102
103
|
|
|
104
|
+
# write out stats file for each genome
|
|
105
|
+
for each_gnm in stats_dod:
|
|
106
|
+
stast_txt = '%s/%s.txt' % (op_stats_dir, each_gnm)
|
|
107
|
+
current_dict = stats_dod[each_gnm]
|
|
108
|
+
stast_txt_handle = open(stast_txt, 'w')
|
|
109
|
+
for each_id in sorted(list(current_dict.keys())):
|
|
110
|
+
stast_txt_handle.write('%s\t%s\t%s\n' % (each_id, current_dict[each_id], cazy_desc_dict.get(each_id, 'na')))
|
|
111
|
+
stast_txt_handle.close()
|
|
103
112
|
|
|
104
113
|
|
|
105
114
|
file_dir = '/Users/songweizhi/Desktop/overview_files'
|
|
106
115
|
file_ext = 'txt'
|
|
107
116
|
|
|
108
|
-
file_re = '%s/*.%s' % (file_dir, file_ext)
|
|
109
117
|
|
|
118
|
+
file_re = '%s/*.%s' % (file_dir, file_ext)
|
|
110
119
|
overview_file_list = glob.glob(file_re)
|
|
111
120
|
|
|
112
121
|
|
|
113
|
-
|
|
114
122
|
cazy_fam_activities_txt = '/Users/songweizhi/DB/dbcan3/CAZyDB.fam-activities.txt'
|
|
115
123
|
op_df_txt = '/Users/songweizhi/Desktop/annotation_dbCAN3_df.txt'
|
|
116
124
|
op_df_txt_with_desc = '/Users/songweizhi/Desktop/annotation_dbCAN3_df_desc.txt'
|
|
125
|
+
op_stats_dir = '/Users/songweizhi/Desktop/annotation_dbCAN3_stats'
|
|
117
126
|
|
|
118
|
-
get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_with_desc)
|
|
127
|
+
get_df(overview_file_list, cazy_fam_activities_txt, op_df_txt, op_df_txt_with_desc, op_stats_dir)
|
biosak-1.131.0/PKG-INFO
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 1.0
|
|
2
|
+
Name: biosak
|
|
3
|
+
Version: 1.131.0
|
|
4
|
+
Summary: BioSAK
|
|
5
|
+
Home-page: https://github.com/songweizhi/BioSAK
|
|
6
|
+
Author: Weizhi Song
|
|
7
|
+
Author-email: songwz03@gmail.com
|
|
8
|
+
License: GPL3+
|
|
9
|
+
Description: BioSAK v1.131.0
|
|
10
|
+
Keywords: Bioinformatics
|
|
11
|
+
Platform: UNKNOWN
|
|
@@ -134,7 +134,8 @@ def print_main_help():
|
|
|
134
134
|
wilcox -> Wilcoxon signed-rank test (non-parametric paired T-test)
|
|
135
135
|
mannwhitneyu -> Mann-Whitney U rank test on two independent samples
|
|
136
136
|
rename_df_row -> Rename row headers in a dataframe
|
|
137
|
-
|
|
137
|
+
cluster_df -> Cluster rows and columns of a data matrix
|
|
138
|
+
|
|
138
139
|
Files and folders
|
|
139
140
|
split_folder -> Split folder
|
|
140
141
|
prefix_file -> Prefix file
|
|
@@ -185,7 +186,7 @@ if __name__ == '__main__':
|
|
|
185
186
|
exit()
|
|
186
187
|
|
|
187
188
|
elif sys.argv[1] in ['iTOL', 'SliceMSA', 'ConvertMSA', 'fa2phy', 'PhyloBiAssoc', 'OneLineAln']:
|
|
188
|
-
print('
|
|
189
|
+
print('%s has moved to TreeSAK, program exited!' % sys.argv[1])
|
|
189
190
|
exit()
|
|
190
191
|
|
|
191
192
|
elif sys.argv[1] == 'COG2020':
|
|
@@ -1415,6 +1416,14 @@ if __name__ == '__main__':
|
|
|
1415
1416
|
args = vars(parser.parse_args())
|
|
1416
1417
|
biosample.biosample(args)
|
|
1417
1418
|
|
|
1419
|
+
elif sys.argv[1] == 'cluster_df':
|
|
1420
|
+
from BioSAK import cluster_df
|
|
1421
|
+
cluster_df_parser = subparsers.add_parser('cluster_df', usage=cluster_df.cluster_df_usage)
|
|
1422
|
+
cluster_df_parser.add_argument('-i', required=True, help='input data matrix file')
|
|
1423
|
+
cluster_df_parser.add_argument('-o', required=True, help='output plot file')
|
|
1424
|
+
args = vars(parser.parse_args())
|
|
1425
|
+
cluster_df.cluster_df(args)
|
|
1426
|
+
|
|
1418
1427
|
else:
|
|
1419
1428
|
print('Unrecognized module: %s, program exited' % sys.argv[1])
|
|
1420
1429
|
exit()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 1.0
|
|
2
|
+
Name: biosak
|
|
3
|
+
Version: 1.131.0
|
|
4
|
+
Summary: BioSAK
|
|
5
|
+
Home-page: https://github.com/songweizhi/BioSAK
|
|
6
|
+
Author: Weizhi Song
|
|
7
|
+
Author-email: songwz03@gmail.com
|
|
8
|
+
License: GPL3+
|
|
9
|
+
Description: BioSAK v1.131.0
|
|
10
|
+
Keywords: Bioinformatics
|
|
11
|
+
Platform: UNKNOWN
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
LICENSE
|
|
2
1
|
MANIFEST.in
|
|
3
2
|
README.md
|
|
4
3
|
setup.py
|
|
@@ -6,8 +5,6 @@ BioSAK/BLCA_op_parser.py
|
|
|
6
5
|
BioSAK/BioSAK_config.py
|
|
7
6
|
BioSAK/COG2020.py
|
|
8
7
|
BioSAK/COG2024.py
|
|
9
|
-
BioSAK/COG_boxplot_last1row.R
|
|
10
|
-
BioSAK/COG_boxplot_last2row.R
|
|
11
8
|
BioSAK/CheckM.py
|
|
12
9
|
BioSAK/Combine_KEGG_COG.py
|
|
13
10
|
BioSAK/Combine_KEGG_arCOG.py
|
|
@@ -20,7 +17,6 @@ BioSAK/GTDB_for_BLCA.py
|
|
|
20
17
|
BioSAK/GenBank.py
|
|
21
18
|
BioSAK/Gene2Ctg.py
|
|
22
19
|
BioSAK/KEGG.py
|
|
23
|
-
BioSAK/KEGG_boxplot_last1row.R
|
|
24
20
|
BioSAK/KEGG_get_eukaryotic_kos.py
|
|
25
21
|
BioSAK/KeepRemovingTmp.py
|
|
26
22
|
BioSAK/MeanMappingDepth.py
|
|
@@ -59,7 +55,6 @@ BioSAK/blca_main.py
|
|
|
59
55
|
BioSAK/blca_subset_db_acc.py
|
|
60
56
|
BioSAK/blca_subset_db_gg.py
|
|
61
57
|
BioSAK/boxplot.py
|
|
62
|
-
BioSAK/boxplot_last1row.R
|
|
63
58
|
BioSAK/boxplot_matrix_COG.py
|
|
64
59
|
BioSAK/boxplot_matrix_COG_backup.py
|
|
65
60
|
BioSAK/boxplot_matrix_KEGG.py
|
|
@@ -69,6 +64,7 @@ BioSAK/cdb.py
|
|
|
69
64
|
BioSAK/cdb_to_itol_piechart.py
|
|
70
65
|
BioSAK/cdd2cog.pl
|
|
71
66
|
BioSAK/checkm_marker.py
|
|
67
|
+
BioSAK/cluster_df.py
|
|
72
68
|
BioSAK/combine_fun_stats.py
|
|
73
69
|
BioSAK/combine_low_abd_otu.py
|
|
74
70
|
BioSAK/compare.py
|
|
@@ -145,7 +141,6 @@ BioSAK/parse_MetaCyc_RxnDB.py
|
|
|
145
141
|
BioSAK/parse_mmseqs_tsv.py
|
|
146
142
|
BioSAK/plot_mag.py
|
|
147
143
|
BioSAK/plot_sam_depth.py
|
|
148
|
-
BioSAK/plot_tree.R
|
|
149
144
|
BioSAK/prefix_file.py
|
|
150
145
|
BioSAK/prefix_seq_by_file_name.py
|
|
151
146
|
BioSAK/prokka.py
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
check.packages <- function(pkg){
|
|
3
|
-
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
|
|
4
|
-
if (length(new.pkg))
|
|
5
|
-
install.packages(new.pkg, dependencies = TRUE)
|
|
6
|
-
sapply(pkg, require, character.only = 1)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# install packages if not
|
|
11
|
-
packages<-c("optparse", "ggplot2")
|
|
12
|
-
invisible(suppressMessages(check.packages(packages)))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
############################################### Usage example ##############################################
|
|
16
|
-
|
|
17
|
-
# !!! COG annotation results for the HGTs must be in the last one row
|
|
18
|
-
# Rscript ~/Dropbox/R_scripts/for_plot/COG_summary_boxplot_last1row.R -i matrix.csv -o plot.png
|
|
19
|
-
|
|
20
|
-
############################################################################################################
|
|
21
|
-
|
|
22
|
-
option_list = list(
|
|
23
|
-
|
|
24
|
-
make_option(c("-i", "--input"),
|
|
25
|
-
type="character",
|
|
26
|
-
help="input file name",
|
|
27
|
-
metavar="character"),
|
|
28
|
-
|
|
29
|
-
make_option(c("-o", "--out"),
|
|
30
|
-
type="character",
|
|
31
|
-
help="output plot name",
|
|
32
|
-
metavar="character"));
|
|
33
|
-
|
|
34
|
-
opt_parser = OptionParser(option_list=option_list);
|
|
35
|
-
opt = parse_args(opt_parser);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
############################################### read in data ###############################################
|
|
39
|
-
|
|
40
|
-
my_data = read.csv(opt$input, row.names = 1)
|
|
41
|
-
|
|
42
|
-
# remove columns with all zero values
|
|
43
|
-
my_data = my_data[, colSums(my_data != 0) > 0]
|
|
44
|
-
|
|
45
|
-
# slice dataframe
|
|
46
|
-
row_num = dim(my_data)[1]
|
|
47
|
-
input_genomes_COG = my_data[1:(row_num-1),]
|
|
48
|
-
HGT_COG = my_data[row_num,]
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
######################################### get shape and color list #########################################
|
|
52
|
-
|
|
53
|
-
shape_list = c()
|
|
54
|
-
color_list = c()
|
|
55
|
-
for(each_col in names(my_data)){
|
|
56
|
-
each_col_quatile = quantile(my_data[each_col][1:(row_num-1),])
|
|
57
|
-
each_col_quatile_low = each_col_quatile[[2]]
|
|
58
|
-
each_col_quatile_high = each_col_quatile[[4]]
|
|
59
|
-
each_col_HGT = my_data[each_col][row_num,]
|
|
60
|
-
|
|
61
|
-
current_shape = ''
|
|
62
|
-
current_color = ''
|
|
63
|
-
if ((each_col_HGT - each_col_quatile_high) > 0){
|
|
64
|
-
current_shape = 24
|
|
65
|
-
current_color = 'firebrick2'
|
|
66
|
-
} else if ((each_col_HGT - each_col_quatile_low) < 0){
|
|
67
|
-
current_shape = 25
|
|
68
|
-
current_color = 'deepskyblue'
|
|
69
|
-
} else {
|
|
70
|
-
current_shape = 22
|
|
71
|
-
current_color = 'black'
|
|
72
|
-
}
|
|
73
|
-
# add current shape and color to their list
|
|
74
|
-
shape_list = c(shape_list, current_shape)
|
|
75
|
-
color_list = c(color_list, current_color)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
################################################# get plot #################################################
|
|
79
|
-
|
|
80
|
-
png(filename=opt$out, units="in", width=9, height=6, pointsize=10, res=300)
|
|
81
|
-
|
|
82
|
-
ggplot() +
|
|
83
|
-
geom_boxplot(data = stack(my_data[1:(row_num-1),]), aes(x = ind, y = values)) +
|
|
84
|
-
|
|
85
|
-
geom_point(data = data.frame(x = factor(colnames(my_data)),
|
|
86
|
-
y = as.numeric(my_data[row_num,])),
|
|
87
|
-
aes(x=x, y=y),
|
|
88
|
-
color = color_list, fill = color_list,
|
|
89
|
-
shape = shape_list,
|
|
90
|
-
stroke = 0.8, size = 2.5) +
|
|
91
|
-
|
|
92
|
-
theme_bw() + # white background
|
|
93
|
-
theme(panel.border = element_blank(),
|
|
94
|
-
panel.grid.major = element_blank(),
|
|
95
|
-
panel.grid.minor = element_blank(),
|
|
96
|
-
axis.line = element_line(colour = "black"),
|
|
97
|
-
axis.text.x = element_text(colour="black",size=6,angle=270,hjust=0,vjust=.5,face="plain"),
|
|
98
|
-
axis.text.y = element_text(colour="black",size=6,angle=0,hjust=0,vjust=0,face="plain"),
|
|
99
|
-
axis.title.x = element_text(colour="black",size=6,angle=0,hjust=.5,vjust=0,face="plain"),
|
|
100
|
-
axis.title.y = element_text(colour="black",size=6,angle=90,hjust=.5,vjust=0,face="plain"))+
|
|
101
|
-
labs(x = "Category", y = 'Proportion') # label of x and y axis
|
|
102
|
-
|
|
103
|
-
invisible(dev.off())
|
|
104
|
-
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
check.packages <- function(pkg){
|
|
3
|
-
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
|
|
4
|
-
if (length(new.pkg))
|
|
5
|
-
install.packages(new.pkg, dependencies = TRUE)
|
|
6
|
-
sapply(pkg, require, character.only = 1)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# install packages if not
|
|
11
|
-
packages<-c("optparse", "ggplot2")
|
|
12
|
-
invisible(suppressMessages(check.packages(packages)))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
##################################### Usage example #####################################
|
|
16
|
-
|
|
17
|
-
# Rscript ~/Rscripts/COG_summary_boxplot.R -i COG_summary_47bins_in_percent.csv -o HGT_COG.png
|
|
18
|
-
# COG annotation results for the HGTs must be in the last two rows
|
|
19
|
-
|
|
20
|
-
#########################################################################################
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
get_shape_list_blast = function(csv_file){
|
|
24
|
-
# read in dataframe from csv file
|
|
25
|
-
my_data = read.csv(csv_file, row.names = 1)
|
|
26
|
-
|
|
27
|
-
# get the number of rows and columns
|
|
28
|
-
row_num = dim(my_data)[1]
|
|
29
|
-
col_num = dim(my_data)[2]
|
|
30
|
-
|
|
31
|
-
# slice dataframe
|
|
32
|
-
input_genomes_COG = my_data[1:(row_num-2),]
|
|
33
|
-
HGT_COG = my_data[row_num-1,]
|
|
34
|
-
|
|
35
|
-
# get color list
|
|
36
|
-
shape_list = c()
|
|
37
|
-
for(each_col in names(my_data)){
|
|
38
|
-
#each_col_mean = mean(my_data[each_col][1:(row_num-2),])
|
|
39
|
-
each_col_quatile = quantile(my_data[each_col][1:(row_num-2),])
|
|
40
|
-
each_col_quatile_low = each_col_quatile[[2]]
|
|
41
|
-
each_col_quatile_high = each_col_quatile[[4]]
|
|
42
|
-
|
|
43
|
-
each_col_HGT = my_data[each_col][row_num-1,]
|
|
44
|
-
#compare = each_col_HGT - each_col_mean
|
|
45
|
-
current_shape = ''
|
|
46
|
-
if ((each_col_HGT - each_col_quatile_high) > 0){
|
|
47
|
-
current_shape = 24
|
|
48
|
-
} else if ((each_col_HGT - each_col_quatile_low) < 0){
|
|
49
|
-
current_shape = 25
|
|
50
|
-
} else {
|
|
51
|
-
current_shape = 22
|
|
52
|
-
}
|
|
53
|
-
shape_list = c(shape_list, current_shape)
|
|
54
|
-
}
|
|
55
|
-
return(shape_list)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
get_shape_list_tree = function(csv_file){
|
|
60
|
-
# read in dataframe from csv file
|
|
61
|
-
my_data = read.csv(csv_file, row.names = 1)
|
|
62
|
-
|
|
63
|
-
# get the number of rows and columns
|
|
64
|
-
row_num = dim(my_data)[1]
|
|
65
|
-
col_num = dim(my_data)[2]
|
|
66
|
-
|
|
67
|
-
# slice dataframe
|
|
68
|
-
input_genomes_COG = my_data[1:(row_num-2),]
|
|
69
|
-
HGT_COG = my_data[row_num,]
|
|
70
|
-
|
|
71
|
-
# get color list
|
|
72
|
-
shape_list = c()
|
|
73
|
-
for(each_col in names(my_data)){
|
|
74
|
-
each_col_mean = mean(my_data[each_col][1:(row_num-2),])
|
|
75
|
-
each_col_quatile = quantile(my_data[each_col][1:(row_num-2),])
|
|
76
|
-
each_col_quatile_low = each_col_quatile[[2]]
|
|
77
|
-
each_col_quatile_high = each_col_quatile[[4]]
|
|
78
|
-
|
|
79
|
-
each_col_HGT = my_data[each_col][row_num,]
|
|
80
|
-
#compare = each_col_HGT - each_col_mean
|
|
81
|
-
current_shape = ''
|
|
82
|
-
if ((each_col_HGT - each_col_quatile_high) > 0){
|
|
83
|
-
current_shape = 24
|
|
84
|
-
} else if ((each_col_HGT - each_col_quatile_low) < 0){
|
|
85
|
-
current_shape = 25
|
|
86
|
-
} else {
|
|
87
|
-
current_shape = 22
|
|
88
|
-
}
|
|
89
|
-
shape_list = c(shape_list, current_shape)
|
|
90
|
-
}
|
|
91
|
-
return(shape_list)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
get_color_list_blast = function(csv_file){
|
|
96
|
-
# read in dataframe from csv file
|
|
97
|
-
my_data = read.csv(csv_file, row.names = 1)
|
|
98
|
-
|
|
99
|
-
# get the number of rows and columns
|
|
100
|
-
row_num = dim(my_data)[1]
|
|
101
|
-
col_num = dim(my_data)[2]
|
|
102
|
-
|
|
103
|
-
# slice dataframe
|
|
104
|
-
input_genomes_COG = my_data[1:(row_num-2),]
|
|
105
|
-
HGT_COG = my_data[row_num-1,]
|
|
106
|
-
|
|
107
|
-
# get color list
|
|
108
|
-
shape_list = c()
|
|
109
|
-
for(each_col in names(my_data)){
|
|
110
|
-
#each_col_mean = mean(my_data[each_col][1:(row_num-2),])
|
|
111
|
-
each_col_quatile = quantile(my_data[each_col][1:(row_num-2),])
|
|
112
|
-
each_col_quatile_low = each_col_quatile[[2]]
|
|
113
|
-
each_col_quatile_high = each_col_quatile[[4]]
|
|
114
|
-
|
|
115
|
-
each_col_HGT = my_data[each_col][row_num-1,]
|
|
116
|
-
#compare = each_col_HGT - each_col_mean
|
|
117
|
-
current_shape = ''
|
|
118
|
-
if ((each_col_HGT - each_col_quatile_high) > 0){
|
|
119
|
-
current_shape = 'black'
|
|
120
|
-
} else if ((each_col_HGT - each_col_quatile_low) < 0){
|
|
121
|
-
current_shape = 'black'
|
|
122
|
-
} else {
|
|
123
|
-
current_shape = 'black'
|
|
124
|
-
}
|
|
125
|
-
shape_list = c(shape_list, current_shape)
|
|
126
|
-
}
|
|
127
|
-
return(shape_list)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
get_color_list_tree = function(csv_file){
|
|
132
|
-
# read in dataframe from csv file
|
|
133
|
-
my_data = read.csv(csv_file, row.names = 1)
|
|
134
|
-
|
|
135
|
-
# get the number of rows and columns
|
|
136
|
-
row_num = dim(my_data)[1]
|
|
137
|
-
col_num = dim(my_data)[2]
|
|
138
|
-
|
|
139
|
-
# slice dataframe
|
|
140
|
-
input_genomes_COG = my_data[1:(row_num-2),]
|
|
141
|
-
HGT_COG = my_data[row_num,]
|
|
142
|
-
|
|
143
|
-
# get color list
|
|
144
|
-
shape_list = c()
|
|
145
|
-
for(each_col in names(my_data)){
|
|
146
|
-
each_col_mean = mean(my_data[each_col][1:(row_num-2),])
|
|
147
|
-
each_col_quatile = quantile(my_data[each_col][1:(row_num-2),])
|
|
148
|
-
each_col_quatile_low = each_col_quatile[[2]]
|
|
149
|
-
each_col_quatile_high = each_col_quatile[[4]]
|
|
150
|
-
|
|
151
|
-
each_col_HGT = my_data[each_col][row_num,]
|
|
152
|
-
#compare = each_col_HGT - each_col_mean
|
|
153
|
-
current_shape = ''
|
|
154
|
-
if ((each_col_HGT - each_col_quatile_high) > 0){
|
|
155
|
-
current_shape = 'black'
|
|
156
|
-
} else if ((each_col_HGT - each_col_quatile_low) < 0){
|
|
157
|
-
current_shape = 'black'
|
|
158
|
-
} else {
|
|
159
|
-
current_shape = 'black'
|
|
160
|
-
}
|
|
161
|
-
shape_list = c(shape_list, current_shape)
|
|
162
|
-
}
|
|
163
|
-
return(shape_list)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
option_list = list(
|
|
168
|
-
|
|
169
|
-
make_option(c("-i", "--input"),
|
|
170
|
-
type="character",
|
|
171
|
-
help="input file name",
|
|
172
|
-
metavar="character"),
|
|
173
|
-
|
|
174
|
-
make_option(c("-o", "--out"),
|
|
175
|
-
type="character",
|
|
176
|
-
help="output plot name",
|
|
177
|
-
metavar="character"));
|
|
178
|
-
|
|
179
|
-
opt_parser = OptionParser(option_list=option_list);
|
|
180
|
-
opt = parse_args(opt_parser);
|
|
181
|
-
|
|
182
|
-
csv_file = opt$input
|
|
183
|
-
my_data = read.csv(csv_file, row.names = 1)
|
|
184
|
-
row_num = dim(my_data)[1]
|
|
185
|
-
shape_list_tree = get_shape_list_tree(csv_file)
|
|
186
|
-
shape_list_blast = get_shape_list_blast(csv_file)
|
|
187
|
-
color_list_tree = get_color_list_tree(csv_file)
|
|
188
|
-
color_list_blast = get_color_list_blast(csv_file)
|
|
189
|
-
|
|
190
|
-
# plot
|
|
191
|
-
ggplot() +
|
|
192
|
-
geom_boxplot(data = stack(my_data[1:(row_num-2),]), aes(x = ind, y = values)) +
|
|
193
|
-
|
|
194
|
-
geom_point(data = data.frame(x = factor(colnames(my_data)),
|
|
195
|
-
y = as.numeric(my_data[row_num-1,])),
|
|
196
|
-
aes(x=x, y=y),
|
|
197
|
-
color = color_list_blast,
|
|
198
|
-
shape = shape_list_blast,
|
|
199
|
-
fill = color_list_blast,
|
|
200
|
-
stroke = 0.8,
|
|
201
|
-
size = 2.5) +
|
|
202
|
-
|
|
203
|
-
geom_point(data = data.frame(x = factor(colnames(my_data)),
|
|
204
|
-
y = as.numeric(my_data[row_num,])),
|
|
205
|
-
aes(x=x, y=y),
|
|
206
|
-
color = color_list_tree,
|
|
207
|
-
shape = shape_list_tree,
|
|
208
|
-
stroke = 0.8,
|
|
209
|
-
size = 2.5) +
|
|
210
|
-
|
|
211
|
-
theme_bw() + # white background
|
|
212
|
-
theme(panel.border = element_blank(),
|
|
213
|
-
panel.grid.major = element_blank(),
|
|
214
|
-
panel.grid.minor = element_blank(),
|
|
215
|
-
axis.line = element_line(colour = "black"),
|
|
216
|
-
axis.text.x = element_text(colour="black",size=12,angle=0,hjust=.5,vjust=.5,face="plain"),
|
|
217
|
-
axis.text.y = element_text(colour="black",size=12,angle=0,hjust=.5,vjust=.5,face="plain"),
|
|
218
|
-
axis.title.x = element_text(colour="black",size=12,angle=0,hjust=.5,vjust=0,face="plain"),
|
|
219
|
-
axis.title.y = element_text(colour="black",size=12,angle=90,hjust=.5,vjust=0,face="plain"))+
|
|
220
|
-
labs(x = "COG category", y = 'Proportion') # label of x and y axis
|
|
221
|
-
|
|
222
|
-
ggsave(opt$out, width = 10, height = 5)
|
|
223
|
-
|