q2-pepsirf Tutorials - Multiple Interface Edition¶
Introduction¶
In this tutorial you’ll use QIIME 2 to perform an analysis of some data.
Typical Run Time: TBD Minute
Description¶
This guide is a preview of how you can use some of q2-pepsirf’s individual modules.
Demux¶
Here we will test q2-pepsirf’s demux module by running the following command:
Note
You must have the development branch of pepsirf precompiled in order to use this module.
from qiime2 import Artifact
from urllib import request
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/input-r1.qza'
fn = 'input-r1.qza'
request.urlretrieve(url, fn)
input_r1 = Artifact.load(fn)
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/input-r2.qza'
fn = 'input-r2.qza'
request.urlretrieve(url, fn)
input_r2 = Artifact.load(fn)
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/fif.qza'
fn = 'fif.qza'
request.urlretrieve(url, fn)
fif = Artifact.load(fn)
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/library.qza'
fn = 'library.qza'
request.urlretrieve(url, fn)
library = Artifact.load(fn)
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/sample-list.qza'
fn = 'sample-list.qza'
request.urlretrieve(url, fn)
sample_list = Artifact.load(fn)
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/index.qza'
fn = 'index.qza'
request.urlretrieve(url, fn)
index = Artifact.load(fn)
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/input-r1.qza'
fn <- 'input-r1.qza'
request$urlretrieve(url, fn)
input_r1 <- Artifact$load(fn)
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/input-r2.qza'
fn <- 'input-r2.qza'
request$urlretrieve(url, fn)
input_r2 <- Artifact$load(fn)
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/fif.qza'
fn <- 'fif.qza'
request$urlretrieve(url, fn)
fif <- Artifact$load(fn)
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/library.qza'
fn <- 'library.qza'
request$urlretrieve(url, fn)
library <- Artifact$load(fn)
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/sample-list.qza'
fn <- 'sample-list.qza'
request$urlretrieve(url, fn)
sample_list <- Artifact$load(fn)
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/index.qza'
fn <- 'index.qza'
request$urlretrieve(url, fn)
index <- Artifact$load(fn)
wget \
-O 'input-r1.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/input-r1.qza'
wget \
-O 'input-r2.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/input-r2.qza'
wget \
-O 'fif.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/fif.qza'
wget \
-O 'library.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/library.qza'
wget \
-O 'sample-list.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/sample-list.qza'
wget \
-O 'index.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/index.qza'
def r1_factory():
import qiime2
return qiime2.Artifact.load("source/data/Undetermined_S0_R1_001_1M.qza")
input_r1 = use.init_artifact("input_r1", r1_factory)
def r2_factory():
import qiime2
return qiime2.Artifact.load("source/data/Undetermined_S0_I1_001_1M.qza")
input_r2 = use.init_artifact("input_r2", r2_factory)
def fif_factory():
import qiime2
return qiime2.Artifact.load("source/data/demux_flex_2indexes_test.qza")
fif = use.init_artifact("fif", fif_factory)
def library_factory():
import qiime2
return qiime2.Artifact.load("source/data/noDupEncode_NS64_coded_116nt.qza")
library = use.init_artifact("library", library_factory)
def sample_factory():
import qiime2
return qiime2.Artifact.load("source/data/NS64_sample_list_extended.qza")
samplelist = use.init_artifact("sample_list", sample_factory)
def index_factory():
import qiime2
return qiime2.Artifact.load("source/data/BSC_FR_barcodes_Plus.qza")
index = use.init_artifact("index", index_factory)
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
input-r1.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/input-r1.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
input-r2.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/input-r2.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
fif.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/fif.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
library.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/library.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
sample-list.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/sample-list.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
index.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/index.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
import qiime2.plugins.pepsirf.actions as pepsirf_actions
demux_diagnostic_output, demux_2index_fif_output = pepsirf_actions.demux(
input_r1=input_r1,
input_r2=input_r2,
fif=fif,
seq='43,116,2',
read_per_loop=200000,
num_threads=2,
phred_base=33,
library=library,
index=index,
samplelist=sample_list,
pepsirf_binary='/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf',
)
pepsirf_actions <- import("qiime2.plugins.pepsirf.actions")
action_results <- pepsirf_actions$demux(
input_r1=input_r1,
input_r2=input_r2,
fif=fif,
seq='43,116,2',
read_per_loop=200000L,
num_threads=2L,
phred_base=33L,
library=library,
index=index,
samplelist=sample_list,
pepsirf_binary='/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf',
)
demux_diagnostic_output <- action_results$raw_counts_output
demux_2index_fif_output <- action_results$diagnostic_output
qiime pepsirf demux \
--i-input-r1 input-r1.qza \
--i-input-r2 input-r2.qza \
--i-fif fif.qza \
--p-seq 43,116,2 \
--p-read-per-loop 200000 \
--p-num-threads 2 \
--p-phred-base 33 \
--i-library library.qza \
--i-index index.qza \
--i-samplelist sample-list.qza \
--p-pepsirf-binary /home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf \
--o-raw-counts-output demux-diagnostic-output.qza \
--o-diagnostic-output demux-2index-fif-output.qza
rawData, diagnosticData, = use.action(
use.UsageAction(plugin_id='pepsirf', action_id='demux'),
use.UsageInputs(
input_r1 = input_r1,
input_r2 = input_r2,
fif = fif,
seq = "43,116,2",
read_per_loop = 200000,
num_threads = 2,
phred_base = 33,
library = library,
index = index,
samplelist = samplelist,
pepsirf_binary = "/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf"
),
use.UsageOutputNames(
raw_counts_output = "demux_diagnostic_output",
diagnostic_output = "demux_2index_fif_output"
)
)
- Using the
qiime2 pepsirf demux
tool: Set “input_r1” to
#: input-r1.qza
Set “index” to
#: index.qza
Set “samplelist” to
#: sample-list.qza
Set “seq” to
43,116,2
Expand the
additional options
sectionSet “input_r2” to
#: input-r2.qza
Set “fif” to
#: fif.qza
Set “library” to
#: library.qza
Set “read_per_loop” to
200000
Leave “num_threads” as its default value of
2
Leave “phred_base” as its default value of
33
Set “pepsirf_binary” to
/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf
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 pepsirf demux [...] : raw_counts_output.qza
demux-diagnostic-output.qza
#: qiime2 pepsirf demux [...] : diagnostic_output.qza
demux-2index-fif-output.qza
Deconv-Batch¶
Here we will test q2-pepsirf’s deconv-batch module by running the following commands:
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/enriched-dir.qza'
fn = 'enriched-dir.qza'
request.urlretrieve(url, fn)
enriched_dir = Artifact.load(fn)
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/linked.qza'
fn = 'linked.qza'
request.urlretrieve(url, fn)
linked = Artifact.load(fn)
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/id-name-map.qza'
fn = 'id-name-map.qza'
request.urlretrieve(url, fn)
id_name_map = Artifact.load(fn)
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/enriched-dir.qza'
fn <- 'enriched-dir.qza'
request$urlretrieve(url, fn)
enriched_dir <- Artifact$load(fn)
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/linked.qza'
fn <- 'linked.qza'
request$urlretrieve(url, fn)
linked <- Artifact$load(fn)
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/id-name-map.qza'
fn <- 'id-name-map.qza'
request$urlretrieve(url, fn)
id_name_map <- Artifact$load(fn)
wget \
-O 'enriched-dir.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/enriched-dir.qza'
wget \
-O 'linked.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/linked.qza'
wget \
-O 'id-name-map.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/id-name-map.qza'
def enriched_factory():
import qiime2
return qiime2.Artifact.load("source/data/pEnrich_z6-10_sbdr4_n20_r244k_dir.qza")
enriched_dir = use.init_artifact("enriched_dir", enriched_factory)
def linked_factory():
import qiime2
return qiime2.Artifact.load("source/data/full_design_clean_min30_taxtweak_100perc_jingmens_2020-11-23_K7-species.qza")
linked = use.init_artifact("linked", linked_factory)
def id_factory():
import qiime2
return qiime2.Artifact.load("source/data/virus_lineage.qza")
id_name_map = use.init_artifact("id_name_map", id_factory)
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
enriched-dir.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/enriched-dir.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
linked.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/linked.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
id-name-map.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/id-name-map.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
Note
Some of these files will also be used for deconv-singular.
deconv, score_per_round, peptide_assignment_map = pepsirf_actions.deconv_batch(
enriched_dir=enriched_dir,
enriched_file_ending='_paired.txt',
score_filtering=True,
threshold=40,
score_tie_threshold=0.95,
score_overlap_threshold=0.7,
remove_file_types=True,
outfile_suffix='_ss40.txt',
mapfile_suffix='_ss40.map',
linked=linked,
id_name_map=id_name_map,
pepsirf_binary='/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf',
)
action_results <- pepsirf_actions$deconv_batch(
enriched_dir=enriched_dir,
enriched_file_ending='_paired.txt',
score_filtering=TRUE,
threshold=40L,
score_tie_threshold=0.95,
score_overlap_threshold=0.7,
remove_file_types=TRUE,
outfile_suffix='_ss40.txt',
mapfile_suffix='_ss40.map',
linked=linked,
id_name_map=id_name_map,
pepsirf_binary='/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf',
)
deconv <- action_results$deconv_output
score_per_round <- action_results$score_per_round
peptide_assignment_map <- action_results$peptide_assignment_map
qiime pepsirf deconv-batch \
--i-enriched-dir enriched-dir.qza \
--p-enriched-file-ending _paired.txt \
--p-score-filtering \
--p-threshold 40 \
--p-score-tie-threshold 0.95 \
--p-score-overlap-threshold 0.7 \
--p-remove-file-types \
--p-outfile-suffix _ss40.txt \
--p-mapfile-suffix _ss40.map \
--i-linked linked.qza \
--i-id-name-map id-name-map.qza \
--p-pepsirf-binary /home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf \
--o-deconv-output deconv.qza \
--o-score-per-round score-per-round.qza \
--o-peptide-assignment-map peptide-assignment-map.qza
deconv, score_per_round, peptide_assignment_map, = use.action(
use.UsageAction(plugin_id='pepsirf', action_id='deconv_batch'),
use.UsageInputs(
enriched_dir = enriched_dir,
enriched_file_ending = "_paired.txt",
score_filtering = True,
threshold = 40,
score_tie_threshold = 0.95,
score_overlap_threshold = 0.7,
remove_file_types = True,
outfile_suffix = "_ss40.txt",
mapfile_suffix = "_ss40.map",
linked = linked,
id_name_map = id_name_map,
pepsirf_binary = "/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf"
),
use.UsageOutputNames(
deconv_output = "deconv",
score_per_round = "score_per_round",
peptide_assignment_map = "peptide_assignment_map"
)
)
- Using the
qiime2 pepsirf deconv-batch
tool: Set “enriched_dir” to
#: enriched-dir.qza
Set “linked” to
#: linked.qza
Set “threshold” to
40
Set “outfile_suffix” to
_ss40.txt
Set “mapfile_suffix” to
_ss40.map
Expand the
additional options
sectionSet “id_name_map” to
#: id-name-map.qza
Set “enriched_file_ending” to
_paired.txt
Set “score_filtering” to
Yes
Set “score_tie_threshold” to
0.95
Set “score_overlap_threshold” to
0.7
Set “remove_file_types” to
Yes
Set “pepsirf_binary” to
/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf
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 pepsirf deconv-batch [...] : deconv_output.qza
deconv.qza
#: qiime2 pepsirf deconv-batch [...] : score_per_round.qza
score-per-round.qza
#: qiime2 pepsirf deconv-batch [...] : peptide_assignment_map.qza
peptide-assignment-map.qza
Deconv-Singular¶
Here we will test q2-pepsirf’s deconv-singular module by running the following commands:
url = 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/enriched-peptides.qza'
fn = 'enriched-peptides.qza'
request.urlretrieve(url, fn)
enriched_peptides = Artifact.load(fn)
url <- 'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/enriched-peptides.qza'
fn <- 'enriched-peptides.qza'
request$urlretrieve(url, fn)
enriched_peptides <- Artifact$load(fn)
wget \
-O 'enriched-peptides.qza' \
'https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/enriched-peptides.qza'
def peptide_factory():
import qiime2
return qiime2.Artifact.load("source/data/enriched-peptides.qza")
enriched_peptides = use.init_artifact("enriched_peptides", peptide_factory)
- Using the
Upload Data
tool: On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.Set “Name” (first text-field) to:
enriched-peptides.qza
In the larger text-area, copy-and-paste: https://ladnerlab.github.io/pepsirf-q2-plugin-docs/data/tutorials/pepsirf/enriched-peptides.qza
(“Type”, “Genome”, and “Settings” can be ignored)
Press the
Start
button at the bottom.
deconv_output_singular, score_per_round_singular = pepsirf_actions.deconv_singular(
enriched=enriched_peptides,
enriched_file_ending='_paired.txt',
score_filtering=True,
threshold=40,
score_tie_threshold=0.95,
score_overlap_threshold=0.7,
linked=linked,
id_name_map=id_name_map,
pepsirf_binary='/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf',
)
action_results <- pepsirf_actions$deconv_singular(
enriched=enriched_peptides,
enriched_file_ending='_paired.txt',
score_filtering=TRUE,
threshold=40L,
score_tie_threshold=0.95,
score_overlap_threshold=0.7,
linked=linked,
id_name_map=id_name_map,
pepsirf_binary='/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf',
)
deconv_output_singular <- action_results$deconv_output
score_per_round_singular <- action_results$score_per_round
qiime pepsirf deconv-singular \
--i-enriched enriched-peptides.qza \
--p-enriched-file-ending _paired.txt \
--p-score-filtering \
--p-threshold 40 \
--p-score-tie-threshold 0.95 \
--p-score-overlap-threshold 0.7 \
--i-linked linked.qza \
--i-id-name-map id-name-map.qza \
--p-pepsirf-binary /home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf \
--o-deconv-output deconv-output-singular.qza \
--o-score-per-round score-per-round-singular.qza
deconv_sing, score_per_round_sing, = use.action(
use.UsageAction(plugin_id='pepsirf', action_id='deconv_singular'),
use.UsageInputs(
enriched = enriched_peptides,
enriched_file_ending = "_paired.txt",
score_filtering = True,
threshold = 40,
score_tie_threshold = 0.95,
score_overlap_threshold = 0.7,
linked = linked,
id_name_map = id_name_map,
pepsirf_binary = "/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf"
),
use.UsageOutputNames(
deconv_output = "deconv_output_singular",
score_per_round = "score_per_round_singular"
)
)
- Using the
qiime2 pepsirf deconv-singular
tool: Set “enriched” to
#: enriched-peptides.qza
Set “linked” to
#: linked.qza
Set “threshold” to
40
Expand the
additional options
sectionSet “id_name_map” to
#: id-name-map.qza
Set “enriched_file_ending” to
_paired.txt
Set “score_filtering” to
Yes
Set “score_tie_threshold” to
0.95
Set “score_overlap_threshold” to
0.7
Set “pepsirf_binary” to
/home/runner/work/pepsirf-q2-plugin-docs/pepsirf-q2-plugin-docs/pepsirf
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 pepsirf deconv-singular [...] : deconv_output.qza
deconv-output-singular.qza
#: qiime2 pepsirf deconv-singular [...] : score_per_round.qza
score-per-round-singular.qza