├── examples └── hmp_data_exercise │ ├── stool_16s_rand_manifest.tsv │ ├── stool_wgs_rand_manifest.tsv │ ├── stool_nares_16s_rand_manifest.tsv │ ├── community_profiles_manifest.tsv │ ├── stool_nares_rand_16s_5_samples.csv │ ├── metavizr_step_by_step.R │ ├── stool_nares_wgs_rand_metadata.tsv │ ├── stool_16s_rand_samples.tsv │ ├── stool_wgs_rand_samples.tsv │ ├── stool_nares_wgs_rand_manifest.tsv │ ├── stool_16s_rand_5_samples_manifest.tsv │ ├── extract_qiime_subset.R │ ├── extract_metaphlan_subset.R │ ├── stool_nares_16s_rand_samples.tsv │ ├── stool_wgs_rand_5_samples_manifest.tsv │ ├── extract_subset.R │ └── stool_nares_16s_rand_5_samples_manifest.tsv ├── docs └── images │ ├── ec2.png │ ├── keys1.png │ ├── keys2.png │ ├── keys3.png │ ├── credit1.png │ ├── credit2.png │ ├── credit3.png │ ├── credit4.png │ ├── launch1.png │ ├── launch2.png │ ├── launch3.png │ ├── launch4.png │ ├── launch5.png │ ├── launch6.png │ ├── launch7.png │ ├── launch8.png │ ├── regions.png │ ├── connect1.png │ ├── connect2.png │ ├── security1.png │ ├── volumes1.png │ ├── volumes2.png │ ├── attach_volume.png │ ├── create_account.png │ ├── heatmap_popup.png │ ├── metavizr_login.png │ ├── metavizr_result.png │ ├── add_heatmap_dropdown.png │ ├── firmicutes_removed.png │ ├── metaviz_initial_load.png │ ├── metavizr_run_httpuv.png │ ├── stacked_plot_hover.png │ ├── stackedplots_resize.png │ ├── facetzoom_expand_range.png │ ├── heatmap_row_colorby_on.png │ ├── hover_settings_heatmap.png │ ├── metaviz_chrome_initial.png │ ├── metaviz_initial_loaded.png │ ├── metaviz_resize_heatmap.png │ ├── metavizr_charts_loaded.png │ ├── metavizr_clicked_home.png │ ├── metavizr_first_command.png │ ├── metavizr_initial_load.png │ ├── metavizr_run_2_result.png │ ├── metavizr_scatter_plot.png │ ├── add_heatmap_initial_load.png │ ├── hover_p_firmicutes_icon.png │ ├── metaviz_facetzoom_initial.png │ ├── metaviz_resize_facetzoom.png │ ├── metavizr_click_and_drag.png │ ├── metavizr_facetzoom_added.png │ ├── metavizr_metaviz_launched.png │ ├── metavizr_rstudio_screen.png │ ├── metavizr_setup_download.png │ ├── metavizr_stacked_plot_add.png │ ├── stackedplot_diagnosis_uc.png │ ├── stackedplot_uc_selected.png │ ├── stackedplot_uc_settings.png │ ├── add_heatmap_hover_highlight.png │ ├── heatmap_settings_completed.png │ ├── metaviz_selected_datasource.png │ ├── metavizr_choose_16s_samples.png │ ├── metavizr_chose_16s_samples.png │ ├── metavizr_chose_wgs_samples.png │ ├── metavizr_highlight_and_run.png │ ├── stacked_plot_crohns_disease.png │ ├── stacked_plot_crohns_select.png │ ├── stackedplot_crohns_samples.png │ ├── stackedplot_crohns_settings.png │ ├── add_heatmap_select_all_samples.png │ ├── facetzoom_aggregate_to_order.png │ ├── facetzoom_proteobacteria_click.png │ ├── heatmap_settings_right_margin.png │ ├── metavizr_choose_third_sample.png │ ├── metavizr_clicked_workshopData.png │ ├── metavizr_highlight_and_run_1.png │ ├── metavizr_highlight_and_run_2.png │ ├── metavizr_highlight_and_run_3.png │ ├── metavizr_highlight_and_run_4.png │ ├── metavizr_highlight_and_run_5.png │ ├── metavizr_highlight_and_run_6.png │ ├── metavizr_highlight_and_run_7.png │ ├── metavizr_highlight_and_run_8.png │ ├── metavizr_hightlight_and_run_5.png │ ├── metavizr_launch_metavizr_popup.png │ ├── metavizr_scatter_plot_dropdown.png │ ├── metavizr_scatter_plot_loaded.png │ ├── remove_firmicutes_first_click.png │ ├── stacked_plot_add_visualization.png │ ├── stackedplot_uc_samples_added.png │ ├── stackedplot_uc_settings_done.png │ ├── add_heatmap_measurement_browser.png │ ├── metavizr_clicked_workshopScript.png │ ├── metavizr_measurement_select_16s.png │ ├── metavizr_scatter_plot_run_httpuv.png │ ├── stackedplot_hover_bacteroidales.png │ ├── stackedplot_measurement_browser.png │ ├── facetzoom_gammaproteobacteria_click.png │ ├── facetzoom_gammaproteobacteria_zoom.png │ ├── facetzoom_proteobacteria_zoom_out.png │ ├── heatmap_settings_dropdown_diagnosis.png │ ├── metavizr_adding_first_stacked_plot.png │ ├── metavizr_highlight_and_run_1_result.png │ ├── metavizr_highlight_and_run_2_result.png │ ├── metavizr_scatter_plot_run_appservice.png │ ├── facetzoom_gammaproteobacteria_zoom_out.png │ ├── metavizr_scatter_plot_run_appservice_2.png │ ├── stacked_plot_measurementbrowser_diagnosis.png │ └── facetzoom_gammaproteobacteria_aggregate_family.png ├── pipelines ├── qiime2 │ ├── deblur_test.yml │ ├── phylogenetic_analysis_test.yml │ ├── feat_tbl_tabulate_seqs_test.yml │ ├── diff_abundance_test.yml │ ├── feat_tbl_summarize_test.yml │ ├── dada2_test.yml │ ├── diff_abundance_w_collapse_test.yml │ ├── taxonomic_analysis_test.yml │ ├── demux_empseq_test.yml │ ├── qiime2_complete_test.yml │ ├── feat_tbl_tabulate_seqs.cwl │ ├── feat_tbl_summarize.cwl │ ├── alpha_significance.cwl │ ├── diversity_core_metrics.cwl │ ├── emperor_plot.cwl │ ├── beta_significance.cwl │ ├── dada2.cwl │ ├── README.md │ ├── diff_abundance.cwl │ ├── deblur.cwl │ ├── phylogenetic_analysis.cwl │ ├── taxonomic_analysis.cwl │ ├── demux_empseq.cwl │ └── diff_abundance_w_collapse.cwl ├── strainphlan │ ├── bowtie2_inspect_test.yml │ ├── sample2markers_test.yml │ ├── strainphlan_test1.yml │ ├── extract_markers_test.yml │ ├── metaphlan2_test.yml │ ├── strainphlan_test2.yml │ ├── metaphlan_merge_tables.cwl │ ├── bowtie2_inspect.cwl │ ├── sample2markers.cwl │ ├── add_metadata_tree.cwl │ ├── strainphlan_complete_test.yml │ ├── plot_tree_graphlan.cwl │ ├── extract_markers.cwl │ ├── build_tree_single_strain.cwl │ ├── metaphlan_merge_complete.cwl │ ├── README.md │ ├── strainphlan.cwl │ └── metaphlan2.cwl ├── humann2 │ ├── humann2_test3.yml │ ├── humann2_test1.yml │ ├── humann2_test2.yml │ ├── humann2_join_tables_test.yml │ ├── humann2_renorm_table_test2.yml │ ├── humann2_test4.yml │ ├── humann2_associate_test.yml │ ├── humann2_barplot_test1.yml │ ├── humann2_barplot_test2.yml │ ├── humann2_barplot_test4.yml │ ├── humann2_regroup_table_test.yml │ ├── humann2_rename_table_test.yml │ ├── humann2_barplot_test3.yml │ ├── humann2_join_complete_test.yml │ ├── humann2_renorm_table_test1.yml │ ├── humann2_barplot_test5.yml │ ├── humann2_complete_test.yml │ ├── humann2_join_tables.cwl │ ├── humann2_rename_table.cwl │ ├── humann2_regroup_table.cwl │ ├── humann2_renorm_table.cwl │ ├── humann2_associate.cwl │ ├── humann2_barplot.cwl │ ├── humann2.cwl │ ├── README.md │ ├── humann2_join_complete.cwl │ └── humann2_complete.cwl ├── metacompass │ ├── metacompass_test1.yml │ ├── metacompass_test2.yml │ ├── metacompass_test3.yml │ ├── README.md │ └── metacompass.cwl └── utils │ ├── wget_test.yml │ ├── wget.cwl │ └── curl.cwl ├── docker ├── chiron-valet │ ├── reapr │ │ ├── fa2gc │ │ ├── n50 │ │ ├── fa2gaps │ │ ├── bam2insert │ │ ├── make_plots │ │ ├── task_break │ │ ├── task_score │ │ ├── task_stats │ │ ├── bam2fragCov │ │ ├── bam2perfect │ │ ├── scaff2contig │ │ ├── task_fcdrate │ │ ├── bam2fcdEstimate │ │ ├── findknownsnps │ │ ├── task_gapresize │ │ ├── coveragePlot.cpp │ │ ├── coveragePlot.h │ │ ├── fa2gaps.cpp │ │ ├── errorWindow.h │ │ ├── fasta.h │ │ ├── errorWindow.cpp │ │ ├── task_seqrename.pl │ │ ├── utils.h │ │ ├── scaff2contig.cpp │ │ ├── utils.cpp │ │ ├── task_facheck.pl │ │ ├── fasta.cpp │ │ ├── trianglePlot.h │ │ ├── histogram.h │ │ ├── task_plots.pl │ │ └── reapr.pl │ ├── get_sample_data │ ├── build.sh │ └── Dockerfile ├── chiron-metaviz │ ├── workshopData │ ├── metaviz_start.sh │ ├── supervisord.conf │ ├── build.sh │ ├── setup.R │ └── Dockerfile ├── chiron-core │ ├── setup.R │ └── build.sh ├── chiron-phlan │ └── build.sh ├── chiron-qiime2 │ ├── build.sh │ └── Dockerfile ├── chiron-humann2 │ ├── build.sh │ └── Dockerfile ├── chiron-megahit │ ├── build.sh │ └── Dockerfile ├── chiron-metagenemark │ ├── build.sh │ └── Dockerfile └── chiron-metacompass │ ├── build.sh │ └── Dockerfile ├── bin ├── metaphlan2_config_template.yml ├── metacompass_config_template.yml ├── get_all_images ├── qiime2_config_template.yml ├── humann2_config_template.yml ├── install_dependencies ├── metavizr_detached ├── metaviz_interactive ├── valet_interactive ├── phlan_interactive ├── qiime2_interactive ├── megahit_interactive ├── hmp_client_interactive ├── humann2_interactive ├── strainphlan_config_template.yml ├── metagenemark_interactive └── metacompass_interactive ├── tests ├── test_metacompass.sh └── test_strainphlan.sh └── LICENSE /examples/hmp_data_exercise/stool_16s_rand_manifest.tsv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_wgs_rand_manifest.tsv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_nares_16s_rand_manifest.tsv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/images/ec2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/ec2.png -------------------------------------------------------------------------------- /docs/images/keys1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/keys1.png -------------------------------------------------------------------------------- /docs/images/keys2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/keys2.png -------------------------------------------------------------------------------- /docs/images/keys3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/keys3.png -------------------------------------------------------------------------------- /pipelines/qiime2/deblur_test.yml: -------------------------------------------------------------------------------- 1 | input_seqs: 2 | class: File 3 | path: ./demux.qza -------------------------------------------------------------------------------- /docs/images/credit1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/credit1.png -------------------------------------------------------------------------------- /docs/images/credit2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/credit2.png -------------------------------------------------------------------------------- /docs/images/credit3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/credit3.png -------------------------------------------------------------------------------- /docs/images/credit4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/credit4.png -------------------------------------------------------------------------------- /docs/images/launch1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/launch1.png -------------------------------------------------------------------------------- /docs/images/launch2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/launch2.png -------------------------------------------------------------------------------- /docs/images/launch3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/launch3.png -------------------------------------------------------------------------------- /docs/images/launch4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/launch4.png -------------------------------------------------------------------------------- /docs/images/launch5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/launch5.png -------------------------------------------------------------------------------- /docs/images/launch6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/launch6.png -------------------------------------------------------------------------------- /docs/images/launch7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/launch7.png -------------------------------------------------------------------------------- /docs/images/launch8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/launch8.png -------------------------------------------------------------------------------- /docs/images/regions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/regions.png -------------------------------------------------------------------------------- /docs/images/connect1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/connect1.png -------------------------------------------------------------------------------- /docs/images/connect2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/connect2.png -------------------------------------------------------------------------------- /docs/images/security1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/security1.png -------------------------------------------------------------------------------- /docs/images/volumes1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/volumes1.png -------------------------------------------------------------------------------- /docs/images/volumes2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/volumes2.png -------------------------------------------------------------------------------- /pipelines/qiime2/phylogenetic_analysis_test.yml: -------------------------------------------------------------------------------- 1 | rep_seqs: 2 | class: File 3 | path: ./rep-seqs.qza -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/fa2gc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/fa2gc -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/n50: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/n50 -------------------------------------------------------------------------------- /docs/images/attach_volume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/attach_volume.png -------------------------------------------------------------------------------- /docs/images/create_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/create_account.png -------------------------------------------------------------------------------- /docs/images/heatmap_popup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/heatmap_popup.png -------------------------------------------------------------------------------- /docs/images/metavizr_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_login.png -------------------------------------------------------------------------------- /docs/images/metavizr_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_result.png -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/fa2gaps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/fa2gaps -------------------------------------------------------------------------------- /docker/chiron-metaviz/workshopData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-metaviz/workshopData -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/bam2insert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/bam2insert -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/make_plots: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/make_plots -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/task_break: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/task_break -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/task_score: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/task_score -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/task_stats: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/task_stats -------------------------------------------------------------------------------- /docs/images/add_heatmap_dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/add_heatmap_dropdown.png -------------------------------------------------------------------------------- /docs/images/firmicutes_removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/firmicutes_removed.png -------------------------------------------------------------------------------- /docs/images/metaviz_initial_load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metaviz_initial_load.png -------------------------------------------------------------------------------- /docs/images/metavizr_run_httpuv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_run_httpuv.png -------------------------------------------------------------------------------- /docs/images/stacked_plot_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stacked_plot_hover.png -------------------------------------------------------------------------------- /docs/images/stackedplots_resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplots_resize.png -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/bam2fragCov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/bam2fragCov -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/bam2perfect: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/bam2perfect -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/scaff2contig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/scaff2contig -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/task_fcdrate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/task_fcdrate -------------------------------------------------------------------------------- /docs/images/facetzoom_expand_range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/facetzoom_expand_range.png -------------------------------------------------------------------------------- /docs/images/heatmap_row_colorby_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/heatmap_row_colorby_on.png -------------------------------------------------------------------------------- /docs/images/hover_settings_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/hover_settings_heatmap.png -------------------------------------------------------------------------------- /docs/images/metaviz_chrome_initial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metaviz_chrome_initial.png -------------------------------------------------------------------------------- /docs/images/metaviz_initial_loaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metaviz_initial_loaded.png -------------------------------------------------------------------------------- /docs/images/metaviz_resize_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metaviz_resize_heatmap.png -------------------------------------------------------------------------------- /docs/images/metavizr_charts_loaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_charts_loaded.png -------------------------------------------------------------------------------- /docs/images/metavizr_clicked_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_clicked_home.png -------------------------------------------------------------------------------- /docs/images/metavizr_first_command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_first_command.png -------------------------------------------------------------------------------- /docs/images/metavizr_initial_load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_initial_load.png -------------------------------------------------------------------------------- /docs/images/metavizr_run_2_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_run_2_result.png -------------------------------------------------------------------------------- /docs/images/metavizr_scatter_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_scatter_plot.png -------------------------------------------------------------------------------- /docker/chiron-core/setup.R: -------------------------------------------------------------------------------- 1 | install.packages(c('getopt', 'reshape2', 'dplyr'), repos='http://cran.revolutionanalytics.com/') 2 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/bam2fcdEstimate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/bam2fcdEstimate -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/findknownsnps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/findknownsnps -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/task_gapresize: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docker/chiron-valet/reapr/task_gapresize -------------------------------------------------------------------------------- /docs/images/add_heatmap_initial_load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/add_heatmap_initial_load.png -------------------------------------------------------------------------------- /docs/images/hover_p_firmicutes_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/hover_p_firmicutes_icon.png -------------------------------------------------------------------------------- /docs/images/metaviz_facetzoom_initial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metaviz_facetzoom_initial.png -------------------------------------------------------------------------------- /docs/images/metaviz_resize_facetzoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metaviz_resize_facetzoom.png -------------------------------------------------------------------------------- /docs/images/metavizr_click_and_drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_click_and_drag.png -------------------------------------------------------------------------------- /docs/images/metavizr_facetzoom_added.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_facetzoom_added.png -------------------------------------------------------------------------------- /docs/images/metavizr_metaviz_launched.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_metaviz_launched.png -------------------------------------------------------------------------------- /docs/images/metavizr_rstudio_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_rstudio_screen.png -------------------------------------------------------------------------------- /docs/images/metavizr_setup_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_setup_download.png -------------------------------------------------------------------------------- /docs/images/metavizr_stacked_plot_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_stacked_plot_add.png -------------------------------------------------------------------------------- /docs/images/stackedplot_diagnosis_uc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplot_diagnosis_uc.png -------------------------------------------------------------------------------- /docs/images/stackedplot_uc_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplot_uc_selected.png -------------------------------------------------------------------------------- /docs/images/stackedplot_uc_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplot_uc_settings.png -------------------------------------------------------------------------------- /docs/images/add_heatmap_hover_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/add_heatmap_hover_highlight.png -------------------------------------------------------------------------------- /docs/images/heatmap_settings_completed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/heatmap_settings_completed.png -------------------------------------------------------------------------------- /docs/images/metaviz_selected_datasource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metaviz_selected_datasource.png -------------------------------------------------------------------------------- /docs/images/metavizr_choose_16s_samples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_choose_16s_samples.png -------------------------------------------------------------------------------- /docs/images/metavizr_chose_16s_samples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_chose_16s_samples.png -------------------------------------------------------------------------------- /docs/images/metavizr_chose_wgs_samples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_chose_wgs_samples.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run.png -------------------------------------------------------------------------------- /docs/images/stacked_plot_crohns_disease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stacked_plot_crohns_disease.png -------------------------------------------------------------------------------- /docs/images/stacked_plot_crohns_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stacked_plot_crohns_select.png -------------------------------------------------------------------------------- /docs/images/stackedplot_crohns_samples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplot_crohns_samples.png -------------------------------------------------------------------------------- /docs/images/stackedplot_crohns_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplot_crohns_settings.png -------------------------------------------------------------------------------- /docs/images/add_heatmap_select_all_samples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/add_heatmap_select_all_samples.png -------------------------------------------------------------------------------- /docs/images/facetzoom_aggregate_to_order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/facetzoom_aggregate_to_order.png -------------------------------------------------------------------------------- /docs/images/facetzoom_proteobacteria_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/facetzoom_proteobacteria_click.png -------------------------------------------------------------------------------- /docs/images/heatmap_settings_right_margin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/heatmap_settings_right_margin.png -------------------------------------------------------------------------------- /docs/images/metavizr_choose_third_sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_choose_third_sample.png -------------------------------------------------------------------------------- /docs/images/metavizr_clicked_workshopData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_clicked_workshopData.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_1.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_2.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_3.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_4.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_5.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_6.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_7.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_8.png -------------------------------------------------------------------------------- /docs/images/metavizr_hightlight_and_run_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_hightlight_and_run_5.png -------------------------------------------------------------------------------- /docs/images/metavizr_launch_metavizr_popup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_launch_metavizr_popup.png -------------------------------------------------------------------------------- /docs/images/metavizr_scatter_plot_dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_scatter_plot_dropdown.png -------------------------------------------------------------------------------- /docs/images/metavizr_scatter_plot_loaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_scatter_plot_loaded.png -------------------------------------------------------------------------------- /docs/images/remove_firmicutes_first_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/remove_firmicutes_first_click.png -------------------------------------------------------------------------------- /docs/images/stacked_plot_add_visualization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stacked_plot_add_visualization.png -------------------------------------------------------------------------------- /docs/images/stackedplot_uc_samples_added.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplot_uc_samples_added.png -------------------------------------------------------------------------------- /docs/images/stackedplot_uc_settings_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplot_uc_settings_done.png -------------------------------------------------------------------------------- /docs/images/add_heatmap_measurement_browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/add_heatmap_measurement_browser.png -------------------------------------------------------------------------------- /docs/images/metavizr_clicked_workshopScript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_clicked_workshopScript.png -------------------------------------------------------------------------------- /docs/images/metavizr_measurement_select_16s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_measurement_select_16s.png -------------------------------------------------------------------------------- /docs/images/metavizr_scatter_plot_run_httpuv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_scatter_plot_run_httpuv.png -------------------------------------------------------------------------------- /docs/images/stackedplot_hover_bacteroidales.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplot_hover_bacteroidales.png -------------------------------------------------------------------------------- /docs/images/stackedplot_measurement_browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stackedplot_measurement_browser.png -------------------------------------------------------------------------------- /pipelines/qiime2/feat_tbl_tabulate_seqs_test.yml: -------------------------------------------------------------------------------- 1 | rep_seqs: 2 | class: File 3 | path: ./rep-seqs.qza 4 | seqs_visualization: "./rep-seqs.qzv" -------------------------------------------------------------------------------- /pipelines/strainphlan/bowtie2_inspect_test.yml: -------------------------------------------------------------------------------- 1 | index_dir: 2 | class: Directory 3 | path: ./test_input/db_v20 4 | base_str: 'mpa_v20_m200' -------------------------------------------------------------------------------- /docs/images/facetzoom_gammaproteobacteria_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/facetzoom_gammaproteobacteria_click.png -------------------------------------------------------------------------------- /docs/images/facetzoom_gammaproteobacteria_zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/facetzoom_gammaproteobacteria_zoom.png -------------------------------------------------------------------------------- /docs/images/facetzoom_proteobacteria_zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/facetzoom_proteobacteria_zoom_out.png -------------------------------------------------------------------------------- /docs/images/heatmap_settings_dropdown_diagnosis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/heatmap_settings_dropdown_diagnosis.png -------------------------------------------------------------------------------- /docs/images/metavizr_adding_first_stacked_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_adding_first_stacked_plot.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_1_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_1_result.png -------------------------------------------------------------------------------- /docs/images/metavizr_highlight_and_run_2_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_highlight_and_run_2_result.png -------------------------------------------------------------------------------- /pipelines/humann2/humann2_test3.yml: -------------------------------------------------------------------------------- 1 | input_file: 2 | class: File 3 | path: ./test_input/demo.m8 4 | output_dir: "./demo_m8" 5 | gap_fill: "on" -------------------------------------------------------------------------------- /docs/images/metavizr_scatter_plot_run_appservice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_scatter_plot_run_appservice.png -------------------------------------------------------------------------------- /pipelines/humann2/humann2_test1.yml: -------------------------------------------------------------------------------- 1 | input_file: 2 | class: File 3 | path: ./test_input/demo.fastq 4 | output_dir: "./demo_fastq" 5 | gap_fill: "off" -------------------------------------------------------------------------------- /docs/images/facetzoom_gammaproteobacteria_zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/facetzoom_gammaproteobacteria_zoom_out.png -------------------------------------------------------------------------------- /docs/images/metavizr_scatter_plot_run_appservice_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/metavizr_scatter_plot_run_appservice_2.png -------------------------------------------------------------------------------- /docs/images/stacked_plot_measurementbrowser_diagnosis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/stacked_plot_measurementbrowser_diagnosis.png -------------------------------------------------------------------------------- /pipelines/humann2/humann2_test2.yml: -------------------------------------------------------------------------------- 1 | input_file: 2 | class: File 3 | path: ./test_input/demo.sam 4 | output_dir: "./demo_sam" 5 | gap_fill: "on" 6 | num_threads: 4 -------------------------------------------------------------------------------- /docs/images/facetzoom_gammaproteobacteria_aggregate_family.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGS/Chiron/HEAD/docs/images/facetzoom_gammaproteobacteria_aggregate_family.png -------------------------------------------------------------------------------- /pipelines/metacompass/metacompass_test1.yml: -------------------------------------------------------------------------------- 1 | unpaired_reads: 2 | - class: File 3 | path: ./test_input/SRS044742.fastq 4 | output_directory: 'SRS044742_unpaired_out' 5 | -------------------------------------------------------------------------------- /pipelines/strainphlan/sample2markers_test.yml: -------------------------------------------------------------------------------- 1 | ifn_samples: 2 | class: File 3 | path: ./test_output/13530241_SF05.sam.bz2 4 | input_type: "sam" 5 | num_cores: 4 6 | output_dir: '.' 7 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_join_tables_test.yml: -------------------------------------------------------------------------------- 1 | input_dir: 2 | class: Directory 3 | path: ./test_input/763577454 4 | output_tsv: "./763577454_genefamilies.tsv" 5 | file_name: "genefamilies" -------------------------------------------------------------------------------- /pipelines/humann2/humann2_renorm_table_test2.yml: -------------------------------------------------------------------------------- 1 | input_tsv: 2 | class: File 3 | path: ./test_input/763577454_genefamilies.tsv 4 | output_tsv: "./763577454_genefamilies_cpm.tsv" 5 | units: "cpm" -------------------------------------------------------------------------------- /pipelines/qiime2/diff_abundance_test.yml: -------------------------------------------------------------------------------- 1 | metadata_file: 2 | class: File 3 | path: ./sample-metadata.tsv 4 | input_table: 5 | class: File 6 | path: ./table.qza 7 | metadata_category: "BodySite" -------------------------------------------------------------------------------- /pipelines/strainphlan/strainphlan_test1.yml: -------------------------------------------------------------------------------- 1 | sample_markers: 2 | - class: File 3 | path: './test_output/13530241_SF05.markers' 4 | output_dir: '.' 5 | print_clades_only: true 6 | num_cores: 1 7 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_test4.yml: -------------------------------------------------------------------------------- 1 | input_file: 2 | class: File 3 | path: ./test_input/demo.fastq 4 | output_dir: "./demo_fastq_noaa" 5 | gap_fill: "on" 6 | num_threads: 4 7 | bypass_translated_search: true -------------------------------------------------------------------------------- /pipelines/qiime2/feat_tbl_summarize_test.yml: -------------------------------------------------------------------------------- 1 | input_table: 2 | class: File 3 | path: ./table.qza 4 | metadata_file: 5 | class: File 6 | path: ./sample-metadata.tsv 7 | table_visualization: "./table.qzv" 8 | -------------------------------------------------------------------------------- /bin/metaphlan2_config_template.yml: -------------------------------------------------------------------------------- 1 | # Input type of sample - choose between "multifasta" or "multifastq" 2 | input_type: 'multifastq' 3 | # Number of cores to utilize when running programs. Default is 2 4 | num_cores: 4 5 | -------------------------------------------------------------------------------- /pipelines/utils/wget_test.yml: -------------------------------------------------------------------------------- 1 | url: https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/strainphlan/input/s__Eubacterium_siraeum.markers.fasta 2 | output_file: s__Eubacterium_siraeum.markers.fasta -------------------------------------------------------------------------------- /pipelines/humann2/humann2_associate_test.yml: -------------------------------------------------------------------------------- 1 | input_pcl: 2 | class: File 3 | path: ./test_input/hmp_pathabund.pcl 4 | output_stats: "./stats.txt" 5 | last_metadatum: "STSite" 6 | focal_metadatum: "STSite" 7 | focal_type: "categorical" -------------------------------------------------------------------------------- /pipelines/humann2/humann2_barplot_test1.yml: -------------------------------------------------------------------------------- 1 | input_pcl: 2 | class: File 3 | path: ./test_input/hmp_pathabund.pcl 4 | output_png: "./plot1.png" 5 | focal_feature: "METSYN-PWY" 6 | focal_metadatum: "STSite" 7 | last_metadatum: "STSite" -------------------------------------------------------------------------------- /pipelines/qiime2/dada2_test.yml: -------------------------------------------------------------------------------- 1 | input_seqs: 2 | class: File 3 | path: ./demux.qza 4 | trim_left: 0 5 | trim_right: 120 6 | #rep_seqs: "./rep-seqs-dada2.qza" 7 | rep_seqs: "./rep-seqs.qza" 8 | #table: "./table-dada2.qza" 9 | table: "./table.qza" -------------------------------------------------------------------------------- /bin/metacompass_config_template.yml: -------------------------------------------------------------------------------- 1 | # Maximum read length. Default is 100 2 | max_read_length: 100 3 | # Number of parallel threads to use: Default is 1 4 | num_threads: 4 5 | # Output directory path. 6 | output_directory: './metacompass_output' 7 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_barplot_test2.yml: -------------------------------------------------------------------------------- 1 | input_pcl: 2 | class: File 3 | path: ./test_input/hmp_pathabund.pcl 4 | output_png: "./plot2.png" 5 | focal_feature: "METSYN-PWY" 6 | focal_metadatum: "STSite" 7 | last_metadatum: "STSite" 8 | sort: ["sum"] -------------------------------------------------------------------------------- /pipelines/humann2/humann2_barplot_test4.yml: -------------------------------------------------------------------------------- 1 | input_pcl: 2 | class: File 3 | path: ./test_input/hmp_pathabund.pcl 4 | output_png: "./plot4.png" 5 | focal_feature: "COA-PWY" 6 | focal_metadatum: "STSite" 7 | last_metadatum: "STSite" 8 | sort: ["sum"] -------------------------------------------------------------------------------- /pipelines/humann2/humann2_regroup_table_test.yml: -------------------------------------------------------------------------------- 1 | input_tsv: 2 | class: File 3 | path: ./test_input/demo_fastq/demo_genefamilies-cpm.tsv 4 | #output_tsv: "./demo_fastq/level4ec-cpm.tsv" 5 | output_tsv: "./level4ec-cpm.tsv" 6 | groups: "uniref90_level4ec" -------------------------------------------------------------------------------- /pipelines/humann2/humann2_rename_table_test.yml: -------------------------------------------------------------------------------- 1 | input_tsv: 2 | class: File 3 | path: ./test_input/demo_fastq/demo_genefamilies.tsv 4 | #output_tsv: "./demo_fastq/demo_genefamilies-names.tsv" 5 | output_tsv: "./demo_genefamilies-names.tsv" 6 | names: "uniref90" -------------------------------------------------------------------------------- /pipelines/strainphlan/extract_markers_test.yml: -------------------------------------------------------------------------------- 1 | index_dir: 2 | class: Directory 3 | path: ./test_input/db_v20 4 | mpa_pkl: 'mpa_v20_m200.pkl' 5 | ifn_markers: 6 | class: File 7 | path: ./test_input/all_markers.fasta 8 | clade: 's__Eubacterium_siraeum' 9 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_barplot_test3.yml: -------------------------------------------------------------------------------- 1 | input_pcl: 2 | class: File 3 | path: ./test_input/hmp_pathabund.pcl 4 | output_png: "./plot3.png" 5 | focal_feature: "METSYN-PWY" 6 | focal_metadatum: "STSite" 7 | last_metadatum: "STSite" 8 | sort: ["sum", "metadata"] -------------------------------------------------------------------------------- /pipelines/humann2/humann2_join_complete_test.yml: -------------------------------------------------------------------------------- 1 | input_dir: 2 | - class: Directory 3 | path: ./test_input/763577454 4 | file_name: "genefamilies" 5 | feat_db: 'uniref90' 6 | normalize_units: 'cpm' 7 | update_snames: true 8 | regrouping_category: 'uniref90_level4ec' -------------------------------------------------------------------------------- /pipelines/humann2/humann2_renorm_table_test1.yml: -------------------------------------------------------------------------------- 1 | input_tsv: 2 | class: File 3 | path: ./test_input/demo_fastq/demo_genefamilies.tsv 4 | #output_tsv: "./demo_fastq/demo_genefamilies-cpm.tsv" 5 | output_tsv: "./demo_genefamilies-cpm.tsv" 6 | units: "cpm" 7 | update_snames: true -------------------------------------------------------------------------------- /pipelines/qiime2/diff_abundance_w_collapse_test.yml: -------------------------------------------------------------------------------- 1 | metadata_file: 2 | class: File 3 | path: ./sample-metadata.tsv 4 | input_table: 5 | class: File 6 | path: ./table.qza 7 | taxonomy_file: 8 | class: File 9 | path: ./taxonomy.qza 10 | metadata_category: "BodySite" 11 | collapse_level: 2 -------------------------------------------------------------------------------- /pipelines/humann2/humann2_barplot_test5.yml: -------------------------------------------------------------------------------- 1 | input_pcl: 2 | class: File 3 | path: ./test_input/hmp_pathabund.pcl 4 | output_png: "./plot5.png" 5 | focal_feature: "COA-PWY" 6 | focal_metadatum: "STSite" 7 | last_metadatum: "STSite" 8 | sort: ["similarity"] 9 | top_strata: 12 10 | scaling: "normalize" -------------------------------------------------------------------------------- /pipelines/metacompass/metacompass_test2.yml: -------------------------------------------------------------------------------- 1 | paired_reads: 2 | - class: File 3 | path: ./test_input/SRS044742/SRS044742.denovo_duplicates_marked.trimmed.1.fastq 4 | - class: File 5 | path: ./test_input/SRS044742/SRS044742.denovo_duplicates_marked.trimmed.2.fastq 6 | output_directory: 'SRS044742_out' 7 | -------------------------------------------------------------------------------- /docker/chiron-metaviz/metaviz_start.sh: -------------------------------------------------------------------------------- 1 | ./graph-db/neo4j-community-3.2.0/bin/neo4j start 2 | 3 | sed -i -- "s/localhost/$HOST_IP/g" graph-ui/epiviz-metaviz-4.1/site-settings.js 4 | 5 | php -S 0.0.0.0:8888 -t /graph-ui/epiviz-metaviz-4.1/ & 6 | 7 | python /graph-api/metaviz-data-provider-hmp_workshop/metavizRoute.py 8 | -------------------------------------------------------------------------------- /pipelines/qiime2/taxonomic_analysis_test.yml: -------------------------------------------------------------------------------- 1 | rep_seqs: 2 | class: File 3 | path: ./rep-seqs.qza 4 | classifier: 5 | class: File 6 | path: ./gg-13-8-99-515-806-nb-classifier.qza 7 | metadata_file: 8 | class: File 9 | path: ./sample-metadata.tsv 10 | input_table: 11 | class: File 12 | path: ./table.qza -------------------------------------------------------------------------------- /docker/chiron-metaviz/supervisord.conf: -------------------------------------------------------------------------------- 1 | #this file is from https://github.com/mgymrek/docker-rstudio-server 2 | [supervisord] 3 | nodaemon=true 4 | [program:rserver] 5 | command=/usr/lib/rstudio-server/bin/rserver 6 | stdout_logfile=/var/log/supervisor/%(program_name)s.log 7 | stderr_logfile=/var/log/supervisor/%(program_name)s.log 8 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_complete_test.yml: -------------------------------------------------------------------------------- 1 | input_file: 2 | - class: File 3 | path: ./test_input/demo.fastq 4 | humann2_output_dir: '.' 5 | gap_fill: "on" 6 | bypass_translated_search: false 7 | num_cores: 1 8 | feat_db: 'uniref90' 9 | normalize_units: 'cpm' 10 | update_snames: true 11 | regrouping_category: 'uniref90_level4ec' -------------------------------------------------------------------------------- /pipelines/strainphlan/metaphlan2_test.yml: -------------------------------------------------------------------------------- 1 | fasta_input: 2 | class: File 3 | path: ./test_input/fasta/13530241_SF05.fasta.gz 4 | seq_prefix: '13530241_SF05' 5 | input_type: "multifasta" 6 | index_dir: 7 | class: Directory 8 | path: ./test_input/db_v20 9 | base_str: 'mpa_v20_m200' 10 | mpa_pkl: 'mpa_v20_m200.pkl' 11 | num_cores: 4 12 | -------------------------------------------------------------------------------- /docker/chiron-valet/get_sample_data: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | wget -O /tutorials/valet.zip https://s3.amazonaws.com/umigs-chiron/valet/VALET_demo.zip 4 | unzip -d /tutorials/valet /tutorials/valet.zip 5 | 6 | wget -O /tutorials/carsonella.zip https://s3.amazonaws.com/umigs-chiron/valet/carsonella.zip 7 | unzip -d /tutorials/valet /tutorials/carsonella.zip 8 | -------------------------------------------------------------------------------- /pipelines/qiime2/demux_empseq_test.yml: -------------------------------------------------------------------------------- 1 | staging_dir: 2 | class: Directory 3 | path: ./emp-single-end-sequences 4 | metadata_file: 5 | class: File 6 | path: ./sample-metadata.tsv 7 | barcode_file: 8 | class: File 9 | path: ./emp-single-end-sequences/barcodes.fastq.gz 10 | sequence_file: 11 | class: File 12 | path: ./emp-single-end-sequences/sequences.fastq.gz 13 | -------------------------------------------------------------------------------- /docker/chiron-core/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE_VERSION='1.1.5' 4 | 5 | docker rmi -f umigs/chiron-core 6 | docker build --no-cache -t umigs/chiron-core:latest -t umigs/chiron-core:${IMAGE_VERSION} . 7 | docker images 8 | 9 | echo "If ready for release, run: " 10 | echo " docker push umigs/chiron-core:latest" 11 | echo " docker push umigs/chiron-core:${IMAGE_VERSION}" 12 | 13 | -------------------------------------------------------------------------------- /docker/chiron-phlan/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE_VERSION='1.0.0' 4 | 5 | docker rmi -f umigs/chiron-phlan 6 | docker build --no-cache -t umigs/chiron-phlan:latest -t umigs/chiron-phlan:${IMAGE_VERSION} . 7 | docker images 8 | 9 | echo "If ready for release, run: " 10 | echo " docker push umigs/chiron-phlan:latest" 11 | echo " docker push umigs/chiron-phlan:${IMAGE_VERSION}" 12 | -------------------------------------------------------------------------------- /docker/chiron-valet/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE_VERSION='1.1.1' 4 | 5 | docker rmi -f umigs/chiron-valet 6 | docker build --no-cache -t umigs/chiron-valet:latest -t umigs/chiron-valet:${IMAGE_VERSION} . 7 | docker images 8 | 9 | echo "If ready for release, run: " 10 | echo " docker push umigs/chiron-valet:latest" 11 | echo " docker push umigs/chiron-valet:${IMAGE_VERSION}" 12 | -------------------------------------------------------------------------------- /docker/chiron-qiime2/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE_VERSION='1.1.0' 4 | 5 | docker rmi -f umigs/chiron-qiime2 6 | docker build --no-cache -t umigs/chiron-qiime2:latest -t umigs/chiron-qiime2:${IMAGE_VERSION} . 7 | docker images 8 | 9 | echo "If ready for release, run: " 10 | echo " docker push umigs/chiron-qiime2:latest" 11 | echo " docker push umigs/chiron-qiime2:${IMAGE_VERSION}" 12 | -------------------------------------------------------------------------------- /pipelines/metacompass/metacompass_test3.yml: -------------------------------------------------------------------------------- 1 | unpaired_reads: 2 | - class: File 3 | path: ./test_input/SRS044742.fastq 4 | paired_reads: 5 | - class: File 6 | path: ./test_input/SRS044742/SRS044742.denovo_duplicates_marked.trimmed.1.fastq 7 | - class: File 8 | path: ./test_input/SRS044742/SRS044742.denovo_duplicates_marked.trimmed.2.fastq 9 | output_directory: 'SRS044742_out2' 10 | -------------------------------------------------------------------------------- /docker/chiron-humann2/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE_VERSION='1.0.0' 4 | 5 | docker rmi -f umigs/chiron-humann2 6 | docker build --no-cache -t umigs/chiron-humann2:latest -t umigs/chiron-humann2:${IMAGE_VERSION} . 7 | docker images 8 | 9 | echo "If ready for release, run: " 10 | echo " docker push umigs/chiron-humann2:latest" 11 | echo " docker push umigs/chiron-humann2:${IMAGE_VERSION}" 12 | 13 | -------------------------------------------------------------------------------- /docker/chiron-megahit/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE_VERSION='1.0.0' 4 | 5 | docker rmi -f umigs/chiron-megahit 6 | docker build --no-cache -t umigs/chiron-megahit:latest -t umigs/chiron-megahit:${IMAGE_VERSION} . 7 | docker images 8 | 9 | echo "If ready for release, run: " 10 | echo " docker push umigs/chiron-megahit:latest" 11 | echo " docker push umigs/chiron-megahit:${IMAGE_VERSION}" 12 | 13 | -------------------------------------------------------------------------------- /docker/chiron-metaviz/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE_VERSION='1.1.0' 4 | 5 | docker rmi -f umigs/chiron-metaviz 6 | docker build --no-cache -t umigs/chiron-metaviz:latest -t umigs/chiron-metaviz:${IMAGE_VERSION} . 7 | docker images 8 | 9 | 10 | echo "If ready for release, run: " 11 | echo " docker push umigs/chiron-metaviz:latest" 12 | echo " docker push umigs/chiron-metaviz:${IMAGE_VERSION}" 13 | -------------------------------------------------------------------------------- /pipelines/strainphlan/strainphlan_test2.yml: -------------------------------------------------------------------------------- 1 | sample_markers: 2 | - class: File 3 | path: ./test_output/13530241_SF05.markers 4 | ref_marker: 5 | class: File 6 | path: ./test_input/s__Eubacterium_siraeum.markers.fasta 7 | ifn_ref_genomes: 8 | class: File 9 | path: ./test_input/GCF_000154325.fna.bz2 10 | output_dir: '.' 11 | num_cores: 1 12 | clades: 's__Eubacterium_siraeum' 13 | marker_in_clade: 0.2 14 | -------------------------------------------------------------------------------- /docker/chiron-metagenemark/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE_VERSION='1.0.0' 4 | 5 | docker rmi -f umigs/chiron-metagenemark 6 | docker build -t umigs/chiron-metagenemark:latest -t umigs/chiron-metagenemark:${IMAGE_VERSION} . 7 | docker images 8 | 9 | echo "If ready for release, run: " 10 | echo " docker push umigs/chiron-metagenemark:latest" 11 | echo " docker push umigs/chiron-metagenemark:${IMAGE_VERSION}" 12 | 13 | -------------------------------------------------------------------------------- /docker/chiron-metacompass/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE_VERSION='1.0.0' 4 | 5 | docker rmi -f umigs/chiron-metacompass 6 | docker build --no-cache -t umigs/chiron-metacompass:latest -t umigs/chiron-metacompass:${IMAGE_VERSION} . 7 | docker images 8 | 9 | echo "If ready for release, run: " 10 | echo " docker push umigs/chiron-metacompass:latest" 11 | echo " docker push umigs/chiron-metacompass:${IMAGE_VERSION}" 12 | 13 | -------------------------------------------------------------------------------- /bin/get_all_images: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker pull umigs/chiron-core:1.1.5 4 | 5 | docker pull umigs/chiron-humann2:1.0.0 6 | 7 | docker pull umigs/chiron-megahit:1.0.0 8 | 9 | docker pull umigs/chiron-metacompass:1.0.0 10 | 11 | docker pull umigs/chiron-metagenemark:1.0.0 12 | 13 | docker pull umigs/chiron-metaviz:1.1.0 14 | 15 | docker pull umigs/chiron-phlan:1.0.0 16 | 17 | docker pull umigs/chiron-qiime2:1.0.0 18 | 19 | docker pull umigs/chiron-valet:1.1.1 20 | -------------------------------------------------------------------------------- /pipelines/qiime2/qiime2_complete_test.yml: -------------------------------------------------------------------------------- 1 | staging_dir: 2 | class: Directory 3 | location: ./test_input/emp-single-end-sequences 4 | metadata_file: 5 | class: File 6 | location: ./test_input/sample-metadata.tsv 7 | training_classifier: 8 | class: File 9 | location: ./test_input/gg-13-8-99-515-806-nb-classifier.qza 10 | metadata_category: "BodySite" 11 | collapse_level: 2 12 | custom_axis: "DaysSinceExperimentStart" 13 | sampling_depth: 1080 14 | trim_left: 0 15 | trunc_len: 120 -------------------------------------------------------------------------------- /examples/hmp_data_exercise/community_profiles_manifest.tsv: -------------------------------------------------------------------------------- 1 | id md5 size urls 2 | 5a950f27980b5d93e4c16da1243b7c05 0f691c285a951d2b72d55bd9e08bc659 1449982 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmsmcp/v2/hmp1-II_metaphlan2-mtd-qcd.pcl.bz2,s3://nih-hmp-hhs/hmsmcp2/hmp1-II_metaphlan2-mtd-qcd.pcl.bz2 3 | 5a950f27980b5d93e4c16da1243b821c 642570d995244dd1be804f3edea60a7e 9684045 http://downloads.hmpdacc.org/data/HMQCP/otu_table_psn_v35.txt.gz,s3://nih-hmp-hhs/HMQCP/otu_table_psn_v35.txt.gz 4 | -------------------------------------------------------------------------------- /docker/chiron-metaviz/setup.R: -------------------------------------------------------------------------------- 1 | source("https://bioconductor.org/biocLite.R") 2 | biocLite(c("phyloseq", "metagenomeSeq")) 3 | install.packages("devtools", repos='http://cran.revolutionanalytics.com/') 4 | install.packages("devtools", repos='http://cran.revolutionanalytics.com/') 5 | install.packages("tidyverse", repos='http://cran.revolutionanalytics.com/') 6 | install.packages("RNeo4j", repos='http://cran.revolutionanalytics.com/') 7 | library(devtools) 8 | install_github("epiviz/metavizr@chiron", dependencies=TRUE) 9 | 10 | -------------------------------------------------------------------------------- /pipelines/utils/wget.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | 3 | cwlVersion: v1.0 4 | label: wget test 5 | class: CommandLineTool 6 | 7 | inputs: 8 | output_file: 9 | type: string 10 | label: path to save output file to 11 | inputBinding: 12 | prefix: -O 13 | position: 1 14 | url: 15 | type: string 16 | label: URL to pass to wget 17 | inputBinding: 18 | position: 2 19 | 20 | outputs: 21 | outfile: 22 | type: File 23 | outputBinding: 24 | glob: $(inputs.output_file) 25 | 26 | baseCommand: ["wget"] 27 | -------------------------------------------------------------------------------- /bin/qiime2_config_template.yml: -------------------------------------------------------------------------------- 1 | # Pre-trained naive Bayes classifier file 2 | training_classifier: 3 | class: File 4 | location: ../examples/hmp_data_exercise/gg-13-8-99-515-806-nb-classifier.qza 5 | metadata_category: STSite 6 | # Level to collapse taxonomy before performing differential abudance. Default is 2 7 | collapse_level: 2 8 | # Category to give axes for PCoA plots 9 | custom_axis: STSite 10 | # Diversity rarefaction depth. Default is 1080 11 | sampling_depth: 1080 12 | # DADA2 number of left-side bases to trim. Default is 0 13 | trim_left: 0 14 | # DADA2 length to truncate sequence. Default is 120 15 | trunc_len: 120 16 | -------------------------------------------------------------------------------- /pipelines/utils/curl.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | 3 | cwlVersion: v1.0 4 | label: Perform a cURL command 5 | class: CommandLineTool 6 | 7 | arguments: ["-sL", "--create-dirs"] 8 | 9 | inputs: 10 | url: 11 | type: string 12 | label: URL to pass to wget 13 | inputBinding: 14 | position: 1 15 | output_file: 16 | type: string 17 | label: path to save output file to. Will create non-existing directories 18 | inputBinding: 19 | prefix: -o 20 | position: 2 21 | 22 | outputs: 23 | outfile: 24 | type: File 25 | outputBinding: 26 | glob: $(inputs.output_file) 27 | 28 | baseCommand: ["curl"] 29 | -------------------------------------------------------------------------------- /pipelines/strainphlan/metaphlan_merge_tables.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Merge Metaphlan Tables workflow tool 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: ShellCommandRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-phlan 12 | 13 | inputs: 14 | input_tables: 15 | label: List of input tables 16 | inputBinding: 17 | position: 0 18 | itemSeparator: " " 19 | shellQuote: false 20 | type: File[] 21 | outputs: 22 | out_table: 23 | type: stdout 24 | 25 | stdout: 'merged_abundance_table.txt' 26 | 27 | baseCommand: ["merge_metaphlan_tables.py"] 28 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_join_tables.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Humann2 - Join multiple samples 4 | class: CommandLineTool 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-humann2 9 | 10 | inputs: 11 | input_dir: 12 | inputBinding: 13 | prefix: --input 14 | type: Directory 15 | output_tsv: 16 | inputBinding: 17 | prefix: --output 18 | type: string 19 | file_name: 20 | inputBinding: 21 | prefix: --file_name 22 | type: string 23 | outputs: 24 | out_tsv: 25 | type: File 26 | outputBinding: 27 | glob: $(inputs.output_tsv) 28 | 29 | baseCommand: ["humann2_join_tables"] 30 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_nares_rand_16s_5_samples.csv: -------------------------------------------------------------------------------- 1 | RSID Gender Visit STSite Type PSN SN Region 2 | 159288231 Male 1 Stool 16S 700016692 700016716 V35 3 | 159288231 Male 1 Anterior_nares 16S 700016710 700016752 V35 4 | 161230322 Female 1 Anterior_nares 16S 700096883 700096923 V35 5 | 161230322 Female 1 Stool 16S 700096865 700096887 V35 6 | 368533040 Male 1 Anterior_nares 16S 700102061 700102098 V35 7 | 368533040 Male 1 Stool 16S 700102043 700102062 V35 8 | 663835652 Female 1 Anterior_nares 16S 700114217 700114244 V35 9 | 663835652 Female 1 Stool 16S 700114218 700114246 V35 10 | 763698834 Female 1 Stool 16S 700023066 700023096 V35 11 | 763698834 Female 1 Anterior_nares 16S 700023074 700023112 V35 12 | -------------------------------------------------------------------------------- /pipelines/qiime2/feat_tbl_tabulate_seqs.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - FeatureTable tabulate seqs command 4 | class: CommandLineTool 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-qiime2 9 | 10 | inputs: 11 | rep_seqs: 12 | inputBinding: 13 | prefix: --i-data 14 | type: File 15 | seqs_visualization: 16 | inputBinding: 17 | prefix: --o-visualization 18 | type: string 19 | default: 'rep-seqs.qzv' 20 | 21 | outputs: 22 | out_seqs_visual: 23 | type: File 24 | outputBinding: 25 | glob: $(inputs.seqs_visualization) 26 | 27 | baseCommand: ["qiime", "feature-table", "tabulate-seqs"] 28 | -------------------------------------------------------------------------------- /tests/test_metacompass.sh: -------------------------------------------------------------------------------- 1 | cd /opt/MetaCompass 2 | 3 | wget ftp://public-ftp.hmpdacc.org/Illumina/posterior_fornix/SRS044742.tar.bz2 4 | 5 | tar -xjvf SRS044742.tar.bz2 6 | 7 | cat SRS044742/*.fastq >SRS044742.fastq 8 | 9 | ./go_metacompass.py -U SRS044742.fastq -o SRS044742_unpaired_out 10 | 11 | ./go_metacompass.py -P SRS044742/SRS044742.denovo_duplicates_marked.trimmed.1.fastq,SRS044742/SRS044742.denovo_duplicates_marked.trimmed.2.fastq -o SRS044742_out 12 | 13 | ./go_metacompass.py -P SRS044742/SRS044742.denovo_duplicates_marked.trimmed.1.fastq,SRS044742/SRS044742.denovo_duplicates_marked.trimmed.2.fastq -U SRS044742/SRS044742.denovo_duplicates_marked.trimmed.singleton.fastq -o SRS044742_out2 14 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_rename_table.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Humann2 - Attach names to features 4 | class: CommandLineTool 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-humann2 9 | 10 | inputs: 11 | input_tsv: 12 | inputBinding: 13 | prefix: --input 14 | type: File 15 | output_tsv: 16 | inputBinding: 17 | prefix: --output 18 | type: string 19 | names: 20 | inputBinding: 21 | prefix: --names 22 | type: string 23 | default: "uniref90" 24 | outputs: 25 | out_tsv: 26 | type: File 27 | outputBinding: 28 | glob: $(inputs.output_tsv) 29 | 30 | baseCommand: ["humann2_rename_table"] 31 | -------------------------------------------------------------------------------- /docker/chiron-megahit/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | ############# 4 | ## MEGAHIT ## 5 | ############# 6 | 7 | MAINTAINER Joshua Orvis 8 | LABEL Description="This image is used to run the metagenomic assembler MEGAHIT" Version="1.0.0" 9 | 10 | RUN apt-get -y update && apt-get install -y wget python g++ zlib1g-dev bc xz-utils 11 | 12 | RUN wget -O megahit.tar.gz https://github.com/voutcn/megahit/releases/download/v1.0.6/megahit_v1.0.6_LINUX_CPUONLY_x86_64-bin.tar.gz 13 | RUN tar -xzf megahit.tar.gz 14 | RUN mv megahit_v1.0.6_LINUX_CPUONLY_x86_64-bin/megahit* /usr/bin/ 15 | 16 | # For reference databases needed by tools 17 | RUN mkdir /dbs 18 | 19 | # For demonstration datasets 20 | RUN mkdir /tutorials 21 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_regroup_table.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Humann2 - Regrouping genes to other functional categories 4 | class: CommandLineTool 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-humann2 9 | 10 | inputs: 11 | input_tsv: 12 | inputBinding: 13 | prefix: --input 14 | type: File 15 | output_tsv: 16 | inputBinding: 17 | prefix: --output 18 | type: string 19 | groups: 20 | inputBinding: 21 | prefix: --groups 22 | type: string 23 | default: "uniref90_level4ec" 24 | outputs: 25 | out_tsv: 26 | type: File 27 | outputBinding: 28 | glob: $(inputs.output_tsv) 29 | 30 | baseCommand: ["humann2_regroup_table"] 31 | -------------------------------------------------------------------------------- /pipelines/strainphlan/bowtie2_inspect.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Extracts information from a Bowtie index about what kind of index it is and what reference sequences were used to build it 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-phlan 12 | 13 | # bowtie2-inspect ../db_v20/mpa_v20_m200 > db_markers/all_markers.fasta 14 | 15 | inputs: 16 | index_dir: 17 | type: Directory 18 | base_str: 19 | type: string 20 | outputs: 21 | out_fasta: 22 | type: stdout 23 | stdout: 'all_markers.fasta' 24 | 25 | arguments: 26 | - valueFrom: $(inputs.index_dir.path + '/' + inputs.base_str) 27 | position: 1 28 | 29 | baseCommand: ["bowtie2-inspect"] 30 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_renorm_table.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Humann2 - Normalizing RPKs to relative abundance 4 | class: CommandLineTool 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-humann2 9 | 10 | inputs: 11 | input_tsv: 12 | inputBinding: 13 | prefix: --input 14 | type: File 15 | output_tsv: 16 | inputBinding: 17 | prefix: --output 18 | type: string 19 | units: 20 | inputBinding: 21 | prefix: --units 22 | type: string 23 | default: "cpm" 24 | update_snames: 25 | inputBinding: 26 | prefix: --update-snames 27 | type: boolean? 28 | outputs: 29 | out_tsv: 30 | type: File 31 | outputBinding: 32 | glob: $(inputs.output_tsv) 33 | 34 | baseCommand: ["humann2_renorm_table"] 35 | -------------------------------------------------------------------------------- /pipelines/qiime2/feat_tbl_summarize.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - FeatureTable summarize 4 | class: CommandLineTool 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-qiime2 9 | - class: InlineJavascriptRequirement 10 | 11 | inputs: 12 | input_table: 13 | inputBinding: 14 | prefix: --i-table 15 | type: File 16 | metadata_file: 17 | inputBinding: 18 | prefix: --m-sample-metadata-file 19 | type: File 20 | table_visualization: 21 | inputBinding: 22 | prefix: --o-visualization 23 | type: string 24 | default: 'table.qzv' 25 | 26 | outputs: 27 | out_table_visual: 28 | type: File 29 | outputBinding: 30 | glob: $(inputs.table_visualization) 31 | 32 | baseCommand: ["qiime", "feature-table", "summarize"] 33 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/metavizr_step_by_step.R: -------------------------------------------------------------------------------- 1 | startMetavizTutorial <- function() { 2 | require(httr, quietly=TRUE) 3 | public_ipv4 <- httr::content(httr::GET("http://169.254.169.254/latest/meta-data/public-ipv4")) 4 | 5 | setMetavizStandalone() 6 | startMetavizStandalone(host=public_ipv4, daemonized=FALSE) 7 | } 8 | 9 | download.file("https://github.com/IGS/Chiron/blob/master/docker/chiron-metaviz/workshopData?raw=true" ,destfile = "workshopData") 10 | 11 | wgs_16s_compare_obj <- readRDS("workshopData") 12 | 13 | library(metavizr) 14 | 15 | app <- startMetavizTutorial() 16 | 17 | facetZoom <- app$plot(wgs_16s_compare_obj, datasource_name = "wgs_16s_compare", feature_order = colnames(fData(wgs_16s_compare_obj))[1:6]) 18 | 19 | ## Run this command in the R console after each UI interaction 20 | ## This is an issue that we are working to resolve 21 | app$service() 22 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/coveragePlot.cpp: -------------------------------------------------------------------------------- 1 | #include "coveragePlot.h" 2 | 3 | CoveragePlot::CoveragePlot() 4 | { 5 | CoveragePlot(0, 0); 6 | } 7 | 8 | CoveragePlot::CoveragePlot(unsigned long n, unsigned long pos) : coord_(pos), depth_(0) 9 | { 10 | depthDiff_ = deque(n + 1, 0); 11 | } 12 | 13 | 14 | void CoveragePlot::increment() 15 | { 16 | coord_++; 17 | depth_ -= depthDiff_[0]; 18 | depthDiff_.pop_front(); 19 | depthDiff_.push_back(0); 20 | } 21 | 22 | unsigned long CoveragePlot::depth() 23 | { 24 | return depth_; 25 | } 26 | 27 | 28 | unsigned long CoveragePlot::front() 29 | { 30 | return depthDiff_[0]; 31 | } 32 | 33 | 34 | void CoveragePlot::add(unsigned long n) 35 | { 36 | depth_++; 37 | depthDiff_[n - coord_ + 1]++; 38 | } 39 | 40 | 41 | unsigned long CoveragePlot::position() 42 | { 43 | return coord_; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /pipelines/strainphlan/sample2markers.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: BioBakery sample2markers script 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-phlan 12 | 13 | inputs: 14 | ifn_samples: 15 | inputBinding: 16 | prefix: --ifn_samples 17 | type: File 18 | input_type: 19 | inputBinding: 20 | prefix: --input_type 21 | type: string 22 | default: 'sam' 23 | output_dir: 24 | inputBinding: 25 | prefix: --output_dir 26 | type: string 27 | num_cores: 28 | inputBinding: 29 | prefix: --nproc 30 | type: int 31 | default: 1 32 | outputs: 33 | out_marker: 34 | type: File 35 | outputBinding: 36 | glob: "*.markers" 37 | 38 | baseCommand: ["sample2markers.py"] 39 | -------------------------------------------------------------------------------- /bin/humann2_config_template.yml: -------------------------------------------------------------------------------- 1 | # Output Directory for Humann2 output. Not necessary to change 2 | humann2_output_dir: '.' 3 | # Humann2 gap-filling option. 4 | gap_fill: "on" 5 | # Runs all of the alignment steps except the translated search 6 | bypass_translated_search: true 7 | # Bypasses all of the alignment steps before the translated search 8 | bypass_nucleotide_search: false 9 | # Feature database type for humann2_rename_table. Default is "uniref90" 10 | feat_db: 'uniref90' 11 | # Units to normalize on for humann2_renorm_table. Default is 'cpm' 12 | normalize_units: 'cpm' 13 | # Update sample names in humann2_renorm_table. Default is true 14 | update_snames: true 15 | # Category to regroup on for humann2_regroup_table. 16 | regrouping_category: 'uniref90_level4ec' 17 | # String pattern to merge humann2 output on 18 | file_name: 'genefamilies' 19 | # Number of cores to use in certain processes: Default 4 20 | num_cores: 4 -------------------------------------------------------------------------------- /docker/chiron-metagenemark/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | ################## 4 | ## MetaGeneMark ## 5 | ################## 6 | 7 | MAINTAINER Joshua Orvis 8 | LABEL Description="This image is used to run the metagenomic gene prediction tool MetaGeneMark, and includes biocode for format conversion" Version="1.0.0" 9 | 10 | RUN apt-get -y update && apt-get install -y wget python3 python3-pip libxml2-dev zlib1g-dev 11 | 12 | # For reference databases needed by tools 13 | RUN mkdir /dbs 14 | 15 | RUN wget -O metagenemark.tar.gz https://www.dropbox.com/s/pbj2cix0jc9kl9s/MetaGeneMark_linux_64.tar.gz?dl=0 16 | RUN tar -xzf metagenemark.tar.gz 17 | RUN mv MetaGeneMark_linux_64/mgm/gmhmmp /usr/bin/ 18 | RUN mv MetaGeneMark_linux_64/mgm/MetaGeneMark_v1.mod /dbs/ 19 | RUN cp MetaGeneMark_linux_64/gm_key_64 /root/.gm_key 20 | 21 | RUN pip3 install biocode 22 | 23 | # For demonstration datasets 24 | RUN mkdir /tutorials 25 | -------------------------------------------------------------------------------- /pipelines/strainphlan/add_metadata_tree.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: BioBakery add_metadata_tree script 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | - class: InitialWorkDirRequirement 9 | listing: 10 | - $(inputs.tree_input) 11 | 12 | hints: 13 | - class: DockerRequirement 14 | dockerPull: umigs/chiron-phlan 15 | 16 | inputs: 17 | tree_input: 18 | inputBinding: 19 | prefix: --ifn_trees 20 | valueFrom: $(self.basename) 21 | type: File 22 | metadata_input: 23 | inputBinding: 24 | prefix: --ifn_metadatas 25 | type: File 26 | metadata_category: 27 | inputBinding: 28 | prefix: --metadatas 29 | type: string 30 | outputs: 31 | out_tree: 32 | type: File 33 | outputBinding: 34 | glob: $(inputs.tree_input.basename + '.metadata') 35 | 36 | baseCommand: ["add_metadata_tree.py"] 37 | -------------------------------------------------------------------------------- /bin/install_dependencies: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LOCAL_BASE='/opt/chiron' 4 | 5 | CURRENT_USER="${USER}" 6 | 7 | if [ "$USER" == "root" ]; then 8 | CURRENT_USER="${SUDO_USER}" 9 | else 10 | echo "Not resetting user because it was:${USER}" 11 | fi 12 | 13 | if [ ! -d ${LOCAL_BASE} ]; then 14 | echo "Creating local output directory: ${LOCAL_BASE} owned by ${CURRENT_USER}" 15 | mkdir -p ${LOCAL_BASE} 16 | chown "${CURRENT_USER}:${CURRENT_USER}" ${LOCAL_BASE} 17 | fi 18 | 19 | if hash apt 2> /dev/null; then 20 | apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 21 | apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F76221572C52609D 22 | apt-get update 23 | apt install -y python3 python3-pip python-pip 24 | pip3 install pyyaml requests 25 | pip install pyyaml cwlref-runner 26 | else 27 | echo "Cannot install dependencies on this system, since apt wasn't detected" 28 | fi 29 | 30 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/coveragePlot.h: -------------------------------------------------------------------------------- 1 | #ifndef COVERAGEPLOT_H 2 | #define COVERAGEPLOT_H 3 | 4 | #include 5 | 6 | 7 | using namespace std; 8 | 9 | 10 | class CoveragePlot 11 | { 12 | public: 13 | // construct a coverage plot, with max read length n and position pos 14 | CoveragePlot(); 15 | CoveragePlot(unsigned long n, unsigned long pos); 16 | 17 | // move the coord of the plot 1 base to the right 18 | void increment(); 19 | 20 | // returns the coverage at the current base 21 | unsigned long depth(); 22 | 23 | // return the zero element depth 24 | unsigned long front(); 25 | 26 | // add a read that ends at position n 27 | void add(unsigned long n); 28 | 29 | // returns the position of the plot 30 | unsigned long position(); 31 | 32 | private: 33 | unsigned long coord_; 34 | unsigned long depth_; 35 | deque depthDiff_; 36 | }; 37 | 38 | #endif // COVERAGEPLOT 39 | -------------------------------------------------------------------------------- /pipelines/qiime2/alpha_significance.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Perform alpha group significance analysis 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-qiime2 12 | 13 | inputs: 14 | input_dir: 15 | type: Directory 16 | vector_file_base: 17 | type: string 18 | metadata_file: 19 | inputBinding: 20 | prefix: --m-metadata-file 21 | type: File 22 | out_visualization: 23 | inputBinding: 24 | prefix: --o-visualization 25 | type: string 26 | outputs: 27 | out_visual: 28 | type: File 29 | outputBinding: 30 | glob: $(inputs.out_visualization) 31 | 32 | arguments: 33 | - valueFrom: $(inputs.input_dir.path + '/' + inputs.vector_file_base) 34 | prefix: --i-alpha-diversity 35 | 36 | baseCommand: ["qiime", "diversity", "alpha-group-significance"] 37 | -------------------------------------------------------------------------------- /pipelines/qiime2/diversity_core_metrics.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Compute core metrics for alpha/beta diversity analysis 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-qiime2 12 | 13 | inputs: 14 | input_tree: 15 | inputBinding: 16 | prefix: --i-phylogeny 17 | type: File 18 | input_table: 19 | inputBinding: 20 | prefix: --i-table 21 | type: File 22 | sampling_depth: 23 | inputBinding: 24 | prefix: --p-sampling-depth 25 | type: int 26 | default: 1080 27 | output_dir: 28 | inputBinding: 29 | prefix: --output-dir 30 | type: string 31 | default: 'core-metrics-results' 32 | outputs: 33 | out_dir: 34 | type: Directory 35 | outputBinding: 36 | glob: $(inputs.output_dir) 37 | baseCommand: ["qiime", "diversity", "core-metrics"] 38 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_associate.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Humann2 - Associate functions with metadata 4 | class: CommandLineTool 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-humann2 9 | 10 | inputs: 11 | input_pcl: 12 | label: Accepts FASTA, FASTQ, SAM, or m8 formats 13 | inputBinding: 14 | prefix: --input 15 | type: File 16 | output_stats: 17 | inputBinding: 18 | prefix: --output 19 | type: string 20 | default: "stats.txt" 21 | last_metadatum: 22 | inputBinding: 23 | prefix: --last-metadatum 24 | type: string 25 | focal_metadatum: 26 | inputBinding: 27 | prefix: --focal-metadatum 28 | type: string 29 | focal_type: 30 | inputBinding: 31 | prefix: --focal-type 32 | type: string 33 | default: "categorical" 34 | outputs: 35 | out_stats: 36 | type: File 37 | outputBinding: 38 | glob: $(inputs.output_stats) 39 | 40 | baseCommand: ["humann2_associate"] 41 | -------------------------------------------------------------------------------- /pipelines/qiime2/emperor_plot.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Create PCoA plots using Emperor 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-qiime2 12 | 13 | inputs: 14 | input_dir: 15 | type: Directory 16 | pcoa_file_base: 17 | type: string 18 | metadata_file: 19 | inputBinding: 20 | prefix: --m-metadata-file 21 | type: File 22 | custom_axis: 23 | label: Name for custom axis label 24 | inputBinding: 25 | prefix: --p-custom-axis 26 | type: string 27 | out_visualization: 28 | inputBinding: 29 | prefix: --o-visualization 30 | type: string 31 | outputs: 32 | pcoa_visual: 33 | type: File 34 | outputBinding: 35 | glob: $(inputs.out_visualization) 36 | 37 | arguments: 38 | - valueFrom: $(inputs.input_dir.path + '/' + inputs.pcoa_file_base) 39 | prefix: --i-pcoa 40 | 41 | baseCommand: ["qiime", "emperor", "plot"] 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Institute for Genome Sciences 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /bin/metavizr_detached: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.1.0' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-metaviz:${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for MetaViz not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt" ]; then 29 | LOCAL_BASE="/opt/chiron" 30 | else 31 | LOCAL_BASE="${HOME}/chiron" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | # metavizr 41 | docker run -v ${LOCAL_BASE}:/output -d -p 8787:8787 -p 7123:7123 -t umigs/chiron-metaviz:${IMAGE_VERSION} 42 | -------------------------------------------------------------------------------- /pipelines/qiime2/beta_significance.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Perform beta group significance analysis 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-qiime2 12 | 13 | inputs: 14 | input_dir: 15 | type: Directory 16 | matrix_file_base: 17 | type: string 18 | metadata_file: 19 | inputBinding: 20 | prefix: --m-metadata-file 21 | type: File 22 | metadata_category: 23 | inputBinding: 24 | prefix: --m-metadata-category 25 | type: string 26 | out_visualization: 27 | inputBinding: 28 | prefix: --o-visualization 29 | type: string 30 | outputs: 31 | out_visual: 32 | type: File 33 | outputBinding: 34 | glob: $(inputs.out_visualization) 35 | 36 | arguments: 37 | - valueFrom: $(inputs.input_dir.path + '/' + inputs.matrix_file_base) 38 | prefix: --i-distance-matrix 39 | - prefix: --p-pairwise" 40 | baseCommand: ["qiime", "diversity", "beta-group-significance"] 41 | -------------------------------------------------------------------------------- /pipelines/strainphlan/strainphlan_complete_test.yml: -------------------------------------------------------------------------------- 1 | input_file: 2 | - class: File 3 | path: ./test_input/fasta/13530241_SF05.fasta.gz 4 | - class: File 5 | path: ./test_input/fasta/13530241_SF06.fasta.gz 6 | - class: File 7 | path: ./test_input/fasta/19272639_SF05.fasta.gz 8 | - class: File 9 | path: ./test_input/fasta/19272639_SF06.fasta.gz 10 | - class: File 11 | path: ./test_input/fasta/40476924_SF05.fasta.gz 12 | - class: File 13 | path: ./test_input/fasta/40476924_SF06.fasta.gz 14 | seq_prefix: ['13530241_SF05', '13530241_SF06', '19272639_SF05', '19272639_SF06', '40476924_SF05', '40476924_SF06'] 15 | input_type: 'multifasta' 16 | bowtie2_index_dir: 17 | class: Directory 18 | path: ./test_input/db_v20 19 | bowtie2_base_str: 'mpa_v20_m200' 20 | mpa_pkl_filename: 'mpa_v20_m200.pkl' 21 | genome_input: 22 | class: File 23 | path: ./test_input/GCF_000154325.fna.bz2 24 | clades: 's__Eubacterium_siraeum' 25 | marker_in_clade: 0.2 26 | metadata_file: 27 | class: File 28 | path: ./test_input/metadata.txt 29 | metadata_category: 'subjectID' 30 | num_cores: 2 -------------------------------------------------------------------------------- /pipelines/strainphlan/plot_tree_graphlan.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: BioBakery plot_tree_graphlan script 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | - class: InitialWorkDirRequirement 9 | listing: 10 | - $(inputs.tree_input) 11 | 12 | hints: 13 | - class: DockerRequirement 14 | dockerPull: umigs/chiron-phlan 15 | 16 | inputs: 17 | tree_input: 18 | inputBinding: 19 | prefix: --ifn_tree 20 | valueFrom: $(self.basename) 21 | type: File 22 | metadata_category: 23 | label: Metadata categories to be colorized 24 | inputBinding: 25 | prefix: --colorized_metadata 26 | type: string 27 | leaf_marker_size: 28 | inputBinding: 29 | prefix: --leaf_marker_size 30 | type: int? 31 | legend_marker_size: 32 | inputBinding: 33 | prefix: --legend_marker_size 34 | type: int? 35 | outputs: 36 | out_png: 37 | type: File 38 | outputBinding: 39 | glob: $(inputs.tree_input.basename + '.png') 40 | 41 | baseCommand: ["plot_tree_graphlan.py"] 42 | -------------------------------------------------------------------------------- /bin/metaviz_interactive: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.1.0' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-metaviz:${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for MetaViz not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt/chiron" ]; then 29 | LOCAL_BASE="/opt/chiron" 30 | else 31 | LOCAL_BASE="${HOME}/chiron" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | ipaddr=$(curl ifconfig.me) 41 | 42 | docker run -v ${LOCAL_BASE}:/output -i -t -p 8888:8888 -p 5000:5000 -e HOST_IP=$ipaddr umigs/chiron-metaviz:${IMAGE_VERSION} bash 43 | -------------------------------------------------------------------------------- /pipelines/strainphlan/extract_markers.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: BioBakery extract_markers script 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-phlan 12 | 13 | inputs: 14 | ifn_markers: 15 | inputBinding: 16 | prefix: --ifn_markers 17 | type: File 18 | default: 'all_markers.fasta' 19 | ofn_markers: 20 | inputBinding: 21 | prefix: --ofn_markers 22 | valueFrom: $(inputs.clade + '.markers.fasta') 23 | type: string 24 | default: 'markers.fasta' 25 | index_dir: 26 | type: Directory 27 | mpa_pkl: 28 | label: The metadata pickled MetaPhlAn filename 29 | type: string 30 | clade: 31 | inputBinding: 32 | prefix: --clade 33 | type: string 34 | outputs: 35 | out_marker: 36 | type: File 37 | outputBinding: 38 | glob: $('*' + inputs.ofn_markers) 39 | arguments: 40 | - valueFrom: $(inputs.index_dir.path + '/' + inputs.mpa_pkl) 41 | prefix: --mpa_pkl 42 | 43 | baseCommand: ["extract_markers.py"] 44 | -------------------------------------------------------------------------------- /pipelines/qiime2/dada2.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - DADA2 denoiser 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-qiime2 12 | 13 | inputs: 14 | input_seqs: 15 | inputBinding: 16 | prefix: --i-demultiplexed-seqs 17 | type: File 18 | trim_left: 19 | inputBinding: 20 | prefix: --p-trim-left 21 | type: int 22 | default: 0 23 | trunc_len: 24 | inputBinding: 25 | prefix: --p-trunc-len 26 | type: int 27 | default: 120 28 | rep_seqs: 29 | inputBinding: 30 | prefix: --o-representative-sequences 31 | type: string 32 | default: 'rep-seqs.qza' 33 | table: 34 | inputBinding: 35 | prefix: --o-table 36 | type: string 37 | default: 'table.qza' 38 | outputs: 39 | out_rep_seqs: 40 | type: File 41 | outputBinding: 42 | glob: $(inputs.rep_seqs) 43 | out_table: 44 | type: File 45 | outputBinding: 46 | glob: $(inputs.table) 47 | 48 | baseCommand: ["qiime", "dada2", "denoise-single"] 49 | -------------------------------------------------------------------------------- /bin/valet_interactive: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.1.1' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-valet:${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for VALET not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt/chiron" ]; then 29 | LOCAL_BASE="/opt/chiron/valet" 30 | else 31 | LOCAL_BASE="${HOME}/chiron/valet" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | echo "Saving files to /output in this Docker image will make them available in ${LOCAL_BASE} outside of it." 41 | docker run --rm -v ${LOCAL_BASE}:/output -i -t umigs/chiron-valet:${IMAGE_VERSION} /bin/bash 42 | -------------------------------------------------------------------------------- /bin/phlan_interactive: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.0.0' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-phlan:${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for -PhlAn suite not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt/chiron" ]; then 29 | LOCAL_BASE="/opt/chiron/phlan" 30 | else 31 | LOCAL_BASE="${HOME}/chiron/phlan" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | echo "Saving files to /output in this Docker image will make them available in ${LOCAL_BASE} outside of it." 41 | docker run --rm -v ${LOCAL_BASE}:/output -i -t umigs/chiron-phlan:${IMAGE_VERSION} /bin/bash 42 | -------------------------------------------------------------------------------- /bin/qiime2_interactive: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.0.0' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-qiime2:${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for QIIME2 not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt/chiron" ]; then 29 | LOCAL_BASE="/opt/chiron/qiime2" 30 | else 31 | LOCAL_BASE="${HOME}/chiron/qiime2" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | echo "Saving files to /output in this Docker image will make them available in ${LOCAL_BASE} outside of it." 41 | docker run --rm -v ${LOCAL_BASE}:/output -i -t umigs/chiron-qiime2:${IMAGE_VERSION} /bin/bash 42 | -------------------------------------------------------------------------------- /bin/megahit_interactive: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.0.0' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-megahit:${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for MEGAHIT not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt/chiron" ]; then 29 | LOCAL_BASE="/opt/chiron/megahit" 30 | else 31 | LOCAL_BASE="${HOME}/chiron/megahit" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | echo "Saving files to /output in this Docker image will make them available in ${LOCAL_BASE} outside of it." 41 | docker run --rm -v ${LOCAL_BASE}:/output -i -t umigs/chiron-megahit:${IMAGE_VERSION} /bin/bash 42 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/fa2gaps.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "fasta.h" 10 | 11 | using namespace std; 12 | 13 | int main(int argc, char* argv[]) 14 | { 15 | if (argc != 2) 16 | { 17 | cerr << "usage:\nfa2gaps " << endl; 18 | exit(1); 19 | } 20 | 21 | Fasta fa; 22 | string infile = argv[1]; 23 | 24 | ifstream ifs(infile.c_str()); 25 | 26 | if (!ifs.good()) 27 | { 28 | cerr << "Error opening file '" << infile << "'" << endl; 29 | exit(1); 30 | } 31 | 32 | // for each sequence in the input file, print the gap locations 33 | while (fa.fillFromFile(ifs)) 34 | { 35 | list > gaps; 36 | fa.findGaps(gaps); 37 | 38 | for(list >::iterator p = gaps.begin(); p != gaps.end(); p++) 39 | { 40 | cout << fa.id << '\t' << p->first + 1 << '\t' << p->second + 1 << '\n'; 41 | } 42 | } 43 | 44 | ifs.close(); 45 | return 0; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /pipelines/strainphlan/build_tree_single_strain.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: BioBakery build_tree_single_strain script 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-phlan 12 | - class: InitialWorkDirRequirement 13 | listing: 14 | - $(inputs.alignment_input) 15 | 16 | inputs: 17 | alignment_input: 18 | inputBinding: 19 | prefix: --ifn_alignments 20 | valueFrom: $(self.basename) 21 | type: File 22 | secondaryFiles: '^.polymorphic' 23 | num_cores: 24 | inputBinding: 25 | prefix: --nprocs 26 | type: int 27 | output_log: 28 | inputBinding: 29 | prefix: --log_ofn 30 | type: string 31 | default: 'build_tree_single_strain.log' 32 | outputs: 33 | out_tree: 34 | type: File 35 | outputBinding: 36 | glob: $('RAxML_bestTree.' + inputs.alignment_input.nameroot + '.remove_multiple_strains.tree') 37 | out_log: 38 | type: File 39 | outputBinding: 40 | glob: 'build_tree_single_strain.log' 41 | 42 | baseCommand: ["build_tree_single_strain.py"] 43 | -------------------------------------------------------------------------------- /pipelines/metacompass/README.md: -------------------------------------------------------------------------------- 1 | # Notes for running Metacompass CWL Tool 2 | 3 | ## Invoking a CWL workflow 4 | ``` 5 | cwl-runner 6 | ``` 7 | The first parameter is a valid cwl tool or workflow script. In this directory, these have the extension __.cwl__. 8 | 9 | The second parameter is a YAML or JSON file consisting of input parameters for the CWL script. In this directory, YAML examples are provided and are listed with the extension __.yml__. 10 | 11 | ## Running the Metacompass tool 12 | ``` 13 | cwl-runner ./metacompass.cwl ./metacompass_test1.yml 14 | ``` 15 | 16 | The file "metacomposs\_test1.yml" is an example of a typical Metacompass run using example inputs from the workshop tutorial. 17 | 18 | ## Output 19 | The output for the metacompass tool is the output directory itself. Within this directory is the FASTA file of contigs and other misc. log files 20 | 21 | ## Misc Notes 22 | * If running on MacOS/OSX, must provide the following two options: 23 | * --tmpdir-prefix=./tmp 24 | * --tmp-outdir-prefix=out 25 | * By default output is written to your current directory. To write to a specific directory, pass in the --outdir option -------------------------------------------------------------------------------- /bin/hmp_client_interactive: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.1.5' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-core${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for the HMP Client not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt/chiron" ]; then 29 | LOCAL_BASE="/opt/chiron/hmp_client" 30 | else 31 | LOCAL_BASE="${HOME}/chiron/hmp_client" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | echo "Saving files to /output in this Docker image will make them available in ${LOCAL_BASE} outside of it." 41 | docker run --rm -v ${LOCAL_BASE}:/output -i -t umigs/chiron-core:${IMAGE_VERSION} /bin/bash 42 | 43 | -------------------------------------------------------------------------------- /bin/humann2_interactive: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.0.0' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-humann2:${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for HUMAnN2 not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt/chiron" ]; then 29 | LOCAL_BASE="/opt/chiron/humann2" 30 | else 31 | LOCAL_BASE="${HOME}/chiron/humann2" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | echo "Saving files to /output in this Docker image will make them available in ${LOCAL_BASE} outside of it." 41 | docker run --rm -v ${LOCAL_BASE}:/output -i -t umigs/chiron-humann2:${IMAGE_VERSION} /bin/bash 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /bin/strainphlan_config_template.yml: -------------------------------------------------------------------------------- 1 | # Input type of sample - choose between "multifasta" or "multifastq" 2 | input_type: 'multifasta' 3 | # Path where the Bowtie2 index directory is located 4 | bowtie2_index_dir: 5 | class: Directory 6 | path: # FULL PATH TO BOWTIE2 INDEX GOES HERE 7 | # Base prefix for the bowtie2 reference index to use in the index directory 8 | bowtie2_base_str: 'mpa_v20_m200' 9 | # Metadata pickle filename within the Bowtie2 index directory 10 | mpa_pkl_filename: 'mpa_v20_m200.pkl' 11 | # Path to the reference genome FASTA file to use 12 | genome_input: 13 | class: File 14 | path: # FULL PATH TO REFERENCE GENOME FASTA GOES HERE 15 | # Clade organism to look at further 16 | clades: 's__Eubacterium_siraeum' 17 | # In each sample, the clades with the percentage of present markers less than this threshold are removed. Default 0.2 18 | marker_in_clade: 0.2 19 | # Path to the sample metadata file to use in Graphlan 20 | metadata_file: 21 | class: File 22 | path: ../examples/hmp_data_exercise/wgs_metadata.tsv 23 | # Metadata category to create a dendrogram tree 24 | metadata_category: 'subjectID' 25 | # Number of cores to utilize when running programs. Default is 2 26 | num_cores: 4 27 | -------------------------------------------------------------------------------- /bin/metagenemark_interactive: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.0.0' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-metagenemark:${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for MetaGeneMark not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt/chiron" ]; then 29 | LOCAL_BASE="/opt/chiron/metagenemark" 30 | else 31 | LOCAL_BASE="${HOME}/chiron/metagenemark" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | echo "Saving files to /output in this Docker image will make them available in ${LOCAL_BASE} outside of it." 41 | docker run --rm -v ${LOCAL_BASE}:/output -i -t umigs/chiron-metagenemark:${IMAGE_VERSION} /bin/bash 42 | -------------------------------------------------------------------------------- /bin/metacompass_interactive: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set defaults 4 | LOCAL_BASE='' 5 | IMAGE_VERSION='1.0.0' 6 | 7 | while getopts :l:c: opt; do 8 | case $opt in 9 | l) 10 | LOCAL_BASE=$OPTARG 11 | ;; 12 | \?) 13 | echo "Invalid option: -$OPTARG" >&2 14 | exit 1 15 | ;; 16 | :) 17 | echo "Option -$OPTARG requires an argument." >&2 18 | exit 1 19 | ;; 20 | esac 21 | done 22 | 23 | if [[ "$(docker images -q umigs/chiron-metacompass:${IMAGE_VERSION} 2> /dev/null)" == "" ]]; then 24 | echo "Docker image v${IMAGE_VERSION} for MetaCompass not found. Downloading first ..." 25 | fi 26 | 27 | if [ -z $LOCAL_BASE ]; then 28 | if [ -w "/opt/chiron" ]; then 29 | LOCAL_BASE="/opt/chiron/metacompass" 30 | else 31 | LOCAL_BASE="${HOME}/chiron/metacompass" 32 | fi 33 | fi 34 | 35 | if [ ! -d ${LOCAL_BASE} ]; then 36 | echo "Creating local output directory: ${LOCAL_BASE}" 37 | mkdir -p ${LOCAL_BASE} 38 | fi 39 | 40 | echo "Saving files to /output in this Docker image will make them available in ${LOCAL_BASE} outside of it." 41 | docker run --rm -v ${LOCAL_BASE}:/output -i -t umigs/chiron-metacompass:${IMAGE_VERSION} /bin/bash 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_nares_wgs_rand_metadata.tsv: -------------------------------------------------------------------------------- 1 | file_id subject_id body_site visit urls 2 | 5a950f27980b5d93e4c16da1240068fc 763577454 feces 1 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS014459.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS014459.tar.bz2 3 | 5a950f27980b5d93e4c16da124009c6c 158984779 external naris 1 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS011397.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS011397.tar.bz2 4 | 5a950f27980b5d93e4c16da1240246d7 158984779 feces 1 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS013098.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS013098.tar.bz2 5 | 5a950f27980b5d93e4c16da12407fb21 763577454 external naris 1 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS014464.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS014464.tar.bz2 6 | 6d91411d5ede0689305232cc77e33dd3 604812005 external naris 1 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS043451.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS043451.tar.bz2 7 | 6d91411d5ede0689305232cc77fe57c3 604812005 feces 1 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS045004.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS045004.tar.bz2 8 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_barplot.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Humann2 - Visualize stratified output 4 | class: CommandLineTool 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-humann2 9 | 10 | inputs: 11 | input_pcl: 12 | label: Accepts FASTA, FASTQ, SAM, or m8 formats 13 | inputBinding: 14 | prefix: --input 15 | type: File 16 | output_png: 17 | inputBinding: 18 | prefix: --output 19 | type: string 20 | default: "plot.png" 21 | last_metadatum: 22 | inputBinding: 23 | prefix: --last-metadatum 24 | type: string 25 | focal_metadatum: 26 | inputBinding: 27 | prefix: --focal-metadatum 28 | type: string 29 | focal_feature: 30 | inputBinding: 31 | prefix: --focal-feature 32 | type: string 33 | sort_type: 34 | label: Ways to sort data. Can specify more than one 35 | inputBinding: 36 | prefix: --sort 37 | itemSeparator: " " 38 | type: string[]? 39 | scaling: 40 | inputBinding: 41 | prefix: --scaling 42 | type: string? 43 | top_strata: 44 | inputBinding: 45 | prefix: --top-strata 46 | type: int? 47 | outputs: 48 | out_png: 49 | type: File 50 | outputBinding: 51 | glob: $(inputs.output_png) 52 | 53 | baseCommand: ["humann2_barplot"] 54 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/errorWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef ERRORWINDOW_H 2 | #define ERRORWINDOW_H 3 | 4 | #include 5 | 6 | using namespace std; 7 | 8 | class ErrorWindow 9 | { 10 | public: 11 | // set everything to zero 12 | ErrorWindow(); 13 | 14 | // construct an error window, with max read length n and position pos 15 | ErrorWindow(unsigned long coord, double min, double max, unsigned long minLength, double minPC, bool useMin, bool useMax); 16 | 17 | void clear(unsigned long start); // resets to the given position 18 | 19 | unsigned long start(); // returns start position of window 20 | unsigned long end(); // returns end position of window 21 | 22 | bool fail(); // returns true iff window is bad 23 | 24 | bool lastFail(); // returns true iff last element added failed the test 25 | 26 | // add a number to the end of the window 27 | void add(unsigned long pos, double val); 28 | 29 | private: 30 | unsigned long coord_; 31 | double min_, max_; // values in [min_, max_] are OK 32 | unsigned long minLength_; // min length of window to consider 33 | double minPC_; // min % of positions to be failures across min length of window 34 | bool useMin_, useMax_; 35 | deque passOrFail_; // 1 == fail 36 | deque failCoords_; 37 | 38 | }; 39 | 40 | #endif // ERRORWINDOW 41 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_16s_rand_samples.tsv: -------------------------------------------------------------------------------- 1 | RSID Gender STSite Visit Type PSN SN 2 | 158822939 Male Stool 1 16S 700014954 700014956 3 | 159207311 Male Stool 1 16S 700016456 700016470 4 | 159389382 Male Stool 1 16S 700016902 700016921 5 | 159632143 Male Stool 1 16S 700033988 700033989 6 | 160380657 Male Stool 1 16S 700035728 700035747 7 | 160461578 Male Stool 1 16S 700034622 700034641 8 | 160603188 Male Stool 1 16S 700034907 700034926 9 | 160663879 Male Stool 1 16S 700095524 700095543 10 | 160765029 Male Stool 1 16S 700096361 700096380 11 | 161230322 Female Stool 1 16S 700096865 700096887 12 | 161473083 Female Stool 1 16S 700097481 700097503 13 | 275382046 Male Stool 1 16S 700106979 700105001 14 | 338793263 Female Stool 1 16S 700106437 700106465 15 | 375450439 Female Stool 1 16S 700105787 700105822 16 | 508703490 Female Stool 1 16S 700038741 700038761 17 | 517810313 Male Stool 1 16S 700106412 700106930 18 | 675950834 Female Stool 1 16S 700106229 700106259 19 | 763820215 Female Stool 1 16S 700021902 700021934 20 | 764002286 Male Stool 1 16S 700023509 700023539 21 | 764305738 Male Stool 1 16S 700024545 700024566 22 | 764325968 Male Stool 1 16S 700024593 700024615 23 | 764346198 Female Stool 1 16S 700024234 700024254 24 | 764508039 Male Stool 1 16S 700024689 700024711 25 | 765034022 Female Stool 1 16S 700037700 700037738 26 | 765661155 Female Stool 1 16S 700038284 700038322 27 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_wgs_rand_samples.tsv: -------------------------------------------------------------------------------- 1 | RSID Gender STSite Visit Type PSN SN 2 | 158822939 Male Stool 1 WGS 700014954 700014954 3 | 159207311 Male Stool 1 WGS 700016456 700016456 4 | 159389382 Male Stool 1 WGS 700016902 700016902 5 | 159632143 Male Stool 1 WGS 700033988 700033989 6 | 160380657 Male Stool 1 WGS 700035728 700035747 7 | 160461578 Male Stool 1 WGS 700034622 700034622 8 | 160603188 Male Stool 1 WGS 700034907 700034926 9 | 160663879 Male Stool 1 WGS 700095524 700095524 10 | 160765029 Male Stool 1 WGS 700096361 700096380 11 | 161230322 Female Stool 1 WGS 700096865 700096865 12 | 161473083 Female Stool 1 WGS 700097482 700097482 13 | 275382046 Male Stool 1 WGS 700106979 700105000 14 | 338793263 Female Stool 1 WGS 700106437 700106465 15 | 375450439 Female Stool 1 WGS 700105787 700105787 16 | 508703490 Female Stool 1 WGS 700038741 700038761 17 | 517810313 Male Stool 1 WGS 700106412 700106412 18 | 675950834 Female Stool 1 WGS 700106229 700106229 19 | 763820215 Female Stool 1 WGS 700021902 700021902 20 | 764002286 Male Stool 1 WGS 700023509 700023509 21 | 764305738 Male Stool 1 WGS 700024545 700024545 22 | 764325968 Male Stool 1 WGS 700024593 700024615 23 | 764346198 Female Stool 1 WGS 700024234 700024234 24 | 764508039 Male Stool 1 WGS 700024689 700024711 25 | 765034022 Female Stool 1 WGS 700037700 700037738 26 | 765661155 Female Stool 1 WGS 700038284 700038284 27 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_nares_wgs_rand_manifest.tsv: -------------------------------------------------------------------------------- 1 | file_id md5 size urls 2 | 5a950f27980b5d93e4c16da1240068fc be206b81370ebeb88d90369dba344154 5414215806 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS014459.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS014459.tar.bz2 3 | 5a950f27980b5d93e4c16da124009c6c e84aab4c2e80dccd0d50d0aa3dda17d3 164504217 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS011397.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS011397.tar.bz2 4 | 5a950f27980b5d93e4c16da1240246d7 f49def5dfd931b69e6f161c23943bc56 12613374675 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS013098.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS013098.tar.bz2 5 | 5a950f27980b5d93e4c16da12407fb21 abbafcb579f489cfa4d7d81cd91191e4 45166211 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS014464.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS014464.tar.bz2 6 | 6d91411d5ede0689305232cc77e33dd3 5b90ef4854758ed5bec43952ce4ea6e4 5994012527 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS043451.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS043451.tar.bz2 7 | 6d91411d5ede0689305232cc77fe57c3 656a1140024ae0ee956d17e5cf758034 8620371571 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/wgs/analysis/hmwgsqc/v2/SRS045004.tar.bz2,s3://nih-hmp-hhs/hmwgsqc2/SRS045004.tar.bz2 8 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_16s_rand_5_samples_manifest.tsv: -------------------------------------------------------------------------------- 1 | id md5 size urls 2 | 91319e642fdd8a6e3b059cfb056edcc2 8651daa9aeb388d516a6715c649d02a4 334020 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS013687.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS013687.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS013687.fsa.gz 3 | 8f44efd89174f146688784a27d9bda72 96f052cf1c4752da0317fc047c55644d 337858 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS013801.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS013801.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS013801.fsa.gz 4 | 91319e642fdd8a6e3b059cfb0567d6ef ada29dff92d90d68a5a7c2c584215075 277377 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS016954.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS016954.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS016954.fsa.gz 5 | 91319e642fdd8a6e3b059cfb05317d7f 22cd96b6ba65663e1ab7408fab9a960d 852088 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS014369.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS014369.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS014369.fsa.gz 6 | 8f44efd89174f146688784a27d7fa792 1d10d6bc23cdea2c773ae2c34c00f357 716265 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS049823.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS049823.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS049823.fsa.gz 7 | -------------------------------------------------------------------------------- /docker/chiron-qiime2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM umigs/chiron-core:1.2.0 2 | 3 | ########### 4 | ## Qiime ## 5 | ########### 6 | 7 | RUN apt-get -q -y update \ 8 | && apt-get -q install -y --no-install-recommends libgl1-mesa-glx 9 | 10 | # Configure matplotlib for a headless environment 11 | # https://forum.qiime2.org/t/matplotlib-configuration-issues/185/2?u=thermokarst 12 | #RUN mkdir -p ~/.config/matplotlib 13 | #RUN echo "backend : Agg" > ~/.config/matplotlib/matplotlibrc 14 | 15 | # Attempt to resolve python Click library errors 16 | ENV LC_ALL C.UTF-8 17 | ENV LANG C.UTF-8 18 | 19 | # Dependency: miniconda 20 | RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh 21 | RUN bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda 22 | ENV PATH $PATH:/opt/miniconda/bin 23 | RUN rm Miniconda3-latest-Linux-x86_64.sh 24 | 25 | # Primary: Qiime2-2017.5 26 | ARG QIIME2_VERSION=qiime2-2017.5 27 | RUN conda create -n $QIIME2_VERSION --file https://data.qiime2.org/distro/core/$QIIME2_VERSION-conda-linux-64.txt 28 | 29 | # Trying to avoid having to `source activate qiime2-2017.5 30 | ENV PATH /opt/miniconda/envs/$QIIME2_VERSION/bin:$PATH 31 | ENV CONDA_PREFIX /opt/miniconda/envs/$QIIME2_VERSION 32 | ENV CONDA_DEFAULT_ENV $QIIME2_VERSION 33 | 34 | # Change backend in Conda from Qt5Agg to Agg since we are using a headless environment (AKA Docker) 35 | RUN echo "backend : Agg" > $CONDA_PREFIX/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc 36 | -------------------------------------------------------------------------------- /pipelines/strainphlan/metaphlan_merge_complete.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Complete HMP Cloud Pilot Metaphlan merge workflow 4 | class: Workflow 5 | 6 | requirements: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-phlan 9 | - class: ScatterFeatureRequirement 10 | - class: StepInputExpressionRequirement 11 | - class: InlineJavascriptRequirement 12 | 13 | inputs: 14 | # General options 15 | input_file: 16 | label: Array of sample sequences. Start of the pipeline 17 | type: File[] 18 | input_type: 19 | label: Type of input provided among fastq,fasta,multifasta,multifastq,bowtie2out,or sam 20 | type: string 21 | seq_prefix: 22 | label: File prefix to name output 23 | type: string[] 24 | num_cores: 25 | type: int 26 | default: 1 27 | 28 | outputs: 29 | out_profile: 30 | type: File[] 31 | outputSource: metaphlan2/out_profile 32 | merged_out_profile: 33 | type: File 34 | outputSource: merge_tables/out_table 35 | 36 | steps: 37 | metaphlan2: 38 | run: metaphlan2.cwl 39 | in: 40 | input_file: input_file 41 | seq_prefix: seq_prefix 42 | input_type: input_type 43 | num_cores: num_cores 44 | out: [out_bowtie2, out_sam, out_profile, out_prefix] 45 | scatter: [input_file, seq_prefix] 46 | scatterMethod: dotproduct 47 | 48 | merge_tables: 49 | run: metaphlan_merge_tables.cwl 50 | in: 51 | input_tables: metaphlan2/out_profile 52 | out: [out_table] 53 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/fasta.h: -------------------------------------------------------------------------------- 1 | #ifndef FASTA_H 2 | #define FASTA_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | using namespace std; 12 | 13 | class Fasta 14 | { 15 | public: 16 | Fasta(); 17 | Fasta(string& name, string& s); 18 | 19 | // prints the sequence to outStream, with lineWidth bases on each 20 | // line. If lineWidth = 0, no linebreaks are printed in the sequence. 21 | void print(ostream& outStream, unsigned int lineWidth = 60) const; 22 | 23 | // returns number of bases in sequence 24 | unsigned long length() const; 25 | 26 | // returns a new fasta object which is subseq of the original. 27 | // ID will be same as original 28 | Fasta subseq(unsigned long start, unsigned long end); 29 | 30 | // fills vector with (start, end) positions of each gap in the sequence 31 | void findGaps(list >& lIn); 32 | 33 | unsigned long getNumberOfGaps(); 34 | 35 | // reads next sequence from file, filling contents appropriately 36 | // Returns true if worked ok, false if at end of file 37 | bool fillFromFile(istream& inStream); 38 | 39 | // Returns the number of 'N' + 'n' in the sequence 40 | unsigned long nCount(); 41 | 42 | // Removes any Ns off the start/end of the sequence. Sets startBases and endBases to number 43 | // of bases trimmed off each end 44 | void trimNs(unsigned long& startBases, unsigned long& endBases); 45 | 46 | string id; 47 | string seq; 48 | }; 49 | 50 | #endif // FASTA_H 51 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/errorWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "errorWindow.h" 2 | 3 | 4 | ErrorWindow::ErrorWindow() {} 5 | 6 | ErrorWindow::ErrorWindow(unsigned long coord, double min, double max, unsigned long minLength, double minPC, bool useMin, bool useMax) : coord_(coord), min_(min), max_(max), minLength_(minLength), minPC_(minPC), useMin_(useMin), useMax_(useMax) {} 7 | 8 | 9 | void ErrorWindow::clear(unsigned long coord) 10 | { 11 | coord_ = coord; 12 | passOrFail_.clear(); 13 | failCoords_.clear(); 14 | } 15 | 16 | unsigned long ErrorWindow::start() 17 | { 18 | return failCoords_.size() ? failCoords_.front() : coord_; 19 | } 20 | 21 | unsigned long ErrorWindow::end() 22 | { 23 | return failCoords_.size() ? failCoords_.back() : coord_; 24 | } 25 | 26 | bool ErrorWindow::fail() 27 | { 28 | unsigned long size = end() - start() + 1; 29 | return size >= minLength_ && 1.0 * failCoords_.size() / size >= minPC_; 30 | } 31 | 32 | 33 | bool ErrorWindow::lastFail() 34 | { 35 | return passOrFail_.size() && passOrFail_.back(); 36 | } 37 | 38 | void ErrorWindow::add(unsigned long pos, double val) 39 | { 40 | if ( (useMin_ && val < min_) || (useMax_ && val > max_) ) 41 | { 42 | failCoords_.push_back(pos); 43 | passOrFail_.push_back(true); 44 | } 45 | else 46 | { 47 | passOrFail_.push_back(false); 48 | } 49 | 50 | if (passOrFail_.size() > minLength_) 51 | { 52 | if (passOrFail_.front()) 53 | { 54 | failCoords_.pop_front(); 55 | } 56 | passOrFail_.pop_front(); 57 | coord_++; 58 | } 59 | } 60 | 61 | 62 | -------------------------------------------------------------------------------- /pipelines/metacompass/metacompass.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Metacompass utility for comparative assembly of metagenomic reads 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: ShellCommandRequirement 8 | - class: DockerRequirement 9 | dockerPull: umigs/chiron-metacompass 10 | 11 | inputs: 12 | paired_reads: 13 | label: Path to paired reads. Must provide 'unpaired_reads' or 'paired_reads' option 14 | type: File[]? 15 | inputBinding: 16 | prefix: --paired 17 | itemSeparator: ',' 18 | shellQuote: false 19 | unpaired_reads: 20 | label: Path to unpaired or singleton reads. Must provide 'unpaired_reads' or 'paired_reads' option 21 | type: File[]? 22 | inputBinding: 23 | prefix: --unpaired 24 | itemSeparator: ',' 25 | shellQuote: false 26 | reference_genomes: 27 | label: Path to reference genome fasta files. Optional 28 | type: File[]? 29 | inputBinding: 30 | prefix: --ref 31 | itemSeparator: ',' 32 | shellQuote: false 33 | max_read_length: 34 | label: Maximum read length. Optional 35 | type: int 36 | inputBinding: 37 | prefix: --readlen 38 | default: 100 39 | num_threads: 40 | label: Number of CPU threads to utilize. Optional 41 | type: int 42 | inputBinding: 43 | prefix: --threads 44 | default: 1 45 | output_directory: 46 | label: Directory path to write output to 47 | type: string 48 | inputBinding: 49 | prefix: --outdir 50 | default: './' 51 | outputs: 52 | out_dir: 53 | type: Directory 54 | outputBinding: 55 | glob: $(inputs.output_directory) 56 | 57 | baseCommand: ["/opt/MetaCompass/go_metacompass.py"] 58 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/task_seqrename.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | use File::Spec; 6 | use File::Basename; 7 | use Getopt::Long; 8 | 9 | my ($scriptname, $scriptdir) = fileparse($0); 10 | my $samtools = File::Spec->catfile($scriptdir, 'samtools'); 11 | my %options; 12 | my $usage = qq/ 13 | 14 | where is the file *.info made by 'facheck', which 15 | contains the mapping of old name to new name 16 | /; 17 | 18 | my $ERROR_PREFIX = '[REAPR seqrename]'; 19 | 20 | my $ops_ok = GetOptions( 21 | \%options, 22 | 'wrapperhelp', 23 | ); 24 | 25 | if ($options{wrapperhelp}) { 26 | print STDERR "$usage\n"; 27 | exit(1); 28 | } 29 | 30 | if (!($ops_ok) or $#ARGV != 2) { 31 | print STDERR "usage:\n$scriptname $usage\n"; 32 | exit(1); 33 | } 34 | 35 | 36 | my $old2new_file = $ARGV[0]; 37 | my $bam_in = $ARGV[1]; 38 | my $bam_out = $ARGV[2]; 39 | 40 | # hash the old -> new names 41 | my %old2new; 42 | open F, $old2new_file or die $!; 43 | 44 | while () { 45 | chomp; 46 | my ($old, $new) = split /\t/; 47 | $old =~ s/\s+$//; 48 | $old2new{$old} = $new; 49 | } 50 | close F; 51 | $old2new{'*'} = '*'; 52 | $old2new{'='} = '='; 53 | 54 | # make the new bam file 55 | open FIN, "$samtools view -h $bam_in|" or die $!; 56 | open FOUT, "| $samtools view -bS - > $bam_out" or die $!; 57 | 58 | while () { 59 | chomp; 60 | my @a =split /\t/; 61 | 62 | if ($a[0] =~ /^\@SQ/) { 63 | $a[1] = "SN:" . $old2new{substr($a[1], 3)}; 64 | } 65 | elsif ($a[0] !~ /^\@/) { 66 | $a[2] = $old2new{$a[2]}; 67 | $a[6] = $old2new{$a[6]}; 68 | } 69 | 70 | print FOUT join("\t", @a), "\n"; 71 | } 72 | 73 | close FIN; 74 | close FOUT; 75 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_H 2 | #define UTILS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "api/BamMultiReader.h" 13 | #include "api/BamReader.h" 14 | #include "tabix/tabix.hpp" 15 | 16 | const short INNIE = 1; 17 | const short OUTTIE = 2; 18 | const short SAME = 3; 19 | const short DIFF_CHROM = 4; 20 | const short UNPAIRED = 5; 21 | 22 | 23 | using namespace BamTools; 24 | using namespace std; 25 | 26 | // Returns the orientation of read pair in bam alignment, as 27 | // one of the constants INNIE, OUTTIE, SAME, DIFF_CHROM, UNPAIRED. 28 | // Setting reverse=true will swap whether INNIE or OUTTIE are returned: 29 | // useful if you have reads pointing outwards instead of in. 30 | short getPairOrientation(BamAlignment& al, bool reverse=false); 31 | 32 | // fills each list with (start, end) positions of gaps in the input file, of the form: 33 | // sequence_namestartend 34 | // and this file is expected to be bgzipped and tabixed 35 | // Map key = sequence_name 36 | void loadGaps(string fname, map > >& gaps); 37 | 38 | // splits the string on delimiter, filling vector with the result 39 | void split(const string& s, char delim, vector& elems); 40 | 41 | // Does a system call. Dies if command returns non-zero error code 42 | void systemCall(string cmd); 43 | 44 | // Fills vector with sequence names from fai file, in decreasing size order 45 | void orderedSeqsFromFai(string faiFile, vector >& seqs); 46 | 47 | 48 | bool sortByLength(const pair< string, unsigned long>& p1, const pair< string, unsigned long>& p2); 49 | 50 | #endif // UTILS_H 51 | -------------------------------------------------------------------------------- /pipelines/strainphlan/README.md: -------------------------------------------------------------------------------- 1 | # Notes for running Strainphlan CWL Workflows 2 | 3 | ## Invoking a CWL workflow 4 | ``` 5 | cwl-runner 6 | ``` 7 | The first parameter is a valid cwl tool or workflow script. In this directory, these have the extension __.cwl__. 8 | 9 | The second parameter is YAML or JSON file consisting of input parameters for the CWL script. In this directory, YAML examples are provided and are listed with the extension __.yml__. 10 | 11 | ## Running the Strainphlan pipeline 12 | ``` 13 | cwl-runner ./strainphlan_complete.cwl ./strainphlan_complete_test.yml 14 | ``` 15 | 16 | The file "strainphlan\_complete\_test.yml" is an example of a typical Strainphlan run using example inputs from the workshop tutorial. Passing in multiple input files will parallelize the pipeline runs per sample up to the point where "strainphlan" is called to build trees, in which case it uses all input markers in one command. 17 | 18 | ## Outputs 19 | * Metaphlan2 profile text file (one per input sample) 20 | * Metaphlan2 bowtie2 file (one per input sample - can be used to quickly rerun Metaphlan) 21 | * Strainphlan list of clades 22 | * Bowtie2 FASTA of sequences from reference database 23 | * Strainphlan tree with the RAxML\_bestTree algorithm 24 | * Graphlan dendrogram .png file 25 | * Graphlan single-strain dendrogram .png file 26 | 27 | ## Misc Notes 28 | * If running on MacOS/OSX, must provide the following two options: 29 | * --tmpdir-prefix=./tmp 30 | * --tmp-outdir-prefix=out 31 | * By default output is written to your current directory. To write to a specific directory, pass in the --outdir option 32 | * TODO: (potentially as needed) 33 | * Make strainphlan accept multiple clades and ref\_genomes (via array) 34 | * Make add\_metadata\_tree.py accept a list of input files instead of singles -------------------------------------------------------------------------------- /pipelines/humann2/humann2.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Humann2 - Run Humann2 tool 4 | class: CommandLineTool 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-humann2 9 | 10 | inputs: 11 | input_file: 12 | label: Accepts FASTA, FASTQ, SAM, or m8 formats 13 | inputBinding: 14 | prefix: --input 15 | type: File 16 | output_dir: 17 | inputBinding: 18 | prefix: --output 19 | type: string 20 | gap_fill: 21 | label: Can be set to "on". Default is "off" 22 | inputBinding: 23 | prefix: --gap-fill 24 | type: string? 25 | bypass_translated_search: 26 | label: Runs all of the alignment steps except the translated search 27 | inputBinding: 28 | prefix: --bypass-translated-search 29 | type: boolean? 30 | bypass_nucleotide_search: 31 | label: Bypasses all of the alignment steps before the translated search 32 | inputBinding: 33 | prefix: --bypass-nucleotide-search 34 | type: boolean? 35 | num_threads: 36 | inputBinding: 37 | prefix: --threads 38 | type: int 39 | default: 1 40 | outputs: 41 | out_dir: 42 | type: Directory 43 | outputBinding: 44 | glob: $(inputs.output_dir) 45 | out_gene_families: 46 | type: File 47 | outputBinding: 48 | glob: $(inputs.output_dir + '/' + inputs.input_file.nameroot + '_genefamilies*') 49 | out_path_abundance: 50 | type: File 51 | outputBinding: 52 | glob: $(inputs.output_dir + '/' + inputs.input_file.nameroot + '_pathabundance*') 53 | out_path_coverage: 54 | type: File 55 | outputBinding: 56 | glob: $(inputs.output_dir + '/' + inputs.input_file.nameroot + '_pathcoverage*') 57 | out_prefix: 58 | type: string 59 | outputBinding: 60 | outputEval: $(inputs.input_file.nameroot) 61 | 62 | baseCommand: ["humann2"] 63 | -------------------------------------------------------------------------------- /pipelines/strainphlan/strainphlan.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Strainphlan workflow test 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: ShellCommandRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-phlan 12 | 13 | inputs: 14 | sample_markers: 15 | # NOTE: I could not get the '*' path to work in CWL like the tutorial shows (but it works running the direct command in Docker). However, the option accepts a space-separated list so we'll use that 16 | label: List of sample marker files 17 | inputBinding: 18 | prefix: --ifn_samples 19 | itemSeparator: " " 20 | shellQuote: false 21 | type: File[] 22 | ref_marker: 23 | inputBinding: 24 | prefix: --ifn_markers 25 | type: File? 26 | input_ref_genome: 27 | inputBinding: 28 | prefix: --ifn_ref_genomes 29 | type: File? 30 | output_dir: 31 | inputBinding: 32 | prefix: --output_dir 33 | type: string 34 | clades: 35 | inputBinding: 36 | prefix: --clades 37 | type: string? 38 | marker_in_clade: 39 | inputBinding: 40 | prefix: --marker_in_clade 41 | type: float? 42 | print_clades_only: 43 | inputBinding: 44 | prefix: --print_clades_only 45 | type: boolean? 46 | num_cores: 47 | inputBinding: 48 | prefix: --nprocs_main 49 | type: int 50 | default: 1 51 | outputs: 52 | out_dir: 53 | type: Directory 54 | outputBinding: 55 | glob: $(inputs.output_dir) 56 | out_tree: 57 | type: File? 58 | outputBinding: 59 | glob: $('RAxML_bestTree.*.tree') 60 | out_fasta: 61 | type: File? 62 | outputBinding: 63 | glob: $('*.fasta') 64 | secondaryFiles: $('^.polymorphic') 65 | clades_out: 66 | type: stdout 67 | 68 | stdout: clades.txt 69 | 70 | baseCommand: ["strainphlan.py"] 71 | -------------------------------------------------------------------------------- /pipelines/qiime2/README.md: -------------------------------------------------------------------------------- 1 | # Notes for running QIIME CWL Workflows 2 | 3 | ## Invoking a CWL workflow 4 | ``` 5 | cwl-runner 6 | ``` 7 | The first parameter is a valid cwl tool or workflow script. In this directory, these have the extension __.cwl__. 8 | 9 | The second parameter is a YAML or JSON file consisting of input parameters for the CWL script. In this directory, YAML examples are provided and are listed with the extension __.yml__. 10 | 11 | ## Running the QIIME2 pipeline 12 | ``` 13 | cwl-runner ./qiime2_complete.cwl ./qiime2_complete_test.yml 14 | ``` 15 | 16 | The file "qiime2\_complete\_test.yml" is an example of a typical QIIME2 run using example inputs from the workshop tutorial. 17 | 18 | ## Outputs from CWL pipeline 19 | * Representative sequences .qza file (post-denoising) 20 | * Representative table .qza file (post-denoising) 21 | * Rooted tree .qza file 22 | * Feature table visualization .qzv file 23 | * Feature sequences visualization .qzv file 24 | * Alpha group significance visualization .qzv file (Faith Phylogenetic Diversity) 25 | * Alpha group significance visualization .qzv file (Evenness metric) 26 | * A Beta group significance visualization .qzv file (Unweighted UniFrac by chosen metadata category) 27 | * Emperor PCoA plot .qzv file (Unweighted UniFrac) 28 | * Emperor PCoA plot .qzv file (Bray-Curtis) 29 | * Taxonomic visualization .qzv file 30 | * Taxonomic barplot .qzv file 31 | * Differential abundance visualization .qzv file 32 | * Differential abundance visualization .qzv file (collapse to chosen taxonomic level) 33 | 34 | ## Misc Notes 35 | Any additional command-line options must be provided before the "cwl tool/workflow script" 36 | * If running on MacOS/OSX, must provide the following two options: 37 | * --tmpdir-prefix=./tmp 38 | * --tmp-outdir-prefix=out 39 | * By default output is written to your current directory. To write to a specific directory, pass in the --outdir option 40 | * The basename of the demultiplexed sequences file will be used as a naming prefix for the outputted files -------------------------------------------------------------------------------- /examples/hmp_data_exercise/extract_qiime_subset.R: -------------------------------------------------------------------------------- 1 | # R Script to subset the Qiime matrices to extract the samples specified 2 | # in the input sample list file 3 | library("getopt") 4 | 5 | # Get the options specified on the command line 6 | spec = matrix(c('qiime', 'q', 1, "character", 7 | 'samples', 's', 1, "character", 8 | 'outfile', 'o', 1, "character", 9 | 'help', 'h', 0, "logical" 10 | ), 11 | byrow = TRUE, ncol=4) 12 | opt = getopt(spec) 13 | 14 | if ( !is.null(opt$help) ) { 15 | cat(getopt(spec, usage=TRUE)); 16 | q(status=1); 17 | } 18 | 19 | if ( is.null(opt$qiime) ) { 20 | print("Qiime OTU table missing.\n") 21 | cat(getopt(spec, usage=TRUE)); 22 | q(status=1); 23 | } 24 | 25 | if ( is.null(opt$samples) ) { 26 | cat("Samples file missing.\n") 27 | cat(getopt(spec, usage=TRUE)); 28 | q(status=1); 29 | } 30 | 31 | if ( is.null(opt$outfile) ) { 32 | print("Output file not specified.\n") 33 | cat(getopt(spec, usage=TRUE)); 34 | q(status=1); 35 | } 36 | 37 | qiime_file = opt$qiime 38 | samples_file = opt$samples 39 | outfile = opt$outfile 40 | 41 | # setwd("/Users/amahurkar/Documents/Projects/DACC/CloudPilot") 42 | # qiime_file = "otu_table_psn_v35.txt" 43 | # samples_file = "stool_nares_subsamples.tsv" 44 | # outfile = paste("stool_nares_subsamples_", qiime_file, sep = "") 45 | 46 | # Read the samples file 47 | samples = read.csv(samples_file, sep = "\t", header = TRUE, 48 | stringsAsFactors = FALSE) 49 | 50 | # Read Qiime table 51 | qiime = read.csv(qiime_file, sep = "\t", header = TRUE, comment.char = "", 52 | stringsAsFactors = FALSE, skip = 1) 53 | 54 | # Filter the Qiime table for the samples in the list 55 | subsample_list = samples[which(samples$Type == "16S"), ] 56 | subsample_list$SampleName = paste("X", subsample_list$PSN, sep = "") 57 | col_list = colnames(qiime) 58 | indices = which(col_list %in% subsample_list$SampleName) 59 | subsamples = qiime[, c(1, indices, ncol(qiime))] 60 | write.csv(file = outfile, subsamples, 61 | row.names = FALSE, quote = FALSE) 62 | -------------------------------------------------------------------------------- /docker/chiron-valet/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM umigs/chiron-core:1.2.0 2 | 3 | ########### 4 | ## VALET ## 5 | ########### 6 | 7 | RUN apt-get install -y bedtools bamtools emacs libfile-copy-link-perl libncurses5 libncurses5-dev libtbb2 smalt tabix 8 | 9 | # We install bowtie2-legacy since normal bowtie2 doesn't want to play nicely. 10 | RUN wget -O /opt/bowtie2-2.3.2-legacy-linux-x86_64.zip https://sourceforge.net/projects/bowtie-bio/files/bowtie2/2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip/download 11 | RUN unzip -d /opt/ /opt/bowtie2-2.3.2-legacy-linux-x86_64.zip 12 | RUN rm /opt/bowtie2-2.3.2-legacy-linux-x86_64.zip 13 | ENV PATH /opt/bowtie2-2.3.2-legacy:$PATH 14 | ENV BT2_HOME=/opt/bowtie2-2.3.2-legacy 15 | 16 | RUN wget -O /tmp/samtools-1.4.1.tar.bz2 https://github.com/samtools/samtools/releases/download/1.4.1/samtools-1.4.1.tar.bz2 17 | RUN tar -xjf /tmp/samtools-1.4.1.tar.bz2 -C /tmp/ 18 | RUN /tmp/samtools-1.4.1/configure --prefix=/opt/samtools-1.4.1 --enable-plugins --enable-libcurl 19 | RUN mv config.h config.mk config.status /tmp/samtools-1.4.1 20 | RUN make -C /tmp/samtools-1.4.1 all all-htslib 21 | RUN make -C /tmp/samtools-1.4.1 install 22 | ENV PATH $PATH:/opt/samtools-1.4.1/bin 23 | 24 | RUN pip install numpy 25 | RUN pip install scipy 26 | 27 | ## Compilation doesn't work, so we're using a pre-compiled version instead 28 | # RUN wget -O /tmp/Reapr_1.0.18.tar.gz ftp://ftp.sanger.ac.uk/pub/resources/software/reapr/Reapr_1.0.18.tar.gz 29 | # RUN tar -xzf /tmp/Reapr_1.0.18.tar.gz -C /tmp/ 30 | # RUN cd /tmp/Reapr_1.0.18/ && ./install.sh 31 | 32 | RUN mkdir -p /opt/reapr/tabix 33 | COPY reapr/* /opt/reapr/ 34 | ENV PATH=/opt/reapr:$PATH 35 | RUN ln -s /opt/reapr/reapr.pl /opt/reapr/reapr 36 | RUN ln -s /usr/lib/x86_64-linux-gnu/libbamtools.so.2.4.0 /usr/lib/x86_64-linux-gnu/libbamtools.so.2.1.0 37 | RUN cp /opt/samtools-1.4.1/bin/samtools /opt/reapr/ 38 | RUN cp /usr/bin/smalt /opt/reapr/ 39 | RUN cp /usr/bin/bgzip /opt/reapr/tabix/ 40 | RUN cp /usr/bin/tabix /opt/reapr/tabix/ 41 | 42 | COPY get_sample_data /usr/bin/ 43 | 44 | RUN git clone https://github.com/cmhill/VALET.git /opt/VALET 45 | ENV VALET /opt/VALET/src/py/ 46 | 47 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/extract_metaphlan_subset.R: -------------------------------------------------------------------------------- 1 | # R Script to subset the Qiime and MetaPhlAn matrices to extract the samples specified 2 | # in the input sample list file 3 | library(getopt) 4 | 5 | # Get the options specified on the command line 6 | spec = matrix(c('metaphlan', 'm', 1, "character", 7 | 'samples', 's', 1, "character", 8 | 'outfile', 'o', 1, "character", 9 | 'help', 'h', 0, "logical" 10 | ), 11 | byrow = TRUE, ncol=4) 12 | opt = getopt(spec) 13 | 14 | if ( !is.null(opt$help) ) { 15 | cat(getopt(spec, usage=TRUE)); 16 | q(status=1); 17 | } 18 | 19 | if ( is.null(opt$samples) ) { 20 | cat("Samples file missing.\n") 21 | cat(getopt(spec, usage=TRUE)); 22 | q(status=1); 23 | } 24 | 25 | if ( is.null(opt$metaphlan) ) { 26 | cat("MetaPhlAn table missing.\n") 27 | cat(getopt(spec, usage=TRUE)); 28 | q(status=1); 29 | } 30 | 31 | if ( is.null(opt$outfile) ) { 32 | print("Output file not specified.\n") 33 | cat(getopt(spec, usage=TRUE)); 34 | q(status=1); 35 | } 36 | 37 | metaphlan_file = opt$metaphlan 38 | samples_file = opt$samples 39 | outfile = opt$outfile 40 | 41 | # setwd("/Users/amahurkar/Documents/Projects/DACC/CloudPilot") 42 | # samples_file = "stool_wgs_rand_samples.tsv" 43 | # metaphlan_file = "hmp1-II_metaphlan2-mtd-qcd.pcl.txt" 44 | # outfile = paste("stool_nares_subsamples_", metaphlan_file, sep = "") 45 | 46 | # Read the samples file 47 | samples = read.csv(samples_file, sep = "\t", header = TRUE, 48 | stringsAsFactors = FALSE) 49 | 50 | # Read the metaphlan table 51 | mphlan = read.csv(metaphlan_file, sep = "\t", header = TRUE, 52 | stringsAsFactors = FALSE, comment.char = "") 53 | 54 | # Filter the Metaphlan table for the samples in the list 55 | subsample_list = samples[which(samples$Type == "WGS"), ] 56 | subsample_list$SampleName = paste("X", subsample_list$SN, sep = "") 57 | col_list = colnames(mphlan) 58 | indices = which(col_list %in% subsample_list$SampleName) 59 | subsamples = mphlan[, c(1, indices)] 60 | write.csv(file = outfile, subsamples, 61 | row.names = FALSE, quote = FALSE) 62 | -------------------------------------------------------------------------------- /pipelines/strainphlan/metaphlan2.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: BioBakery MetaPhlan2 script 4 | class: CommandLineTool 5 | 6 | requirements: 7 | - class: InlineJavascriptRequirement 8 | 9 | hints: 10 | - class: DockerRequirement 11 | dockerPull: umigs/chiron-phlan 12 | 13 | inputs: 14 | input_file: 15 | inputBinding: 16 | position: 1 17 | type: File 18 | seq_prefix: 19 | label: Prefix to give to output files 20 | type: string 21 | # index_dir: 22 | # type: Directory? 23 | # base_str: 24 | # type: string? 25 | # mpa_pkl: 26 | # label: The metadata pickled MetaPhlAn filename 27 | # type: string? 28 | bowtie2_out: 29 | inputBinding: 30 | prefix: --bowtie2out 31 | valueFrom: $(inputs.seq_prefix + '_bowtie2_out.bz2') 32 | type: string? 33 | default: 'bowtie2_out.bz2' 34 | sam_out: 35 | inputBinding: 36 | prefix: --samout 37 | valueFrom: $(inputs.seq_prefix + '.sam.bz2') 38 | type: string? 39 | default: 'sam.bz2' 40 | profile_out: 41 | inputBinding: 42 | position: 2 43 | valueFrom: $(inputs.seq_prefix + '_profile.txt') 44 | type: string? 45 | default: 'profile.txt' 46 | input_type: 47 | label: Type of input provided among fastq,fasta,multifasta,multifastq,bowtie2out,or sam 48 | inputBinding: 49 | prefix: --input_type 50 | type: string 51 | num_cores: 52 | inputBinding: 53 | prefix: --nproc 54 | type: int 55 | default: 1 56 | outputs: 57 | out_bowtie2: 58 | type: File 59 | outputBinding: 60 | glob: $('*' +inputs.bowtie2_out) 61 | out_sam: 62 | type: File 63 | outputBinding: 64 | glob: $('*' + inputs.sam_out) 65 | out_profile: 66 | type: File 67 | outputBinding: 68 | glob: $('*' + inputs.profile_out) 69 | out_prefix: 70 | type: string 71 | outputBinding: 72 | outputEval: $(inputs.seq_prefix) 73 | 74 | #arguments: 75 | # - valueFrom: $(inputs.index_dir.path + '/' + inputs.base_str) 76 | # prefix: --bowtie2db 77 | # - valueFrom: $(inputs.index_dir.path + '/' + inputs.mpa_pkl) 78 | # prefix: --mpa_pkl 79 | 80 | baseCommand: ["metaphlan2.py"] 81 | -------------------------------------------------------------------------------- /pipelines/qiime2/diff_abundance.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Perform differential abundance analysis 4 | class: Workflow 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-qiime2 9 | - class: StepInputExpressionRequirement 10 | - class: InlineJavascriptRequirement 11 | 12 | inputs: 13 | metadata_file: 14 | type: File 15 | metadata_category: 16 | type: string 17 | input_table: 18 | type: File 19 | outputs: 20 | feat_visual: 21 | type: File 22 | outputSource: ancom/out_visual 23 | 24 | steps: 25 | add_pseudocount: 26 | run: 27 | class: CommandLineTool 28 | baseCommand: ["qiime", "composition", "add-pseudocount"] 29 | inputs: 30 | table: 31 | inputBinding: 32 | prefix: --i-table 33 | type: File 34 | composition: 35 | inputBinding: 36 | prefix: --o-composition-table 37 | type: string 38 | default: 'comp-table.qza' 39 | outputs: 40 | out_comp_table: 41 | type: File 42 | outputBinding: 43 | glob: $(inputs.composition) 44 | in: 45 | table: input_table 46 | out: [out_comp_table] 47 | 48 | ancom: 49 | run: 50 | class: CommandLineTool 51 | baseCommand: ["qiime", "composition", "ancom"] 52 | inputs: 53 | comp_table: 54 | inputBinding: 55 | prefix: --i-table 56 | type: File 57 | metadata_file: 58 | inputBinding: 59 | prefix: --m-metadata-file 60 | type: File 61 | metadata_category: 62 | inputBinding: 63 | prefix: --m-metadata-category 64 | type: string 65 | feat_visualization: 66 | inputBinding: 67 | prefix: --o-visualization 68 | type: string 69 | default: 'ancom.qzv' 70 | outputs: 71 | out_visual: 72 | type: File 73 | outputBinding: 74 | glob: $(inputs.feat_visualization) 75 | in: 76 | comp_table: add_pseudocount/out_comp_table 77 | metadata_file: metadata_file 78 | metadata_category: metadata_category 79 | out: [out_visual] 80 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_nares_16s_rand_samples.tsv: -------------------------------------------------------------------------------- 1 | RSID Gender Visit STSite Type PSN SN Region 2 | 159611913 Male 1 Anterior_nares 16S 700033577 700033613 V35 3 | 159611913 Male 1 Stool 16S 700033559 700033435 V35 4 | 160016515 Female 1 Stool 16S 700035369 700035392 V35 5 | 160016515 Female 1 Anterior_nares 16S 700035320 700035367 V35 6 | 160036745 Female 1 Anterior_nares 16S 700032467 700032468 V35 7 | 160036745 Female 1 Stool 16S 700032413 700032414 V35 8 | 160239046 Male 1 Anterior_nares 16S 700035315 700035357 V35 9 | 160239046 Male 1 Stool 16S 700035297 700035321 V35 10 | 160259276 Female 1 Anterior_nares 16S 700035949 700035989 V35 11 | 160259276 Female 1 Stool 16S 700035931 700035953 V35 12 | 160643649 Female 1 Anterior_nares 16S 700095231 700095271 V35 13 | 160643649 Female 1 Stool 16S 700095213 700095235 V35 14 | 160684109 Male 1 Stool 16S 700095717 700095736 V35 15 | 160684109 Male 1 Anterior_nares 16S 700095735 700095772 V35 16 | 161554003 Male 1 Stool 16S 700097754 700097773 V35 17 | 161554003 Male 1 Anterior_nares 16S 700097772 700097809 V35 18 | 178713055 Female 1 Stool 16S 700105049 700105087 V35 19 | 178713055 Female 1 Anterior_nares 16S 700105035 700105059 V35 20 | 257905678 Female 1 Anterior_nares 16S 700111174 700111214 V35 21 | 257905678 Female 1 Stool 16S 700111156 700111178 V35 22 | 368533040 Male 1 Anterior_nares 16S 700102061 700102098 V35 23 | 368533040 Male 1 Stool 16S 700102043 700102062 V35 24 | 533247696 Female 1 Anterior_nares 16S 700098127 700098167 V35 25 | 533247696 Female 1 Stool 16S 700098109 700098131 V35 26 | 763678604 Male 1 Stool 16S 700021807 700021824 V35 27 | 763678604 Male 1 Anterior_nares 16S 700021812 700021836 V35 28 | 763921366 Female 1 Anterior_nares 16S 700023452 700023487 V35 29 | 763921366 Female 1 Stool 16S 700023447 700023477 V35 30 | 764508039 Male 1 Stool 16S 700024689 700024711 V35 31 | 764508039 Male 1 Anterior_nares 16S 700024688 700024709 V35 32 | 765034022 Female 1 Stool 16S 700037700 700037738 V35 33 | 765034022 Female 1 Anterior_nares 16S 700037686 700037710 V35 34 | 765074482 Male 1 Anterior_nares 16S 700024955 700024976 V35 35 | 765074482 Male 1 Stool 16S 700024966 700024998 V35 36 | 765094712 Male 1 Anterior_nares 16S 700037031 700037052 V35 37 | 765094712 Male 1 Stool 16S 700037042 700037074 V35 38 | 809635352 Female 1 Stool 16S 700098429 700098451 V35 39 | 809635352 Female 1 Anterior_nares 16S 700098447 700098487 V35 40 | 892969023 Female 1 Anterior_nares 16S 700099974 700100014 V35 41 | 892969023 Female 1 Stool 16S 700099956 700099978 V35 42 | -------------------------------------------------------------------------------- /pipelines/humann2/README.md: -------------------------------------------------------------------------------- 1 | # Notes for running Humann2 CWL Workflows 2 | 3 | ## Invoking a CWL workflow 4 | ``` 5 | cwl-runner 6 | ``` 7 | The first parameter is a valid cwl tool or workflow script. In this directory, these have the extension __.cwl__. 8 | 9 | The second parameter is YAML or JSON file consisting of input parameters for the CWL script. In this directory, YAML examples are provided and are listed with the extension __.yml__. 10 | 11 | Any additional command-line options must be provided before the "cwl tool/workflow script" 12 | 13 | ## Running the Humann2 pipeline 14 | ### Standard humann2 run 15 | ``` 16 | cwl-runner ./humann2_complete.cwl ./humann2_complete_test.yml 17 | ``` 18 | 19 | The file "humann2\_complete\_test.yml" is an example of a typical Humann2 run using example inputs from the workshop tutorial. Passing in multiple input files will parallelize the pipeline runs per sample. 20 | 21 | ### Pipeline that merges Humann2 output first 22 | ``` 23 | cwl-runner ./humann2_join_complete.cwl ./humann2_join_complete_test.yml 24 | ``` 25 | 26 | The file "humann2\_join\_complete\_test.yml" is an example of a typical Humann2 run that first merges all humann2 output files in a given directory before running the downstream steps. Passing in multiple input directories will parallelize the pipeline runs per directory. 27 | 28 | ## Outputs (for both pipelines) 29 | * Feature .tsv file from humann2\_rename\_table 30 | * Normalized .tsv file from humann2\_renorm\_table 31 | * Regrouped .tsv file from humann2\_regroup\_table 32 | 33 | ## Misc Notes 34 | 35 | * If running on MacOS/OSX, must provide the following two options: 36 | * --tmpdir-prefix=./tmp 37 | * --tmp-outdir-prefix=out 38 | * By default output is written to your current directory. To write to a specific directory, pass in the --outdir option 39 | * Some Biobakery demo steps will fail because the 'uniref90' database is not downloaded by default in the Docker image. Please see section 1.2.1 for information on how to install the requisite databases 40 | * Section 3.1 41 | * Section 3.3 42 | * For tests where the output file is located in the same directory as the input file in the tutorial example, I am moving it up a directory. The input directory/file is mounted in Docker as read-only, so this poses issues with writing to that same directory 43 | * Section 3.1 44 | * Section 3.2 45 | * Section 3.3 46 | * TODO: Create humann group tests for Section 4.2 (join features into one table) -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_wgs_rand_5_samples_manifest.tsv: -------------------------------------------------------------------------------- 1 | id md5 size urls 2 | 6d91411d5ede0689305232cc77f3f721 8d1a5f014822588004da1af7842d8a07 8263639495 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/WGS/analysis/hmWGSqc/v2/SRS013687.tar.bz2,s3://nih-hmp-hhs/hmWGSqc2/SRS013687.tar.bz2 3 | 91319e642fdd8a6e3b059cfb0588df5d 8d1a5f014822588004da1af7842d8a07 8263639495 http://downloads.hmpdacc.org/data/Illumina/stool/SRS013687.tar.bz2,ftp://public-ftp.hmpdacc.org/data/Illumina/stool/SRS013687.tar.bz2,s3://human-microbiome-project/HHS/Illumina/stool/SRS013687.tar.bz2 4 | 91319e642fdd8a6e3b059cfb058851e0 dfe83bc44e52ab176367008ecd4a2802 7797737041 http://downloads.hmpdacc.org/data/Illumina/stool/SRS013800.tar.bz2,ftp://public-ftp.hmpdacc.org/data/Illumina/stool/SRS013800.tar.bz2,s3://human-microbiome-project/HHS/Illumina/stool/SRS013800.tar.bz2 5 | 6d91411d5ede0689305232cc77e79804 dfe83bc44e52ab176367008ecd4a2802 7797737041 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/WGS/analysis/hmWGSqc/v2/SRS013800.tar.bz2,s3://nih-hmp-hhs/hmWGSqc2/SRS013800.tar.bz2 6 | 91319e642fdd8a6e3b059cfb0585b466 d4ecedcefb1300a259b8536e2924c1aa 8347179620 http://downloads.hmpdacc.org/data/Illumina/stool/SRS016954.tar.bz2,ftp://public-ftp.hmpdacc.org/data/Illumina/stool/SRS016954.tar.bz2,s3://human-microbiome-project/HHS/Illumina/stool/SRS016954.tar.bz2 7 | 6d91411d5ede0689305232cc77f62847 d4ecedcefb1300a259b8536e2924c1aa 8347179620 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/WGS/analysis/hmWGSqc/v2/SRS016954.tar.bz2,s3://nih-hmp-hhs/hmWGSqc2/SRS016954.tar.bz2 8 | 91319e642fdd8a6e3b059cfb05a20667 e1e617a0217514c4e4d2de1d3bda2f2c 7848634243 http://downloads.hmpdacc.org/data/Illumina/PHASEII/stool/SRS012969.tar.bz2,ftp://public-ftp.hmpdacc.org/Illumina/PHASEII/stool/SRS012969.tar.bz2,s3://human-microbiome-project/HHS/Illumina/PHASEII/stool/SRS012969.tar.bz2 9 | 6d91411d5ede0689305232cc77e34378 e1e617a0217514c4e4d2de1d3bda2f2c 7848634243 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/WGS/analysis/hmWGSqc/v2/SRS012969.tar.bz2,s3://nih-hmp-hhs/hmWGSqc2/SRS012969.tar.bz2 10 | 91319e642fdd8a6e3b059cfb058da0e5 f1b58364a467566decdf8d2ee3eed979 5917257886 http://downloads.hmpdacc.org/data/Illumina/PHASEII/stool/SRS016437.tar.bz2,ftp://public-ftp.hmpdacc.org/Illumina/PHASEII/stool/SRS016437.tar.bz2,s3://human-microbiome-project/HHS/Illumina/PHASEII/stool/SRS016437.tar.bz2 11 | 5a950f27980b5d93e4c16da12404e3d8 f1b58364a467566decdf8d2ee3eed979 5917257886 http://downloads.hmpdacc.org/data2/hhs/genome/microbiome/WGS/analysis/hmWGSqc/v2/SRS016437.tar.bz2,s3://nih-hmp-hhs/hmWGSqc2/SRS016437.tar.bz2 12 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_join_complete.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Humann2 - Complete pipeline that merges Humann2 output first 4 | class: Workflow 5 | 6 | requirements: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-humann2 9 | - class: ScatterFeatureRequirement 10 | - class: StepInputExpressionRequirement 11 | - class: InlineJavascriptRequirement 12 | 13 | inputs: 14 | input_dir: 15 | label: Directory with some Humann2 output 16 | type: Directory 17 | file_name: 18 | label: File type to merge (i.e. 'genefamilies') 19 | type: string 20 | # Rename Table option 21 | feat_db: 22 | type: string 23 | default: 'uniref90' 24 | # Renorm Table options 25 | normalize_units: 26 | label: Compositional units to normalize to (copies per million - 'cpm' or relative abundance) 27 | type: string 28 | default: 'cpm' 29 | update_snames: 30 | label: update sample names header 31 | type: boolean 32 | default: true 33 | # Regroup Table option 34 | regrouping_category: 35 | label: Categories in which to regroup our Humann2 table 36 | type: string 37 | default: 'uniref90_level4ec' 38 | 39 | outputs: 40 | merged_tsv: 41 | type: File 42 | outputSource: humann2_join_tables/out_tsv 43 | feature_tsv: 44 | type: File 45 | outputSource: rename_table/out_tsv 46 | normalize_tsv: 47 | type: File 48 | outputSource: renorm_table/out_tsv 49 | regrouped_tsv: 50 | type: File 51 | outputSource: regroup_table/out_tsv 52 | 53 | steps: 54 | 55 | humann2_join_tables: 56 | run: humann2_join_tables.cwl 57 | in: 58 | input_dir: input_dir 59 | file_name: file_name 60 | output_tsv: 61 | valueFrom: $('merged_' + inputs.file_name + '.tsv') 62 | out: [out_tsv] 63 | 64 | rename_table: 65 | run: humann2_rename_table.cwl 66 | in: 67 | input_tsv: humann2_join_tables/out_tsv 68 | output_tsv: 69 | default: 'merged_genefamilies-names.tsv' 70 | names: feat_db 71 | out: [out_tsv] 72 | 73 | renorm_table: 74 | run: humann2_renorm_table.cwl 75 | in: 76 | input_tsv: humann2_join_tables/out_tsv 77 | output_tsv: 78 | valueFrom: $('merged_genefamilies-' + inputs.units + '.tsv') 79 | units: normalize_units 80 | update_snames: update_snames 81 | out: [out_tsv] 82 | 83 | regroup_table: 84 | run: humann2_regroup_table.cwl 85 | in: 86 | input_tsv: renorm_table/out_tsv 87 | output_tsv: 88 | valueFrom: $('merged_genefamilies-' + inputs.groups +'.tsv') 89 | groups: regrouping_category 90 | out: [out_tsv] 91 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/scaff2contig.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "fasta.h" 11 | 12 | using namespace std; 13 | 14 | int main(int argc, char* argv[]) 15 | { 16 | if (argc < 2) 17 | { 18 | cerr << "usage:\nscaff2contig [min length, default = 1]" << endl; 19 | exit(1); 20 | } 21 | 22 | Fasta fa; 23 | string infile = argv[1]; 24 | unsigned long minLength = argc == 3 ? atoi(argv[2]) : 1; 25 | 26 | ifstream ifs(infile.c_str()); 27 | 28 | if (!ifs.good()) 29 | { 30 | cerr << "Error opening file '" << infile << "'" << endl; 31 | exit(1); 32 | } 33 | 34 | // for each sequence in the input file, find the gaps, print contigs 35 | while (fa.fillFromFile(ifs)) 36 | { 37 | list > gaps; 38 | fa.findGaps(gaps); 39 | 40 | if (gaps.size() == 0) 41 | { 42 | fa.print(cout); 43 | continue; 44 | } 45 | 46 | unsigned long counter = 1; 47 | unsigned long previousGapEnd = 0; 48 | bool first = true; 49 | 50 | for(list >::iterator p = gaps.begin(); p != gaps.end(); p++) 51 | { 52 | unsigned long startCoord; 53 | 54 | if (first) 55 | { 56 | startCoord = 0; 57 | first = false; 58 | } 59 | else 60 | { 61 | startCoord = previousGapEnd + 1; 62 | } 63 | 64 | previousGapEnd = p->second; 65 | if (p->first - startCoord < minLength) continue; 66 | 67 | stringstream ss; 68 | ss << fa.id << "_" << counter << "_" << startCoord + 1 << "_" << p->first; 69 | string id = ss.str(); 70 | string seq = fa.seq.substr(startCoord, p->first - startCoord); 71 | Fasta ctg(id, seq); 72 | ctg.print(cout); 73 | counter++; 74 | } 75 | 76 | unsigned long lastLength = fa.length() - gaps.back().second - 1; 77 | if (lastLength >= minLength) 78 | { 79 | stringstream ss; 80 | ss << fa.id << "_" << counter << "_" << gaps.back().second + 2 << "_" << fa.length(); 81 | string id = ss.str(); 82 | string seq = fa.seq.substr(gaps.back().second + 1, lastLength); 83 | Fasta ctg(id, seq); 84 | ctg.print(cout); 85 | } 86 | 87 | } 88 | 89 | ifs.close(); 90 | return 0; 91 | } 92 | 93 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/extract_subset.R: -------------------------------------------------------------------------------- 1 | # R Script to subset the Qiime and MetaPhlAn matrices to extract the samples specified 2 | # in the input sample list file 3 | library("getopt") 4 | 5 | # Get the options specified on the command line 6 | spec = matrix(c('qiime', 'q', 1, "character", 7 | 'metaphlan', 'm', 1, "character", 8 | 'samples', 's', 1, "character", 9 | 'help', 'h', 0, "logical" 10 | ), 11 | byrow = TRUE, ncol=4) 12 | opt = getopt(spec) 13 | 14 | if ( !is.null(opt$help) ) { 15 | cat(getopt(spec, usage=TRUE)); 16 | q(status=1); 17 | } 18 | 19 | if ( is.null(opt$qiime) ) { 20 | print("Qiime OTU table missing.\n") 21 | cat(getopt(spec, usage=TRUE)); 22 | q(status=1); 23 | } 24 | 25 | if ( is.null(opt$samples) ) { 26 | cat("Samples file missing.\n") 27 | cat(getopt(spec, usage=TRUE)); 28 | q(status=1); 29 | } 30 | 31 | if ( is.null(opt$metaphlan) ) { 32 | cat("MetaPhlAn table missing.\n") 33 | cat(getopt(spec, usage=TRUE)); 34 | q(status=1); 35 | } 36 | 37 | qiime_file = opt$qiime 38 | metaphlan_file = opt$metaphlan 39 | samples_file = opt$samples 40 | 41 | # setwd("/Users/amahurkar/Documents/Projects/DACC/CloudPilot") 42 | # qiime_file = "v35_psn_otu.genus.fixed.txt" 43 | # samples_file = "Stool_rand_samples.txt" 44 | # metaphlan_file = "hmp1-II_metaphlan2-mtd-qcd.pcl.txt" 45 | 46 | # Read the samples file 47 | samples = read.csv(samples_file, sep = "\t", header = TRUE, 48 | stringsAsFactors = FALSE) 49 | 50 | # Read the metaphlan table 51 | mphlan = read.csv(metaphlan_file, sep = "\t", header = TRUE, 52 | stringsAsFactors = FALSE) 53 | 54 | # Filter the Metaphlan table for the samples in the list 55 | subsample_list = samples[which(samples$Type == "WGS"), ] 56 | subsample_list$SampleName = paste("X", subsample_list$SN, sep = "") 57 | col_list = colnames(mphlan) 58 | indices = which(col_list %in% subsample_list$SampleName) 59 | subsamples = mphlan[, c(1, indices)] 60 | write.csv(file = paste("subset_of_", metaphlan_file, sep = ""), subsamples, 61 | row.names = FALSE, quote = FALSE) 62 | 63 | # Read Qiime table 64 | qiime = read.csv(qiime_file, sep = "\t", header = TRUE, 65 | stringsAsFactors = FALSE) 66 | 67 | # Filter the Qiime table for the samples in the list 68 | subsample_list = samples[which(samples$Type == "16S"), ] 69 | subsample_list$SampleName = paste("X", subsample_list$PSN, sep = "") 70 | col_list = colnames(qiime) 71 | indices = which(col_list %in% subsample_list$SampleName) 72 | subsamples = qiime[, c(1, indices, ncol(qiime))] 73 | write.csv(file = paste("subset_of_", qiime_file, sep = ""), subsamples, 74 | row.names = FALSE, quote = FALSE) 75 | -------------------------------------------------------------------------------- /pipelines/qiime2/deblur.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Deblur denoising tool 4 | class: Workflow 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-qiime2 9 | 10 | inputs: 11 | input_seqs: 12 | type: File 13 | 14 | outputs: 15 | out_seqs: 16 | type: File 17 | outputSource: denoise_16S/out_seqs 18 | out_table: 19 | type: File 20 | outputSource: denoise_16S/out_table 21 | 22 | steps: 23 | quality_filter: 24 | label: Quality filter based on q-score 25 | run: 26 | class: CommandLineTool 27 | baseCommand: ["qiime", "quality-filter", "q-score"] 28 | inputs: 29 | input_seqs: 30 | inputBinding: 31 | prefix: --i-demux 32 | type: File 33 | filtered_seqs: 34 | inputBinding: 35 | prefix: --o-filtered-sequences 36 | type: string 37 | default: "demux-filtered.qza" 38 | filter_stats: 39 | inputBinding: 40 | prefix: --o-filter-stats 41 | type: string 42 | default: "demux-filter-stats.qza" 43 | outputs: 44 | out_seqs: 45 | type: File 46 | outputBinding: 47 | glob: $(inputs.filtered_seqs) 48 | out_stats: 49 | type: File 50 | outputBinding: 51 | glob: $(inputs.filter_stats) 52 | in: 53 | input_seqs: input_seqs 54 | out: [out_seqs, out_stats] 55 | 56 | denoise_16S: 57 | label: Denoise the sample 58 | run: 59 | class: CommandLineTool 60 | baseCommand: ["qiime", "deblur", "denoise-16S"] 61 | inputs: 62 | input_seqs: 63 | inputBinding: 64 | prefix: --i-demultiplexed-seqs 65 | type: File 66 | trim_length: 67 | inputBinding: 68 | prefix: --p-trim-length 69 | type: int 70 | default: 120 71 | rep_seqs: 72 | inputBinding: 73 | prefix: --o-representative-sequences 74 | type: string 75 | default: "rep-seqs.qza" 76 | table: 77 | inputBinding: 78 | prefix: --o-table 79 | type: string 80 | default: "table.qza" 81 | stats: 82 | inputBinding: 83 | prefix: --o-stats 84 | type: string 85 | default: "deblur-stats.qza" 86 | outputs: 87 | out_seqs: 88 | type: File 89 | outputBinding: 90 | glob: $(inputs.rep_seqs) 91 | out_table: 92 | type: File 93 | outputBinding: 94 | glob: $(inputs.table) 95 | out_stats: 96 | type: File 97 | outputBinding: 98 | glob: $(inputs.stats) 99 | in: 100 | input_seqs: quality_filter/out_seqs 101 | out: [out_seqs, out_table, out_stats] 102 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | 4 | short getPairOrientation(BamAlignment& al, bool reverse) 5 | { 6 | if (!(al.IsPaired() && al.IsMapped() && al.IsMateMapped())) 7 | { 8 | return UNPAIRED; 9 | } 10 | else if (al.RefID != al.MateRefID) 11 | { 12 | return DIFF_CHROM; 13 | } 14 | else if (al.IsReverseStrand() == al.IsMateReverseStrand()) 15 | { 16 | return SAME; 17 | } 18 | else if ((al.Position <= al.MatePosition) == al.IsMateReverseStrand()) 19 | { 20 | return reverse ? OUTTIE : INNIE; 21 | } 22 | else if ((al.Position > al.MatePosition) == al.IsMateReverseStrand()) 23 | { 24 | return reverse ? INNIE : OUTTIE; 25 | } 26 | // logically impossible for this to happen... 27 | else 28 | { 29 | cerr << "Unexpected error in getPairOrientation(). Aborting." << endl; 30 | exit(1); 31 | } 32 | } 33 | 34 | 35 | void loadGaps(string fname, map > >& gaps) 36 | { 37 | Tabix ti(fname); 38 | string line; 39 | 40 | while (ti.getNextLine(line)) 41 | { 42 | vector data; 43 | split(line, '\t', data); 44 | gaps[data[0]].push_back( make_pair(atoi(data[1].c_str()) - 1, atoi(data[2].c_str()) - 1) ); 45 | } 46 | } 47 | 48 | 49 | void split(const string &s, char delim, vector &elems) 50 | { 51 | stringstream ss(s); 52 | string item; 53 | elems.clear(); 54 | 55 | while(getline(ss, item, delim)) 56 | { 57 | elems.push_back(item); 58 | } 59 | } 60 | 61 | 62 | void systemCall(string cmd) 63 | { 64 | if (system(NULL)) 65 | { 66 | int retcode = system(cmd.c_str()); 67 | 68 | if (retcode) 69 | { 70 | cerr << "Error in system call. Error code=" << retcode << ". Command was:" 71 | << endl << cmd << endl; 72 | exit(1); 73 | } 74 | } 75 | else 76 | { 77 | cerr << "Error in system call. Shell not available" << endl; 78 | exit(1); 79 | } 80 | } 81 | 82 | 83 | bool sortByLength(const pair< string, unsigned long>& p1, const pair< string, unsigned long>& p2) 84 | { 85 | return p1.second > p2.second; 86 | } 87 | 88 | 89 | void orderedSeqsFromFai(string faiFile, vector >& seqs) 90 | { 91 | ifstream ifs(faiFile.c_str()); 92 | if (!ifs.good()) 93 | { 94 | cerr << "Error opening file '" << faiFile << "'" << endl; 95 | exit(1); 96 | } 97 | 98 | string line; 99 | 100 | while (getline(ifs, line)) 101 | { 102 | vector tmp; 103 | split(line, '\t', tmp); 104 | seqs.push_back(make_pair(tmp[0], atoi(tmp[1].c_str()))); 105 | } 106 | 107 | ifs.close(); 108 | sort(seqs.begin(), seqs.end(), sortByLength); 109 | } 110 | 111 | -------------------------------------------------------------------------------- /docker/chiron-metacompass/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM umigs/chiron-core:1.0.0 2 | 3 | 4 | ################# 5 | ## MetaCompass ## 6 | ################# 7 | 8 | # Pre-reqs 9 | RUN apt-get install -y build-essential libbz2-dev liblzma-dev libncurses5-dev libtbb2 ncbi-blast+ python-software-properties software-properties-common zlib1g-dev python3-dev 10 | RUN pip3 install snakemake psutil 11 | RUN add-apt-repository ppa:webupd8team/java 12 | RUN apt-get update && echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && apt-get -y install oracle-java8-installer 13 | 14 | # We install bowtie2-legacy since normal bowtie2 doesn't want to play nicely. 15 | RUN wget -O /opt/bowtie2-2.3.2-legacy-linux-x86_64.zip https://sourceforge.net/projects/bowtie-bio/files/bowtie2/2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip/download 16 | RUN unzip -d /opt/ /opt/bowtie2-2.3.2-legacy-linux-x86_64.zip 17 | RUN rm /opt/bowtie2-2.3.2-legacy-linux-x86_64.zip 18 | ENV PATH /opt/bowtie2-2.3.2-legacy:$PATH 19 | ENV BT2_HOME=/opt/bowtie2-2.3.2-legacy 20 | 21 | RUN svn checkout https://svn.code.sf.net/p/kmer/code/trunk /opt/kmer 22 | RUN make -C /opt/kmer 23 | ENV PATH $PATH:/opt/kmer/meryl 24 | 25 | RUN wget -O /tmp/samtools-1.4.1.tar.bz2 https://github.com/samtools/samtools/releases/download/1.4.1/samtools-1.4.1.tar.bz2 26 | RUN tar -xjf /tmp/samtools-1.4.1.tar.bz2 -C /tmp/ 27 | RUN /tmp/samtools-1.4.1/configure --prefix=/opt/samtools-1.4.1 --enable-plugins --enable-libcurl 28 | RUN mv config.h config.mk config.status /tmp/samtools-1.4.1 29 | RUN make -C /tmp/samtools-1.4.1 all all-htslib 30 | RUN make -C /tmp/samtools-1.4.1 install 31 | ENV PATH $PATH:/opt/samtools-1.4.1/bin 32 | 33 | RUN git clone https://github.com/voutcn/megahit.git /opt/megahit 34 | RUN make -C /opt/megahit 35 | ENV PATH $PATH:/opt/megahit 36 | 37 | RUN git clone https://github.com/marbl/MetaCompass.git /opt/MetaCompass 38 | RUN g++ -Wall -W -O2 -o /opt/MetaCompass/bin/extractSeq /opt/MetaCompass/src/utils/extractSeq.cpp 39 | RUN g++ -Wall -W -O2 -o /opt/MetaCompass/bin/formatFASTA /opt/MetaCompass/src/utils/formatFASTA.cpp 40 | RUN g++ -Wall -W -O2 -o /opt/MetaCompass/bin/buildcontig /opt/MetaCompass/src/buildcontig/buildcontig.cpp /opt/MetaCompass/src/buildcontig/cmdoptions.cpp /opt/MetaCompass/src/buildcontig/memory.cpp /opt/MetaCompass/src/buildcontig/procmaps.cpp /opt/MetaCompass/src/buildcontig/outputfiles.cpp 41 | RUN wget --no-check-certificate https://gembox.cbcb.umd.edu/metacompass/markers.tar.gz -P /opt/MetaCompass/src/metaphyler 42 | RUN tar -xzvf /opt/MetaCompass/src/metaphyler/markers.tar.gz -C /opt/MetaCompass/src/metaphyler/ 43 | RUN rm /opt/MetaCompass/src/metaphyler/markers.tar.gz 44 | ENV PATH /opt/MetaCompass:/opt/MetaCompass/bin:$PATH 45 | 46 | # This needs to happen separately within a startup/init script 47 | RUN wget -O /opt/MetaCompass/refseq.tar.gz --no-check-certificate https://gembox.cbcb.umd.edu/metacompass/refseq.tar.gz 48 | RUN tar -xvzf /opt/MetaCompass/refseq.tar.gz -C /opt/MetaCompass/ 49 | RUN rm /opt/MetaCompass/refseq.tar.gz 50 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/task_facheck.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | use File::Spec; 6 | use File::Basename; 7 | use Getopt::Long; 8 | 9 | my ($scriptname, $scriptdir) = fileparse($0); 10 | my %options; 11 | my $usage = qq/ [out_prefix] 12 | 13 | Checks that the names in the fasta file are ok. Things like 14 | trailing whitespace or characters |':- could break the pipeline. 15 | 16 | If out_prefix is not given, it will die when a bad ID is found. 17 | No output means everything is OK. 18 | 19 | If out_prefix is given, writes a new fasta file out_prefix.fa with new 20 | names, and out_prefix.info which has the mapping from old name to new name. 21 | /; 22 | 23 | 24 | my $ERROR_PREFIX = '[REAPR facheck]'; 25 | 26 | my $ops_ok = GetOptions( 27 | \%options, 28 | 'wrapperhelp', 29 | ); 30 | 31 | if ($options{wrapperhelp}) { 32 | print STDERR "$usage\n"; 33 | exit(1); 34 | } 35 | 36 | if ($#ARGV < 0 or $#ARGV > 1 or !($ops_ok)) { 37 | print STDERR "usage:\n$scriptname $usage\n"; 38 | exit(1); 39 | } 40 | 41 | my $fasta_in = $ARGV[0]; 42 | my $out_prefix = $#ARGV == 1 ? $ARGV[1] : ""; 43 | -e $fasta_in or die "$ERROR_PREFIX Cannot find file '$fasta_in'\n"; 44 | my %new_id_counts; 45 | open FIN, $fasta_in or die "$ERROR_PREFIX Error opening '$fasta_in'\n"; 46 | 47 | if ($out_prefix) { 48 | my $fasta_out = "$out_prefix.fa"; 49 | my $info_out = "$out_prefix.info"; 50 | open FA_OUT, ">$fasta_out" or die "$ERROR_PREFIX Error opening '$fasta_out'\n"; 51 | open INFO_OUT, ">$info_out" or die "$ERROR_PREFIX Error opening '$info_out'\n"; 52 | print INFO_OUT "#old_name\tnew_name\n"; 53 | } 54 | 55 | while () { 56 | chomp; 57 | 58 | if (/^>/) { 59 | my ($name) = split /\t/; 60 | $name =~ s/^.//; 61 | my $new_name = check_name($name, \%new_id_counts, $out_prefix); 62 | if ($out_prefix) { 63 | print FA_OUT ">$new_name\n"; 64 | print INFO_OUT "$name\t$new_name\n"; 65 | } 66 | } 67 | elsif ($out_prefix) { 68 | print FA_OUT "$_\n"; 69 | } 70 | } 71 | 72 | close FIN; 73 | 74 | if ($out_prefix) { 75 | close FA_OUT; 76 | close INFO_OUT; 77 | } 78 | 79 | # checks if the given name is OK. 80 | # arg 0 = name to be checked 81 | # arg 1 = refrence to hash of new id counts 82 | # arg 2 = ouput files prefix 83 | # Returns new name 84 | sub check_name { 85 | my $old_id = shift; 86 | my $h = shift; 87 | my $pre = shift; 88 | my $new_id = $old_id; 89 | $new_id =~ s/[,;'|:\+\-\s\(\)\{\}\[\]]/_/g; 90 | 91 | if ($old_id ne $new_id and $pre eq "") { 92 | print "Sequence name '$old_id' not OK and will likely break pipeline\n"; 93 | exit(1); 94 | } 95 | $h->{$new_id}++; 96 | 97 | if ($h->{$new_id} == 1) { 98 | return $new_id; 99 | } 100 | else { 101 | return "$new_id." . $h->{$new_id}; 102 | } 103 | } 104 | 105 | -------------------------------------------------------------------------------- /pipelines/qiime2/phylogenetic_analysis.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Generate a phylogenetic tree 4 | class: Workflow 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-qiime2 9 | - class: StepInputExpressionRequirement 10 | - class: InlineJavascriptRequirement 11 | 12 | inputs: 13 | rep_seqs: 14 | type: File 15 | outputs: 16 | rooted_tree: 17 | type: File 18 | outputSource: phylogeny_midpoint_root/out_rooted 19 | 20 | steps: 21 | alignment_mafft: 22 | run: 23 | class: CommandLineTool 24 | baseCommand: ["qiime", "alignment", "mafft"] 25 | inputs: 26 | rep_seqs: 27 | inputBinding: 28 | prefix: --i-sequences 29 | type: File 30 | aligned_seqs: 31 | inputBinding: 32 | prefix: --o-alignment 33 | type: string 34 | default: 'aligned-rep-seqs.qza' 35 | outputs: 36 | out_align: 37 | type: File 38 | outputBinding: 39 | glob: $(inputs.aligned_seqs) 40 | in: 41 | rep_seqs: rep_seqs 42 | out: [out_align] 43 | alignment_mask: 44 | run: 45 | class: CommandLineTool 46 | baseCommand: ["qiime", "alignment", "mask"] 47 | inputs: 48 | aligned_seqs: 49 | inputBinding: 50 | prefix: --i-alignment 51 | type: File 52 | masked_seqs: 53 | inputBinding: 54 | prefix: --o-masked-alignment 55 | type: string 56 | default: 'masked-aligned-rep-seqs.qza' 57 | outputs: 58 | out_masked: 59 | type: File 60 | outputBinding: 61 | glob: $(inputs.masked_seqs) 62 | in: 63 | aligned_seqs: alignment_mafft/out_align 64 | out: [out_masked] 65 | phylogeny_fasttree: 66 | run: 67 | class: CommandLineTool 68 | baseCommand: ["qiime", "phylogeny", "fasttree"] 69 | inputs: 70 | masked_seqs: 71 | inputBinding: 72 | prefix: --i-alignment 73 | type: File 74 | tree: 75 | inputBinding: 76 | prefix: --o-tree 77 | type: string 78 | default: 'unrooted-tree.qza' 79 | outputs: 80 | out_tree: 81 | type: File 82 | outputBinding: 83 | glob: $(inputs.tree) 84 | in: 85 | masked_seqs: alignment_mask/out_masked 86 | out: [out_tree] 87 | phylogeny_midpoint_root: 88 | run: 89 | class: CommandLineTool 90 | baseCommand: ["qiime", "phylogeny", "midpoint-root"] 91 | inputs: 92 | input_tree: 93 | inputBinding: 94 | prefix: --i-tree 95 | type: File 96 | rooted_tree: 97 | inputBinding: 98 | prefix: --o-rooted-tree 99 | type: string 100 | default: 'rooted-tree.qza' 101 | outputs: 102 | out_rooted: 103 | type: File 104 | outputBinding: 105 | glob: $(inputs.rooted_tree) 106 | in: 107 | input_tree: phylogeny_fasttree/out_tree 108 | out: [out_rooted] 109 | -------------------------------------------------------------------------------- /pipelines/qiime2/taxonomic_analysis.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Perform taxonomic analysis 4 | class: Workflow 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-qiime2 9 | - class: StepInputExpressionRequirement 10 | - class: InlineJavascriptRequirement 11 | 12 | inputs: 13 | rep_seqs: 14 | type: File 15 | classifier: 16 | type: File 17 | metadata_file: 18 | type: File 19 | input_table: 20 | type: File 21 | 22 | outputs: 23 | taxa_visual: 24 | type: File 25 | outputSource: taxa_tabulate/out_visual 26 | barplots: 27 | type: File 28 | outputSource: taxa_barplot/barplots 29 | taxonomy: 30 | type: File 31 | outputSource: classify_sklearn/out_taxa 32 | 33 | steps: 34 | classify_sklearn: 35 | run: 36 | class: CommandLineTool 37 | baseCommand: ["qiime", "feature-classifier", "classify-sklearn"] 38 | inputs: 39 | rep_seqs: 40 | inputBinding: 41 | prefix: --i-reads 42 | type: File 43 | classifier: 44 | inputBinding: 45 | prefix: --i-classifier 46 | type: File 47 | taxonomy: 48 | inputBinding: 49 | prefix: --o-classification 50 | type: string 51 | default: 'taxonomy.qza' 52 | outputs: 53 | out_taxa: 54 | type: File 55 | outputBinding: 56 | glob: $(inputs.taxonomy) 57 | in: 58 | rep_seqs: rep_seqs 59 | classifier: classifier 60 | out: [out_taxa] 61 | taxa_tabulate: 62 | run: 63 | class: CommandLineTool 64 | baseCommand: ["qiime", "taxa", "tabulate"] 65 | inputs: 66 | taxa_data: 67 | inputBinding: 68 | prefix: --i-data 69 | type: File 70 | taxa_visualization: 71 | inputBinding: 72 | prefix: --o-visualization 73 | type: string 74 | default: 'taxonomy.qzv' 75 | outputs: 76 | out_visual: 77 | type: File 78 | outputBinding: 79 | glob: $(inputs.taxa_visualization) 80 | in: 81 | taxa_data: classify_sklearn/out_taxa 82 | out: [out_visual] 83 | taxa_barplot: 84 | run: 85 | class: CommandLineTool 86 | baseCommand: ["qiime", "taxa", "barplot"] 87 | inputs: 88 | table: 89 | inputBinding: 90 | prefix: --i-table 91 | type: File 92 | taxa_data: 93 | inputBinding: 94 | prefix: --i-taxonomy 95 | type: File 96 | metadata: 97 | inputBinding: 98 | prefix: --m-metadata-file 99 | type: File 100 | plots: 101 | inputBinding: 102 | prefix: --o-visualization 103 | type: string 104 | default: 'taxa-bar-plots.qzv' 105 | outputs: 106 | barplots: 107 | type: File 108 | outputBinding: 109 | glob: $(inputs.plots) 110 | in: 111 | table: input_table 112 | taxa_data: classify_sklearn/out_taxa 113 | metadata: metadata_file 114 | out: [barplots] 115 | -------------------------------------------------------------------------------- /tests/test_strainphlan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source 4 | # https://bitbucket.org/biobakery/biobakery/wiki/strainphlan#rst-header-installation 5 | 6 | mkdir strainphlan_analysis 7 | cd strainphlan_analysis/ 8 | 9 | wget https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/strainphlan/input/13530241_SF05.fasta.gz 10 | wget https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/strainphlan/input/13530241_SF06.fasta.gz 11 | wget https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/strainphlan/input/19272639_SF05.fasta.gz 12 | wget https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/strainphlan/input/19272639_SF06.fasta.gz 13 | wget https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/strainphlan/input/40476924_SF05.fasta.gz 14 | wget https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/strainphlan/input/40476924_SF06.fasta.gz 15 | 16 | metaphlan2.py 13530241_SF05.fasta.gz 13530241_SF05_profile.txt --bowtie2out 13530241_SF05_bowtie2.txt --samout 13530241_SF05.sam.bz2 --input_type multifasta 17 | metaphlan2.py 13530241_SF06.fasta.gz 13530241_SF06_profile.txt --bowtie2out 13530241_SF06_bowtie2.txt --samout 13530241_SF06.sam.bz2 --input_type multifasta 18 | metaphlan2.py 19272639_SF05.fasta.gz 19272639_SF05_profile.txt --bowtie2out 19272639_SF05_bowtie2.txt --samout 19272639_SF05.sam.bz2 --input_type multifasta 19 | metaphlan2.py 19272639_SF06.fasta.gz 19272639_SF06_profile.txt --bowtie2out 19272639_SF06_bowtie2.txt --samout 19272639_SF06.sam.bz2 --input_type multifasta 20 | metaphlan2.py 40476924_SF05.fasta.gz 40476924_SF05_profile.txt --bowtie2out 40476924_SF05_bowtie2.txt --samout 40476924_SF05.sam.bz2 --input_type multifasta 21 | metaphlan2.py 40476924_SF06.fasta.gz 40476924_SF06_profile.txt --bowtie2out 40476924_SF06_bowtie2.txt --samout 40476924_SF06.sam.bz2 --input_type multifasta 22 | 23 | sample2markers.py --ifn_samples 13530241_SF05.sam.bz2 --input_type sam --output_dir . 24 | sample2markers.py --ifn_samples 13530241_SF06.sam.bz2 --input_type sam --output_dir . 25 | sample2markers.py --ifn_samples 19272639_SF05.sam.bz2 --input_type sam --output_dir . 26 | sample2markers.py --ifn_samples 19272639_SF06.sam.bz2 --input_type sam --output_dir . 27 | sample2markers.py --ifn_samples 40476924_SF05.sam.bz2 --input_type sam --output_dir . 28 | sample2markers.py --ifn_samples 40476924_SF06.sam.bz2 --input_type sam --output_dir . 29 | 30 | strainphlan.py --ifn_samples *.markers --output_dir . --print_clades_only > clades.txt 31 | 32 | # This step fails because mpa_v20_m200.pkl doesn't exist yet 33 | extract_markers.py --mpa_pkl mpa_v20_m200.pkl --ifn_markers all_markers.fasta --clade s__Eubacterium_siraeum --ofn_markers s__Eubacterium_siraeum.markers.fasta 34 | 35 | # This is an alternative to command above 36 | wget https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/strainphlan/input/s__Eubacterium_siraeum.markers.fasta 37 | 38 | wget https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/strainphlan/input/GCF_000154325.fna.bz2 39 | 40 | strainphlan.py --ifn_samples *.markers --ifn_markers s__Eubacterium_siraeum.markers.fasta --ifn_ref_genomes GCF_000154325.fna.bz2 --output_dir . --clades s__Eubacterium_siraeum --marker_in_clade 0.2 41 | 42 | -------------------------------------------------------------------------------- /pipelines/qiime2/demux_empseq.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Demultiplex input EMP Single-End Sequences 4 | class: Workflow 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-qiime2 9 | 10 | inputs: 11 | staging_dir: 12 | label: Directory the barcode and sequence files are located in 13 | type: Directory 14 | metadata_file: 15 | type: File 16 | 17 | outputs: 18 | demux_seqs: 19 | type: File 20 | outputSource: demux_emp_single/outfile 21 | demux_visual: 22 | type: File 23 | outputSource: demux_summarize/outfile 24 | 25 | steps: 26 | tools_import: 27 | label: Import the EMPSingleEndSequences QIIME plugin 28 | run: 29 | class: CommandLineTool 30 | baseCommand: ["qiime", "tools", "import"] 31 | inputs: 32 | input_type: 33 | inputBinding: 34 | prefix: --type 35 | type: string 36 | default: "EMPSingleEndSequences" 37 | input_path: 38 | inputBinding: 39 | prefix: --input-path 40 | type: Directory 41 | default: . 42 | output_path: 43 | inputBinding: 44 | prefix: --output-path 45 | type: string 46 | default: "emp-single-end-sequences.qza" 47 | outputs: 48 | outpath: 49 | type: File 50 | outputBinding: 51 | glob: $(inputs.output_path) 52 | in: 53 | input_path: staging_dir 54 | out: [outpath] 55 | 56 | demux_emp_single: 57 | label: Demultiplex the sequence 58 | run: 59 | class: CommandLineTool 60 | baseCommand: ["qiime", "demux", "emp-single"] 61 | inputs: 62 | input_seqs: 63 | inputBinding: 64 | prefix: --i-seqs 65 | type: File 66 | barcodes_file: 67 | inputBinding: 68 | prefix: --m-barcodes-file 69 | type: File 70 | barcodes_category: 71 | inputBinding: 72 | prefix: --m-barcodes-category 73 | type: string 74 | default: "BarcodeSequence" 75 | output_file: 76 | inputBinding: 77 | prefix: --o-per-sample-sequences 78 | type: string 79 | default: "demux.qza" 80 | outputs: 81 | outfile: 82 | type: File 83 | outputBinding: 84 | glob: $(inputs.output_file) 85 | in: 86 | input_seqs: tools_import/outpath 87 | barcodes_file: metadata_file 88 | out: [outfile] 89 | 90 | demux_summarize: 91 | label: Generate summary of demultiplexing results 92 | run: 93 | class: CommandLineTool 94 | baseCommand: ["qiime", "demux", "summarize"] 95 | inputs: 96 | input_data: 97 | inputBinding: 98 | prefix: --i-data 99 | type: File 100 | output_file: 101 | inputBinding: 102 | prefix: --o-visualization 103 | type: string 104 | default: "demux.qzv" 105 | outputs: 106 | outfile: 107 | type: File 108 | outputBinding: 109 | glob: $(inputs.output_file) 110 | arguments: ["--verbose"] 111 | in: 112 | input_data: demux_emp_single/outfile 113 | out: [outfile] 114 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/fasta.cpp: -------------------------------------------------------------------------------- 1 | #include "fasta.h" 2 | 3 | Fasta::Fasta() : id(""), seq("") {} 4 | Fasta::Fasta(string& name, string& s) : id(name), seq(s) {} 5 | 6 | 7 | void Fasta::print(ostream& outStream, unsigned int lineWidth) const 8 | { 9 | if (lineWidth == 0) 10 | { 11 | outStream << ">" << id << endl << seq << endl; 12 | } 13 | else 14 | { 15 | outStream << ">" << id << endl; 16 | 17 | for (unsigned int i = 0; i < length(); i += lineWidth) 18 | { 19 | outStream << seq.substr(i, lineWidth) << endl; 20 | } 21 | } 22 | } 23 | 24 | 25 | Fasta Fasta::subseq(unsigned long start, unsigned long end) 26 | { 27 | Fasta fa; 28 | fa.id = id; 29 | fa.seq = seq.substr(start, end - start + 1); 30 | return fa; 31 | } 32 | 33 | 34 | unsigned long Fasta::length() const 35 | { 36 | return seq.length(); 37 | } 38 | 39 | 40 | void Fasta::findGaps(list >& lIn) 41 | { 42 | unsigned long pos = seq.find_first_of("nN"); 43 | lIn.clear(); 44 | 45 | while (pos != string::npos) 46 | { 47 | unsigned long start = pos; 48 | pos = seq.find_first_not_of("nN", pos); 49 | if (pos == string::npos) 50 | { 51 | lIn.push_back(make_pair(start, seq.length() - 1)); 52 | } 53 | else 54 | { 55 | lIn.push_back(make_pair(start, pos - 1)); 56 | pos = seq.find_first_of("nN", pos); 57 | } 58 | } 59 | } 60 | 61 | unsigned long Fasta::getNumberOfGaps() 62 | { 63 | list > gaps; 64 | findGaps(gaps); 65 | return gaps.size(); 66 | } 67 | 68 | bool Fasta::fillFromFile(istream& inStream) 69 | { 70 | string line; 71 | seq = ""; 72 | id = ""; 73 | getline(inStream, line); 74 | 75 | // check if we're at the end of the file 76 | if (inStream.eof()) 77 | { 78 | return false; 79 | } 80 | // Expecting a header line. If not, abort 81 | else if (line[0] == '>') 82 | { 83 | id = line.substr(1); 84 | } 85 | else 86 | { 87 | cerr << "Error reading fasta file!" << endl 88 | << "Expected line starting with '>', but got this:" << endl 89 | << line << endl; 90 | exit(1); 91 | } 92 | 93 | // Next lines should be sequence, up to next header, or end of file 94 | while ((inStream.peek() != '>') && (!inStream.eof())) 95 | { 96 | getline(inStream, line); 97 | seq += line; 98 | } 99 | 100 | return true; 101 | } 102 | 103 | 104 | unsigned long Fasta::nCount() 105 | { 106 | return count(seq.begin(), seq.end(), 'n') + count(seq.begin(), seq.end(), 'N'); 107 | } 108 | 109 | 110 | void Fasta::trimNs(unsigned long& startBases, unsigned long& endBases) 111 | { 112 | list > gaps; 113 | findGaps(gaps); 114 | startBases = endBases = 0; 115 | if (gaps.size()) 116 | { 117 | if (gaps.back().second == length() - 1) 118 | { 119 | endBases = gaps.back().second - gaps.back().first + 1; 120 | seq.resize(gaps.back().first); 121 | } 122 | 123 | if (gaps.front().first == 0) 124 | { 125 | startBases = gaps.front().second + 1; 126 | seq.erase(0, startBases); 127 | } 128 | } 129 | } 130 | 131 | 132 | -------------------------------------------------------------------------------- /pipelines/humann2/humann2_complete.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: Humann2 - Complete pipeline 4 | class: Workflow 5 | 6 | requirements: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-humann2 9 | - class: ScatterFeatureRequirement 10 | - class: StepInputExpressionRequirement 11 | - class: InlineJavascriptRequirement 12 | 13 | inputs: 14 | input_file: 15 | label: Sample inputs 16 | type: File[] 17 | # Humann2 options 18 | humann2_output_dir: 19 | label: Output Directory used for storing humann2 output 20 | type: string 21 | default: '.' 22 | gap_fill: 23 | type: string 24 | default: "off" 25 | bypass_translated_search: 26 | label: Runs all of the alignment steps except the translated search 27 | type: boolean 28 | default: false 29 | bypass_nucleotide_search: 30 | label: Bypasses all of the alignment steps before the translated search 31 | type: boolean 32 | default: false 33 | num_cores: 34 | type: int 35 | default: 1 36 | # Rename Table option 37 | feat_db: 38 | type: string 39 | default: 'uniref90' 40 | # Renorm Table options 41 | normalize_units: 42 | label: Compositional units to normalize to (copies per million - 'cpm' or relative abundance) 43 | type: string 44 | default: 'cpm' 45 | update_snames: 46 | label: update sample names header 47 | type: boolean 48 | default: true 49 | # Regroup Table option 50 | regrouping_category: 51 | label: Categories in which to regroup our Humann2 table 52 | type: string 53 | default: 'uniref90_level4ec' 54 | 55 | outputs: 56 | genefamilies_tsv: 57 | type: File[] 58 | outputSource: humann2/out_gene_families 59 | # feature_tsv: 60 | # type: File[] 61 | # outputSource: rename_table/out_tsv 62 | # normalize_tsv: 63 | # type: File[] 64 | # outputSource: renorm_table/out_tsv 65 | # regrouped_tsv: 66 | # type: File[] 67 | # outputSource: regroup_table/out_tsv 68 | 69 | steps: 70 | 71 | humann2: 72 | run: humann2.cwl 73 | in: 74 | input_file: input_file 75 | output_dir: humann2_output_dir 76 | gap_fill: gap_fill 77 | bypass_translated_search: bypass_translated_search 78 | num_threads: num_cores 79 | out: [out_dir, out_gene_families] 80 | scatter: [input_file] 81 | 82 | # rename_table: 83 | # run: humann2_rename_table.cwl 84 | # in: 85 | # input_tsv: humann2/out_gene_families 86 | # output_tsv: 87 | # source: humann2/out_gene_families 88 | # valueFrom: $(self.nameroot + '-names.tsv') 89 | # names: feat_db 90 | # out: [out_tsv] 91 | # scatter: [input_tsv] 92 | 93 | # renorm_table: 94 | # run: humann2_renorm_table.cwl 95 | # in: 96 | # input_tsv: humann2/out_gene_families 97 | # output_tsv: 98 | # source: humann2/out_gene_families 99 | # valueFrom: $(self.nameroot + '-' + inputs.units + '.tsv') 100 | # units: normalize_units 101 | # update_snames: update_snames 102 | # out: [out_tsv] 103 | # scatter: [input_tsv] 104 | 105 | # regroup_table: 106 | # run: humann2_regroup_table.cwl 107 | # in: 108 | # input_tsv: renorm_table/out_tsv 109 | # output_tsv: 110 | # source: renorm_table/out_tsv 111 | # valueFrom: $(self.nameroot + '-' + inputs.groups +'.tsv') 112 | # groups: regrouping_category 113 | # out: [out_tsv] 114 | # scatter: [input_tsv] 115 | -------------------------------------------------------------------------------- /pipelines/qiime2/diff_abundance_w_collapse.cwl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cwl-runner 2 | cwlVersion: v1.0 3 | label: QIIME2 - Perform differential abundance analysis on a collapsed taxonomic level 4 | class: Workflow 5 | 6 | hints: 7 | - class: DockerRequirement 8 | dockerPull: umigs/chiron-qiime2 9 | - class: StepInputExpressionRequirement 10 | - class: InlineJavascriptRequirement 11 | 12 | inputs: 13 | metadata_file: 14 | type: File 15 | metadata_category: 16 | type: string 17 | input_table: 18 | type: File 19 | collapse_level: 20 | type: int 21 | taxonomy_file: 22 | type: File 23 | outputs: 24 | feat_visual: 25 | type: File 26 | outputSource: ancom/out_visual 27 | 28 | steps: 29 | collapse: 30 | run: 31 | class: CommandLineTool 32 | baseCommand: ["qiime", "taxa", "collapse"] 33 | inputs: 34 | table: 35 | inputBinding: 36 | prefix: --i-table 37 | type: File 38 | taxonomy_file: 39 | inputBinding: 40 | prefix: --i-taxonomy 41 | type: File 42 | collapse_level: 43 | inputBinding: 44 | prefix: --p-level 45 | type: int 46 | default: 2 47 | collapsed_table: 48 | inputBinding: 49 | prefix: --o-collapsed-table 50 | type: string 51 | default: 'coll-table.qza' 52 | outputs: 53 | out_collapsed_table: 54 | type: File 55 | outputBinding: 56 | glob: $(inputs.collapsed_table) 57 | in: 58 | table: input_table 59 | taxonomy_file: taxonomy_file 60 | collapse_level: collapse_level 61 | out: [out_collapsed_table] 62 | 63 | add_pseudocount: 64 | run: 65 | class: CommandLineTool 66 | baseCommand: ["qiime", "composition", "add-pseudocount"] 67 | inputs: 68 | table: 69 | inputBinding: 70 | prefix: --i-table 71 | type: File 72 | seqs_prefix: 73 | type: string? 74 | composition: 75 | inputBinding: 76 | prefix: --o-composition-table 77 | type: string 78 | default: 'comp-table.qza' 79 | outputs: 80 | out_comp_table: 81 | type: File 82 | outputBinding: 83 | glob: $(inputs.composition) 84 | in: 85 | table: collapse/out_collapsed_table 86 | out: [out_comp_table] 87 | 88 | ancom: 89 | run: 90 | class: CommandLineTool 91 | baseCommand: ["qiime", "composition", "ancom"] 92 | inputs: 93 | comp_table: 94 | inputBinding: 95 | prefix: --i-table 96 | type: File 97 | metadata_file: 98 | inputBinding: 99 | prefix: --m-metadata-file 100 | type: File 101 | metadata_category: 102 | inputBinding: 103 | prefix: --m-metadata-category 104 | type: string 105 | feat_visualization: 106 | inputBinding: 107 | prefix: --o-visualization 108 | type: string 109 | default: 'ancom.qzv' 110 | outputs: 111 | out_visual: 112 | type: File 113 | outputBinding: 114 | glob: $(inputs.feat_visualization) 115 | in: 116 | comp_table: add_pseudocount/out_comp_table 117 | metadata_file: metadata_file 118 | metadata_category: metadata_category 119 | out: [out_visual] 120 | -------------------------------------------------------------------------------- /docker/chiron-humann2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM umigs/chiron-core:1.0.0 2 | 3 | ############# 4 | ## HUMAnN2 ## 5 | ############# 6 | 7 | RUN pip install humann2 8 | 9 | RUN mkdir -p /tutorials/humann2/input 10 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/humann2/input/demo.fastq 11 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/humann2/input/demo.sam 12 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/humann2/input/demo.m8 13 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/humann2/input/hmp_pathabund.pcl 14 | 15 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014459-Stool.fasta.gz 16 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014464-Anterior_nares.fasta.gz 17 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014470-Tongue_dorsum.fasta.gz 18 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014472-Buccal_mucosa.fasta.gz 19 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014476-Supragingival_plaque.fasta.gz 20 | RUN wget -P /tutorials/humann2/input https://bitbucket.org/biobakery/biobakery/raw/tip/demos/biobakery_demos/data/metaphlan2/input/SRS014494-Posterior_fornix.fasta.gz 21 | 22 | # Do any databases need to be installed? 23 | RUN mkdir /dbs/humann2 24 | 25 | RUN humann2_databases --download utility_mapping full /dbs/humann2/ 26 | RUN humann2_databases --download chocophlan DEMO /dbs/humann2/ 27 | RUN humann2_databases --download uniref DEMO_diamond /dbs/humann2/ 28 | 29 | # ChocoPhlAn is 5.6 GB 30 | # RUN humann2_databases --download chocophlan full /dbs/humann2/ 31 | 32 | # You'll only want one of these: 33 | # Full UniRef90 (11.0 GB) 34 | # RUN humann2_databases --download uniref uniref90_diamond /dbs/humann2/ 35 | # EC-filtered UniRef90 (0.8 GB) 36 | # RUN humann2_databases --download uniref uniref90_ec_filtered_diamond /dbs/humann2/ 37 | # Full UniRef50 (4.6 GB) 38 | # RUN humann2_databases --download uniref uniref50_diamond /dbs/humann2/ 39 | # EC-filtered UniRef50 (0.2 GB) 40 | # RUN humann2_databases --download uniref uniref50_ec_filtered_diamond /dbs/humann2/ 41 | 42 | # MetaPhlAn2 is required 43 | RUN wget -O /opt/hclust2.zip https://bitbucket.org/nsegata/hclust2/get/tip.zip 44 | RUN unzip -d /opt/hclust2 /opt/hclust2.zip 45 | RUN mv /opt/hclust2/nsegata-hclust2-*/* /opt/hclust2/ 46 | RUN rm -rf /opt/hclust2/nsegata-hclust2-* 47 | 48 | ENV PATH $PATH:/opt/hclust2 49 | 50 | # These have to be done sequentially, as there's a current problem with the dependency order resolution 51 | RUN pip install numpy 52 | RUN pip install matplotlib scipy==0.18.0 biom-format h5py 53 | RUN wget -O /opt/metaphlan2.zip https://bitbucket.org/biobakery/metaphlan2/get/default.zip 54 | RUN unzip -d /opt/metaphlan2 /opt/metaphlan2.zip 55 | RUN mv /opt/metaphlan2/biobakery-metaphlan2* /opt/metaphlan2/biobakery-metaphlan2 56 | 57 | ENV PATH $PATH:/opt/metaphlan2/biobakery-metaphlan2:/opt/metaphlan2/biobakery-metaphlan2/utils 58 | ENV MPA_DIR /opt/metaphlan2/biobakery-metaphlan2 59 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/trianglePlot.h: -------------------------------------------------------------------------------- 1 | #ifndef TRIANGLEPLOT_H 2 | #define TRIANGLEPLOT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "utils.h" 15 | 16 | using namespace std; 17 | 18 | class TrianglePlot 19 | { 20 | public: 21 | // construct a triangle plot, centred at the given position 22 | TrianglePlot(unsigned long centreCoord = 0); 23 | 24 | // move the centre of the plot to the right n bases 25 | void shift(unsigned long n); 26 | 27 | // move the centre to the given position 28 | void move(unsigned long n); 29 | 30 | // Updates the plot, by adding the given fragment at , if that 31 | // fragment covers the centre of the plot. 32 | // Returns true iff the fragment could be added. 33 | bool add(pair& fragment); 34 | 35 | // adds all possible fragments from the set to the plot. 36 | // Each fragment that is added gets deleted from the list 37 | void add(multiset >& frags); 38 | 39 | // Returns the mean of the plot. Returns zero if the plot has no fragments - you 40 | // can check this with a call to depth(). 41 | double mean(); 42 | 43 | // returns the centre position of the plot 44 | unsigned long centreCoord(); 45 | 46 | // returns the depth of the plot, i.e. number of fragments covering its position 47 | unsigned long depth(); 48 | 49 | // returns the mean fragment length 50 | double meanFragLength(); 51 | 52 | // empties the plot and sets the centre coord to n 53 | void clear(unsigned long n = 0); 54 | 55 | // Returns the y values of the plot in the form: 56 | // y1 y2 ... 57 | // y values are space separated. So if maxInsert was 5, would have 11 values 58 | // for plot (for x an int in [-5,5]), e.g: 59 | // 0 1 2 2 2 3 3 2 0 0 0 60 | string toString(unsigned long maxInsert); 61 | 62 | void getHeights(unsigned long maxInsert, vector& leftHeights, vector& rightHeights); 63 | 64 | double areaError(unsigned long maxInsert, unsigned long meanInsert, bool gapCorrect = false, unsigned long gapStart = 0, unsigned long gapEnd = 0); 65 | 66 | void optimiseGap(unsigned long maxInsert, unsigned long meanInsert, unsigned long gapStart, unsigned long gapEnd, unsigned long& bestGapLength, double& bestError); 67 | 68 | 69 | private: 70 | unsigned long totalDepth_; 71 | long depthSum_; 72 | unsigned long centreCoord_; 73 | unsigned long totalFragLength_; 74 | 75 | struct fragcomp 76 | { 77 | bool operator() (const pair& i, const pair& j) const 78 | { 79 | return i.second < j.second; 80 | } 81 | }; 82 | 83 | // stores fragments sorted by end position, coords zero-based relative to the genome, not this plot 84 | multiset< pair, fragcomp> fragments_; 85 | 86 | // returns the theoretical height of a triangle plot at 'position', a gap from 'gapStart' to 'gapEnd' 87 | double getTheoryHeight(unsigned long gapStart, unsigned long gapEnd, unsigned long position, unsigned long meanInsert); 88 | 89 | // compare a pair by their second elements 90 | bool comparePairBySecond(pair& first, pair& second); 91 | }; 92 | 93 | #endif // TRIANGLEPLOT 94 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/histogram.h: -------------------------------------------------------------------------------- 1 | #ifndef HISTOGRAM_H 2 | #define HISTOGRAM_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "utils.h" 14 | 15 | using namespace std; 16 | 17 | class Histogram 18 | { 19 | public: 20 | // Construct a histogram with the given bin width 21 | Histogram(unsigned int bin = 50); 22 | 23 | // picks a value at random from the histogram 24 | unsigned long sample(); 25 | 26 | // adds count to the bin which value falls into 27 | void add(unsigned long val, unsigned long count); 28 | 29 | // clears the histogram 30 | void clear(); 31 | 32 | // returns true iff the histogram is empty 33 | bool empty(); 34 | 35 | // returns the bin width of the histogram 36 | unsigned int binWidth(); 37 | 38 | // get value of the bin which position falls into 39 | unsigned long get(long pos); 40 | 41 | // returns a count of the numbers in the histogram 42 | // (i.e. sum of size of each bin) 43 | unsigned long size(); 44 | 45 | // returns the mode of the histogram (returns zero if the histogram 46 | // is empty, so check if it's empty first!) 47 | // 'val' will be set to the value at the mode 48 | double mode(unsigned long& val); 49 | 50 | // returns the mode value within one standard deviation of the mean 51 | double modeNearMean(); 52 | 53 | // gets the mean and standard deviation (does nothing if the histogram is empty) 54 | void meanAndStddev(double& mean, double& stddev); 55 | 56 | // gets the first and last percentiles 57 | void endPercentiles(double& first, double& last); 58 | 59 | 60 | // p in [0,1] 61 | double leftPercentile(double p); 62 | 63 | double minimumBin(); 64 | 65 | // trim determines the x range when plotting, which will be [mode - trim * stddev, mode + trim * stddev] 66 | void setPlotOptionTrim(double trim); 67 | 68 | // when plotting, divide every x value by this number (default is to do no dividing). 69 | // This is handy when using a Histogram store non-integers (rounded a bit, obviously) 70 | void setPlotOptionXdivide(double divisor); 71 | 72 | // When plotting, default is to use middle of each bin as the x coords. 73 | // Set this to use the left of the bin instead 74 | void setPlotOptionUseLeftOfBins(bool useLeft); 75 | 76 | // When plotting, add in a vertical dashed red line at the given value 77 | void setPlotOptionAddVline(double d); 78 | 79 | // make a plot of the histogram. file extension 'ext' must be pdf or png 80 | // xlabel, ylabel = labels for x and y axes respectively. plotExtra is added 81 | // to tha call to plot in R 82 | void plot(string outprefix, string ext, string xlabel, string ylabel); 83 | 84 | // write data to file, tab-delimited per line: bin count. 85 | // offset is amount to add to x (bin) values. -1 means 86 | // add 1/2 bin width. 87 | void writeToFile(string fname, double offset, double xMultiplier); 88 | 89 | map::const_iterator begin(); 90 | map::const_iterator end(); 91 | 92 | private: 93 | unsigned int binWidth_; 94 | map bins_; 95 | vector reverseCDF_; 96 | bool plotLabelXcoordsLeftBin_; 97 | double plotXdivide_; 98 | double plotTrim_; 99 | vector plotVlines_; 100 | }; 101 | 102 | #endif // HISTOGRAM_H 103 | -------------------------------------------------------------------------------- /docker/chiron-metaviz/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM umigs/chiron-core:1.1.0 2 | 3 | ############# 4 | ## METAVIZ ## 5 | ############# 6 | RUN apt-get install -y --no-install-recommends php 7 | 8 | # neo4j instance 9 | ## METAVIZ Instance 10 | COPY metaviz_start.sh /bin/metaviz_start.sh 11 | RUN chmod +x /bin/metaviz_start.sh 12 | COPY setup.R setup.R 13 | 14 | RUN apt-get install -y software-properties-common python-software-properties 15 | RUN add-apt-repository ppa:webupd8team/java 16 | RUN apt-get update && echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && apt-get -y install oracle-java8-installer 17 | 18 | RUN apt-get install -y apt-transport-https 19 | RUN echo "deb http://cran.revolutionanalytics.com/bin/linux/ubuntu yakkety/" >> /etc/apt/sources.list 20 | RUN apt-get update 21 | RUN apt-get install -y r-base r-base-dev --allow-unauthenticated 22 | RUN apt-get install -y libcurl4-openssl-dev libxml2-dev libssl-dev git 23 | RUN Rscript setup.R 24 | 25 | RUN apt-get install -y -q gdebi-core libapparmor1 supervisor wget vim 26 | RUN wget https://download2.rstudio.org/rstudio-server-1.0.143-amd64.deb 27 | #This is from https://github.com/mgymrek/docker-rstudio-server/blob/master/Dockerfile 28 | RUN gdebi -n rstudio-server-1.0.143-amd64.deb 29 | RUN adduser metaviz --disabled-login 30 | RUN echo "metaviz:metaviz" | chpasswd 31 | RUN usermod -a -G root metaviz 32 | RUN chmod -R 777 /usr/local/lib/R/ 33 | RUN mkdir -p /var/log/supervisor 34 | ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf 35 | RUN git config --global user.name "metaviz" 36 | RUN git config --global user.email "metaviz@metaviz.org" 37 | RUN wget -O ~/workshopData "https://github.com/jmwagner/Chiron/blob/master/docker/chiron-metaviz/workshopData?raw=true" 38 | RUN chown metaviz ~/workshopData && chgrp metaviz ~/workshopData 39 | 40 | # neo4j instance 41 | RUN wget -O neo4j.tar.gz "https://neo4j.com/artifact.php?name=neo4j-community-3.2.0-unix.tar.gz" 42 | RUN mkdir /graph-db && tar -xvzf neo4j.tar.gz -C /graph-db 43 | RUN /graph-db/neo4j-community-3.2.0/bin/neo4j-admin set-initial-password "osdf1" 44 | RUN echo "dbms.connectors.default_listen_address=0.0.0.0" >> /graph-db/neo4j-community-3.2.0/conf/neo4j.conf 45 | RUN echo "dbms.allow_format_migration=true" >> /graph-db/neo4j-community-3.2.0/conf/neo4j.conf 46 | RUN wget -O graph.db.tar.gz "http://metaviz-dev.cbcb.umd.edu/hmp_workshop/graph.db.tar.gz" 47 | RUN tar -xvzf graph.db.tar.gz -C /graph-db/neo4j-community-3.2.0/data/databases/ 48 | RUN ./graph-db/neo4j-community-3.2.0/bin/neo4j start 49 | 50 | # metaviz data provider 51 | RUN wget -O metaviz-dp.zip "https://github.com/epiviz/metaviz-data-provider/archive/hmp_workshop.zip" 52 | RUN pip install --upgrade pip 53 | RUN unzip -d /graph-api metaviz-dp.zip && pip install -r /graph-api/metaviz-data-provider-hmp_workshop/requirements.txt 54 | RUN touch /graph-api/metaviz-data-provider-hmp_workshop/credential.py && echo "neo4j_username=\"neo4j\"" >> /graph-api/metaviz-data-provider-hmp_workshop/credential.py && echo "neo4j_password=\"osdf1\"" >> /graph-api/metaviz-data-provider-hmp_workshop/credential.py 55 | 56 | # metaviz ui 57 | RUN wget -O metaviz-ui.zip "https://github.com/epiviz/epiviz/archive/metaviz-4.1.zip" 58 | RUN unzip -d /graph-ui metaviz-ui.zip 59 | RUN echo 'epiviz.Config.SETTINGS.dataServerLocation="http://metaviz.cbcb.umd.edu/data/",epiviz.Config.SETTINGS.dataProviders=[["epiviz.data.EpivizApiDataProvider","ihmp_data","http://localhost:5000/api",[],3,{4:epiviz.ui.charts.tree.NodeSelectionType.NODE}]];' > /graph-ui/epiviz-metaviz-4.1/site-settings.js 60 | RUN rm metaviz-ui.zip 61 | 62 | EXPOSE 8888 5000 8787 7123 63 | 64 | #This is from https://github.com/mgymrek/docker-rstudio-server/blob/master/Dockerfile 65 | CMD ["/usr/bin/supervisord"] 66 | 67 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/task_plots.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | use Getopt::Long; 6 | use File::Basename; 7 | use File::Spec; 8 | 9 | my ($scriptname, $scriptdir) = fileparse($0); 10 | my %options; 11 | 12 | my $usage = qq/[options] 13 | 14 | Options: 15 | 16 | -s 17 | \tThis should be the outfiles prefix used when score was run 18 | /; 19 | 20 | my $ops_ok = GetOptions( 21 | \%options, 22 | 'score_prefix:s', 23 | 'wrapperhelp', 24 | ); 25 | 26 | if ($options{wrapperhelp}) { 27 | die $usage; 28 | } 29 | 30 | if ($#ARGV != 3 or !($ops_ok)) { 31 | die "usage:\n$scriptname $usage"; 32 | } 33 | 34 | my $stats = File::Spec->rel2abs($ARGV[0]); 35 | my $outprefix = File::Spec->rel2abs($ARGV[1]); 36 | my $ref_fa = File::Spec->rel2abs($ARGV[2]); 37 | my $ref_id = $ARGV[3]; 38 | my $ERROR_PREFIX = '[REAPR plots]'; 39 | 40 | # check input files exist 41 | unless (-e $stats) { 42 | print STDERR "$ERROR_PREFIX Can't find stats file '$stats'\n"; 43 | exit(1); 44 | } 45 | 46 | 47 | unless (-e $ref_fa) { 48 | print STDERR "$ERROR_PREFIX Can't find assmbly fasta file '$ref_fa'\n"; 49 | exit(1); 50 | } 51 | 52 | 53 | my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix'); 54 | my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip'); 55 | my $samtools = File::Spec->catfile($scriptdir, 'samtools'); 56 | my @plot_list = ('frag_cov', 'frag_cov_cor', 'read_cov', 'read_ratio_f', 'read_ratio_r', 'clip', 'FCD_err'); 57 | my @file_list; 58 | my $fa_out = "$outprefix.ref.fa"; 59 | my $gff_out; 60 | 61 | foreach (@plot_list) { 62 | push @file_list, "$outprefix.$_.plot"; 63 | } 64 | 65 | # make the standard plot files 66 | my $plot_prog = File::Spec->catfile($scriptdir, "make_plots"); 67 | system_call("$tabix $stats '$ref_id' | $plot_prog $outprefix"); 68 | 69 | # if requested, make a sores plot file and gff errors file 70 | if ($options{score_prefix}) { 71 | # scores 72 | my $scores_in = $options{score_prefix} . ".per_base.gz"; 73 | my $score_plot = "$outprefix.score.plot"; 74 | system_call("$tabix $scores_in '$ref_id' > $score_plot"); 75 | push @file_list, $score_plot; 76 | 77 | # gff 78 | my $gff_in = $options{score_prefix} . ".errors.gff.gz"; 79 | $gff_out = "$outprefix.errors.gff.gz"; 80 | system_call("$tabix $gff_in '$ref_id' | $bgzip -c > $gff_out"); 81 | } 82 | 83 | # check if a perfect_cov plot file was made 84 | my $perfect_plot = "$outprefix.perfect_cov.plot"; 85 | if (-e $perfect_plot) {push @file_list, $perfect_plot}; 86 | 87 | # get the reference sequence from the fasta file 88 | system_call("$samtools faidx $ref_fa '$ref_id' > $fa_out"); 89 | 90 | # bgzip the plots 91 | foreach (@file_list) { 92 | system_call("$bgzip $_"); 93 | if (/\.gff$/) { 94 | system_call("$tabix -p gff $_.gz"); 95 | } 96 | else { 97 | system_call("$tabix -b 2 -e 2 $_.gz"); 98 | } 99 | $_ .= ".gz"; 100 | 101 | } 102 | 103 | 104 | 105 | # write shell script to start artemis 106 | my $bash_script = "$outprefix.run_art.sh"; 107 | open FILE, ">$bash_script" or die $!; 108 | print FILE "#!/usr/bin/env bash 109 | set -e 110 | art -Duserplot='"; 111 | print FILE join (",", sort @file_list); 112 | if ($options{score_prefix}) { 113 | print FILE "' $fa_out + $gff_out\n"; 114 | } 115 | else { 116 | print FILE "' $fa_out\n"; 117 | } 118 | close FILE; 119 | chmod 0755, $bash_script; 120 | 121 | 122 | # usage: system_call(string) 123 | # Runs the string as a system call, dies if call returns nonzero error code 124 | sub system_call { 125 | my $cmd = shift; 126 | if (system($cmd)) { 127 | print STDERR "Error in system call:\n$cmd\n"; 128 | exit(1); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /examples/hmp_data_exercise/stool_nares_16s_rand_5_samples_manifest.tsv: -------------------------------------------------------------------------------- 1 | id md5 size urls 2 | 8f44efd89174f146688784a27d35b24b 2832e060e4aa4517b09724189acf7442 299495 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS013638.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS013638.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS013638.fsa.gz 3 | 91319e642fdd8a6e3b059cfb0512cef0 7104283976a26032b6d08d95086d6b52 3134426 http://downloads.hmpdacc.org/data/HM16STR/SRP002860/SRS013674.fsa,ftp://public-ftp.hmpdacc.org/HM16STR/SRP002860/SRS013674.fsa,s3://human-microbiome-project/HHS/HM16STR/SRP002860/SRS013674.fsa 4 | 8f44efd89174f146688784a27d7bc94a 099ee303cc7b6664e9db34a47e6641b0 295144 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS013674.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS013674.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS013674.fsa.gz 5 | 91319e642fdd8a6e3b059cfb05360daa 1a43251095138e0b0096416e959bf73e 750597 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS066144.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS066144.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS066144.fsa.gz 6 | 91319e642fdd8a6e3b059cfb05360daa 1a43251095138e0b0096416e959bf73e 750597 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS066144.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS066144.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS066144.fsa.gz 7 | 91319e642fdd8a6e3b059cfb05360daa 1a43251095138e0b0096416e959bf73e 750597 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS066144.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS066144.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS066144.fsa.gz 8 | 8f44efd89174f146688784a27d753ebf 35b12be83af347bce999c34cd0f1bcf0 10446444 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS066188.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS066188.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS066188.fsa.gz 9 | 91319e642fdd8a6e3b059cfb0527fc34 a855024c7003ed0b1a0234284baae652 313120 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS024718.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS024718.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS024718.fsa.gz 10 | 91319e642fdd8a6e3b059cfb05360daa 1a43251095138e0b0096416e959bf73e 750597 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS066144.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS066144.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS066144.fsa.gz 11 | 8f44efd89174f146688784a27d753ebf 35b12be83af347bce999c34cd0f1bcf0 10446444 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS066188.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS066188.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS066188.fsa.gz 12 | 8f44efd89174f146688784a27ddc9d18 2cc178116e17d88da3a7ff4a6e802045 537713 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS063560.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS063560.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS063560.fsa.gz 13 | 91319e642fdd8a6e3b059cfb05299157 0288e51b5e686d716ccc957ac8862f48 1071227 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS065466.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS065466.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS065466.fsa.gz 14 | 8f44efd89174f146688784a27da66bee ca16edac38723f7a5f3140206e4f1d33 2371408 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS014442.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS014442.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS014442.fsa.gz 15 | 8f44efd89174f146688784a27da125c1 a25131363b08b3129da2b7b7000c0447 293203 http://downloads.hmpdacc.org/data/HM16STR/by_sample/SRS014458.fsa.gz,ftp://public-ftp.hmpdacc.org/HM16STR/by_sample/SRS014458.fsa.gz,s3://human-microbiome-project/HHS/HM16STR/by_sample/SRS014458.fsa.gz 16 | -------------------------------------------------------------------------------- /docker/chiron-valet/reapr/reapr.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use File::Basename; 7 | use File::Spec; 8 | use File::Spec::Link; 9 | 10 | my $reapr = File::Spec->rel2abs($0); 11 | my $this_script = File::Spec::Link->resolve($0); 12 | $this_script = File::Spec->rel2abs($this_script); 13 | my ($scriptname, $scriptdir) = fileparse($this_script); 14 | $scriptdir = File::Spec->rel2abs($scriptdir); 15 | my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix'); 16 | my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip'); 17 | my $version = '1.0.18'; 18 | 19 | if ($#ARGV == -1) { 20 | die qq/REAPR version: $version 21 | Usage: 22 | reapr [options] 23 | 24 | Common tasks: 25 | facheck - checks IDs in fasta file 26 | smaltmap - map read pairs using SMALT: makes a BAM file to be used as 27 | input to the pipeline 28 | perfectmap - make perfect uniquely mapping plot files 29 | pipeline - runs the REAPR pipeline, using an assembly and mapped reads 30 | as input, and optionally results of perfectmap. 31 | (It runs facheck, preprocess, stats, fcdrate, score, 32 | summary and break) 33 | plots - makes Artemis plot files for a given contig, using results 34 | from stats (and optionally results from score) 35 | seqrename - renames all sequences in a BAM file: use this if you already 36 | mapped your reads but then found facheck failed - saves 37 | remapping the reads so that pipeline can be run 38 | 39 | Advanced tasks: 40 | preprocess - preprocess files: necessary for running stats 41 | stats - generates stats from a BAM file 42 | fcdrate - estimates FCD cutoff for score, using results from stats 43 | score - calculates scores and assembly errors, using results from stats 44 | summary - make summary stats file, using results from score 45 | break - makes broken assembly, using results from score 46 | gapresize - experimental, calculates gap sizes based on read mapping 47 | perfectfrombam - generate perfect mapping plots from a bam file (alternative 48 | to using perfectmap for large genomes) 49 | /; 50 | } 51 | 52 | my %tasks = ( 53 | 'perfectmap' => "task_perfectmap.pl", 54 | 'smaltmap' => "task_smaltmap.pl", 55 | 'preprocess' => "task_preprocess.pl", 56 | 'stats' => "task_stats", 57 | 'break' => "task_break", 58 | 'score' => "task_score", 59 | 'plots' => "task_plots.pl", 60 | 'pipeline' => "task_pipeline.pl", 61 | 'seqrename' => "task_seqrename.pl", 62 | 'summary' => "task_summary.pl", 63 | 'facheck' => 'task_facheck.pl', 64 | 'gapresize' => 'task_gapresize', 65 | 'fcdrate' => 'task_fcdrate', 66 | 'perfectfrombam' => 'task_perfectfrombam.pl', 67 | ); 68 | 69 | for my $k (keys %tasks) { 70 | $tasks{$k} = File::Spec->catfile($scriptdir, $tasks{$k}); 71 | } 72 | 73 | 74 | if ($tasks{$ARGV[0]}) { 75 | if ($#ARGV == 0) { 76 | print STDERR "usage:\nreapr $ARGV[0] "; 77 | exec "$tasks{$ARGV[0]} --wrapperhelp" or die; 78 | } 79 | else { 80 | my $cmd; 81 | 82 | if ($ARGV[0] eq "score") { 83 | my $score_out = "$ARGV[-1].per_base.gz"; 84 | my $errors_out = "$ARGV[-1].errors.gff"; 85 | $cmd = "$tasks{$ARGV[0]} " . join(" ", @ARGV[1..$#ARGV]) . " | $bgzip -f -c > $score_out && $tabix -f -b 2 -e 2 $score_out && $bgzip -f $errors_out && $tabix -f -p gff $errors_out.gz"; 86 | } 87 | else { 88 | $cmd = "$tasks{$ARGV[0]} " . join(" ", @ARGV[1..$#ARGV]); 89 | 90 | if ($ARGV[0] eq "stats") { 91 | my $outfile = "$ARGV[-1].per_base.gz"; 92 | $cmd .= " | $bgzip -f -c > $outfile && $tabix -f -b 2 -e 2 $outfile"; 93 | } 94 | } 95 | 96 | exec $cmd or die; 97 | } 98 | } 99 | else { 100 | die qq/Task "$ARGV[0]" not recognised.\n/; 101 | } 102 | --------------------------------------------------------------------------------