This guide shows how to perform quality control on a library using the barcoded constructs from the Minigene report and a sample sheet that contains a second, sample-level barcode.
The library itself is generated by ordering the barcoded constructs and then cloning them into the appropriate expression vectors to function as MHC-presented peptides. The sample barcode is then added via PCR primers and few rounds of amplification.
This workflow can be used either on the construct library, the transduced cells, or cells after co-culture. The goal of this step is to confirm that all constructs are present in the approriate proportions. We provide functions to process and analyze the sequencing data.
The Minigene report step of this package provides a table with tiled reference and alternative peptides, along with their respective IDs. When ordering those as gene blocks, one or more construct barcodes are added to the sequence, so we are able to uniquely identify our minigene peptides also when a sequencing read does not reach the mutated base.
Here, we generate a deterministic set of example barcodes. In a real library, use a validated barcode design with the required edit distance and sequence constraints for your assay:
These barcodes need to be of the same length and not overlap between samples in one QC run. For the analysis, we manually add them as columns to the peptide/minigene tables:
barcode – if only one barcode per constructbarcode_1, barcode_2, etc. – if multiple
barcodes per constructThe other required fields are, for each sample:
gene_name – an identifier for the gene,
e.g. NRASmut_id – a common identifier for ref and
alt sequences, e.g. NRAS_Q61pep_id – a unique identifier for each peptide,
e.g. NRAS_Q61L-1pep_type – whether this is a ref or
alt sequence (or other)tiled – the tiled nucleotide sequenceFor the QC analysis, we will need a named list of these barcoded
Minigene tables. We will usually have assembled them in a
.xlsx file with these barcodes added, however, here we will
use an example dataset:
We can confirm that these barcodes do not overlap:
A sequencing (FASTQ) file will contain a sample barcode, construct barcode, and construct sequence:
Before we can start working with the FASTQ sequencing output, we need to describe which samples it contains. For this, we create a sample sheet with the following columns:
sample_id – a unique identifier of the samplepatient – the patient or sample group that the sample
comes fromrep – a number indicating the replicate numberorigin – a descriptor of which kind of sample this
isbarcode – the barcode used to label all
condition-specific constructs in the sequencing dataFor this example, we have already provided a sample sheet with the
package. It includes three samples, two for library QC
(pat2 and pat3) and one with mock-transfected
vs. actual peptide T-cell co-culture (pat1). The
pat1 and pat2 samples additionally include a
common construct set. Whenever we use multiple construct sets in a
sample, we separate them using a +:
Here, we did not actually do any sequencing, so we provide a simulated FASTQ file instead:
This step counts construct barcodes per sample directly from the
source FASTQ. Here, read_structure describes where the
sample and construct barcodes occur in each read. It has the following
possible fields, preceded by the number of nucleotides in the read. A
+ instead of a number is used to indicate to use all
remaining nucleotides:
B – the sample barcode to identify the sample
(required)M – the construct barcode to count (required)T – the template read sequence (optional)S – skip these nucleotides and do not include in output
(optional)^ before a letter to denote a reverse complement
sequenceIn our example data, the sample barcode is followed directly by a reverse complement of the construct barcode, so the read structure is identified:
In this example, the first 7 nucleotides identify the sample and the
next 12 nucleotides identify the construct are automatically inferred
from the read sequences. However, we could also specify it via the
read_structure argument:
dset = count_fastq(fastq_file, sample_sheet, all_constructs, valid_barcodes)
#> Read structure identified as '7B12M'
#> Counting barcodes in /tmp/Rtmp0eie70/my_seqdata.fq
#> Processed 1,608,536 readsHere, dset will be a SummarizedExperiment
object that you can interact with the following way:
colData(dset) – access the sample metadata as
data.framerowData(dset) – access the construct metadata as
data.frameassay(dset) – access the construct counts as
matrixThe first overview that we want to get is to know how many barcodes are in which demultiplexed FASTQ, and whether they match the sample we expect them to be from. We can plot this the following way, for total read counts on the top and number of barcodes that have 10 (default) or more reads on the bottom:
We can also plot this interactively with plotly:
The next question we want to ask is whether the individual construct barcodes are equally distributed within a sample, and where any potential contaminations come from. For this, we order the barcodes from least abundant (left) to most abundant (right) and plot a continuous line for how many reads are sequenced of this barcode on the y axis:
We can make a couple of observations from these plots:
Mock and Sample conditions worked well
for pat1pat2 show a high read
variance and may be unsuitable for a screenpat3 are lostpat1 in
pat3We can also plot this interactively with plotly, where
we can hover over with the mouse to see which barcode is in which
position exactly: