PSEA Tutorials - CLI Edition (more to come)

Introduction

In this tutorial you’ll use QIIME 2 to perform an analysis of some data.

Typical Runtime: 1 Minunte 20 Seconds

Description

This guide is a preview of how you can use some of the q2-PSEA’s individual modules.

Automated PSEA Analysis with Visualizations

Here we will visualize the results of the PSEA operation by running the following command:

import qiime2.plugins.psea.actions as psea_actions

scatter_plot_viz, volcano_plot_viz = psea_actions.make_psea_table(
    scores_file='source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv',
    pairs_file='source/data/psea-example-data/pairs.tsv',
    peptide_sets_file='source/data/psea-example-data/input.gmt',
    threshold=0.75,
    species_taxa_file='source/data/psea-example-data/species_taxa.tsv',
    min_size=3,
    max_size=5000,
    permutation_num=10000,
    table_dir='psea-example-tables',
)
library(reticulate)

psea_actions <- import("qiime2.plugins.psea.actions")

action_results <- psea_actions$make_psea_table(
    scores_file='source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv',
    pairs_file='source/data/psea-example-data/pairs.tsv',
    peptide_sets_file='source/data/psea-example-data/input.gmt',
    threshold=0.75,
    species_taxa_file='source/data/psea-example-data/species_taxa.tsv',
    min_size=3L,
    max_size=5000L,
    permutation_num=10000L,
    table_dir='psea-example-tables',
)
scatter_plot_viz <- action_results$scatter_plot
volcano_plot_viz <- action_results$volcano_plot
qiime psea make-psea-table \
  --p-scores-file source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv \
  --p-pairs-file source/data/psea-example-data/pairs.tsv \
  --p-peptide-sets-file source/data/psea-example-data/input.gmt \
  --p-threshold 0.75 \
  --p-species-taxa-file source/data/psea-example-data/species_taxa.tsv \
  --p-min-size 3 \
  --p-max-size 5000 \
  --p-permutation-num 10000 \
  --p-table-dir psea-example-tables \
  --o-scatter-plot scatter-plot.qzv \
  --o-volcano-plot volcano-plot.qzv
scatter_plot, volcano_plot = use.action(
        use.UsageAction(
                plugin_id="psea",
                action_id="make_psea_table"
        ),
        use.UsageInputs(
                scores_file="source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv",
                pairs_file="source/data/psea-example-data/pairs.tsv",
                peptide_sets_file="source/data/psea-example-data/input.gmt",
                threshold=0.750000,
                species_taxa_file="source/data/psea-example-data/species_taxa.tsv",
                min_size=3,
                max_size=5000,
                permutation_num=10000,
                table_dir="psea-example-tables"
        ),
        use.UsageOutputNames(
                scatter_plot="scatter_plot",
                volcano_plot="volcano_plot"
        )
)
Using the qiime2 psea make-psea-table tool:
  1. Set “scores_file” to source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv

  2. Set “pairs_file” to source/data/psea-example-data/pairs.tsv

  3. Set “peptide_sets_file” to source/data/psea-example-data/input.gmt

  4. Set “threshold” to 0.75

  5. Expand the additional options section

    1. Set “species_taxa_file” to source/data/psea-example-data/species_taxa.tsv

    2. Set “min_size” to 3

    3. Set “max_size” to 5000

    4. Leave “permutation_num” as its default value of 10000

    5. Set “table_dir” to psea-example-tables

  6. Press the Execute button.

Using Different Methods To Fit A Spline

A number of different methods to fit a spline have also been provided to the user. These options include the following:

  • Smooth spline using R: “r-smooth”

  • Smooth spline using Python: “py-smooth”

  • Cubic spline using the “splines2” package for R: “cubic”

Here we will use the “cubic” option to fit a spline by running the following command:

scatter_plot_with_cubic_spline_viz, volcano_plot_with_cubic_spline_viz = psea_actions.make_psea_table(
    scores_file='source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv',
    pairs_file='source/data/psea-example-data/pairs.tsv',
    peptide_sets_file='source/data/psea-example-data/input.gmt',
    threshold=0.75,
    species_taxa_file='source/data/psea-example-data/species_taxa.tsv',
    min_size=3,
    max_size=5000,
    permutation_num=10000,
    spline_type='cubic',
    table_dir='psea-cubic-spline-example-tables',
)
action_results <- psea_actions$make_psea_table(
    scores_file='source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv',
    pairs_file='source/data/psea-example-data/pairs.tsv',
    peptide_sets_file='source/data/psea-example-data/input.gmt',
    threshold=0.75,
    species_taxa_file='source/data/psea-example-data/species_taxa.tsv',
    min_size=3L,
    max_size=5000L,
    permutation_num=10000L,
    spline_type='cubic',
    table_dir='psea-cubic-spline-example-tables',
)
scatter_plot_with_cubic_spline_viz <- action_results$scatter_plot
volcano_plot_with_cubic_spline_viz <- action_results$volcano_plot
qiime psea make-psea-table \
  --p-scores-file source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv \
  --p-pairs-file source/data/psea-example-data/pairs.tsv \
  --p-peptide-sets-file source/data/psea-example-data/input.gmt \
  --p-threshold 0.75 \
  --p-species-taxa-file source/data/psea-example-data/species_taxa.tsv \
  --p-min-size 3 \
  --p-max-size 5000 \
  --p-permutation-num 10000 \
  --p-spline-type cubic \
  --p-table-dir psea-cubic-spline-example-tables \
  --o-scatter-plot scatter-plot-with-cubic-spline.qzv \
  --o-volcano-plot volcano-plot-with-cubic-spline.qzv
scatter_plot, volcano_plot = use.action(
        use.UsageAction(
                plugin_id="psea",
                action_id="make_psea_table"
        ),
        use.UsageInputs(
                scores_file="source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv",
                pairs_file="source/data/psea-example-data/pairs.tsv",
                peptide_sets_file="source/data/psea-example-data/input.gmt",
                threshold=0.750000,
                species_taxa_file="source/data/psea-example-data/species_taxa.tsv",
                min_size=3,
                max_size=5000,
                permutation_num=10000,
                spline_type="cubic",
                table_dir="psea-cubic-spline-example-tables"
        ),
        use.UsageOutputNames(
                scatter_plot="scatter_plot_with_cubic_spline",
                volcano_plot="volcano_plot_with_cubic_spline"
        )
)
Using the qiime2 psea make-psea-table tool:
  1. Set “scores_file” to source/data/psea-example-data/IM0031_PV2T_25nt_raw_2mm_i1mm_Z-HDI75.tsv

  2. Set “pairs_file” to source/data/psea-example-data/pairs.tsv

  3. Set “peptide_sets_file” to source/data/psea-example-data/input.gmt

  4. Set “threshold” to 0.75

  5. Expand the additional options section

    1. Set “species_taxa_file” to source/data/psea-example-data/species_taxa.tsv

    2. Set “min_size” to 3

    3. Set “max_size” to 5000

    4. Leave “permutation_num” as its default value of 10000

    5. Set “spline_type” to cubic

    6. Set “table_dir” to psea-cubic-spline-example-tables

  6. Press the Execute button.

Once completed, for each new entry in your history, use the Edit button to set the name as follows:

(Renaming is optional, but it will make any subsequent steps easier to complete.)

History Name

“Name” to set (be sure to press Save)

#: qiime2 psea make-psea-table [...] : scatter_plot.qzv

scatter-plot-with-cubic-spline.qzv

#: qiime2 psea make-psea-table [...] : volcano_plot.qzv

volcano-plot-with-cubic-spline.qzv

Keep in mind, when using the “cubic” spline approach, you are also afforded some extra customization with the “degree” and “dof” (degree of freedom) options to get the best spline fit.