Please note that the pXg-GUI version shared here is a temporary build. It is still under active development, and the final version will be released in the future <download>.
pXg (proteomics X genomics) is a software tool that enables the reliable identification of both canonical and noncanonical MHC-I-associated peptides (MAPs) from de novo peptide sequencing by utilizing RNA-Seq data.
pXg can be integrated with any search engine, such as PEAKS and pNovo3. It was developed for the reliable identification of noncanonical MAPs from de novo peptide sequencing, but it can also be used to count the number of reads mapped to each peptide sequence.
| Input | Description | Format | Mandatory |
|---|---|---|---|
| Search result | A list of PSMs identified by a search engine (e.g. PEAKS, pNovo3, Casanovo) | TSV or CSV | Yes |
| Gene annotation | It must be the same file used in the read alignment (e.g. Gencode, Ensembl) | GTF | Yes |
| RNA-Seq reads | Mapped and unmapped RNA-Seq reads. The file must be sorted by coordinates. Multiple SAM/BAM files should be separated by comma (,) | SAM/BAM | Yes |
| Protein sequences | Canonical and contaminant protein sequences (e.g. UniProt) | Fasta | No |
*pXg does not support pNovo3's flat-formatted output directly; you must convert it to CSV or TSV first.
*Since version 2.3.0, pXg supports multiple SAM/BAM files. The "Reads" column shows the sum of reads across all SAM/BAM files, and the per-file read counts are appended as additional columns at the end.
| Output | Description | Format | Mandatory |
|---|---|---|---|
| pXg result | This is a main output file and contains a list of identification as TSV format | TSV | Yes |
| pXg result for Percolator | This is a main output file and contains a list of identification as PIN format | PIN | Yes |
| Matched reads* | Matched reads to peptides passing all filters | SAM | No |
*Although the pXg result contains PSM information with corresponding RNA-Seq read counts, it is not directly suitable for visualization.
The two additional output files (matched reads and peptides) can be used directly in IGV, making visualization easier.
| Field | Description | Value |
|---|---|---|
| SpecID | Identifier of a spectrum | String |
| GenomicID | Identifier of genomic sequence | Integer |
| Label | Target (1) and decoy (-1) labels | 1|-1 |
| nDeltaScore | Normalized difference between main scores of current rank and top-rank peptides | Float |
| Rank | Rank of candidate peptides | Integer |
| GenomicLociCount | The number of genomic locations | Integer |
| AminoAcidVariant | An amino acid substitution in the format [position]:[original amino acid]>[altered amino acid] | String |
| InferredPeptide | Translated nucleotide sequence with a PTM annotation | String |
| InferredSequence | Translated nucleotide sequence without a PTM annotation | String |
| GenomicLoci | Genomic location of the peptide | String |
| Strand | Strand of matched sequence | +|- |
| ObservedLeftFlankNucleotide | Nucleotide sequence of the left flank of the peptide | String |
| ObservedNucleotide | Nucleotide sequence of the peptide | String |
| ObservedRightFlankNucleotide | Nucleotide sequence of the right flank of the peptide | String |
| ReferenceLeftFlankNucleotide | Reference nucleotide sequence of the left flank of the peptide | String |
| ReferenceNucleotide | Reference nucleotide sequence of the peptide | String |
| ReferenceRightFlankNucleotide | Reference nucleotide sequence of the right flank of the peptide | String |
| Mutations | Genomic information of mutations in the peptide | String |
| MutationStatus | Indication of alteration caused by the mutations | Altered|Same |
| TranscriptIDs | Matched transcript IDs | String |
| GeneIDs | Matched gene IDs | String |
| GeneIDCount | The number of matched gene IDs | Integer |
| GeneNames | Matched gene names | String |
| GeneNameCount | The number of matched gene names | Integer |
| PercentFullDistance | Proportion of start genomic loci in the longest transcripts (exons + introns) | Float |
| PercentExonDistance | Proportion of start genomic loci in the longest transcripts (exons) | Float |
| PercentCDSDistance | Proportion of start genomic loci in the longest transcripts (CDSs) | Float |
| FromCDSStartSite | Distance from the start site | String |
| FromCDSStopSite | Distance from the stop site | String |
| Events | Type of identified feature | String |
| EventCount | The number of events | Integer |
| FastaIDs | Matched identifiers in a given fasta sequences | String |
| FastaIDCount | The number of FastaIDs | Integer |
| Reads | Geometric mean of matched reads (or RPHM) across all SAM/BAM files | Float |
| MeanQScore | Mean of Phred scores | Float |
| IsReference | Reference (true) or non-reference (false) status | true|false |
| SAM/BAM file name | The number of matched reads (or RPHM) in each SAM/BAM file | Float |
The unknown-sequence section contains sequence information from "unknown" events. Each header line begins with ">[PEPTIDE]", followed by the matched read information: the sequence identifier, genomic location (if available), full sequence, and matched sequence.
| aaRNA | aaPeptide |
|---|---|
| W | F |
| W | M |
Single amino acid variants (SAAVs) can arise after translation and therefore cannot always be detected at the RNA level.
pXg can account for SAAVs based on de novo peptide sequencing results.
As an example, we illustrate two SAAVs: W→F and W→M.
| Option | Description | Value | Mandatory |
|---|---|---|---|
| gtf | GTF file path. We recommend using the same GTF file used for the alignment | String | Yes |
| bam | SAM/BAM file path. The file must be sorted by coordinate. Multiple SAM/BAM files should be separated by commas (,) | String | Yes |
| psm | PSM file path. The file is expected to be a proteomics search result from a de novo or database search engine | String | Yes |
| identifier_index | PSM identifier column indices (one-based). One or more indices can be specified, separated by commas. ex) 3,5,7 | Integer | Yes |
| peptide_index | Peptide column index in the PSM file | Integer | Yes |
| charge_index | Charge state column index in the PSM file | Integer | Yes |
| output | Base output file name for pXg | String | Yes |
| comment | Specify the starting characters of comment lines to be ignored during processing. Lines beginning with these characters will be skipped. Default is #|@|%|MTD | String | No |
| min_score | Specify the minimum score threshold for peptide-spectrum matches (PSMs) to be included. Default is 0 | float | No |
| count | Specify which reads to consider when counting read support. Default is primary | primary|all | No |
| sep | Specify the column separator. Possible values are csv or tsv. Default is tsv | tsv|csv | No |
| mode | Specify the library strandedness (default is auto). auto: auto-detected, paired-end only. fr: first-forward, second-reverse. rf: first-reverse, second-forward. r: reverse single-end. f: forward single-end. none: unstranded | f|r|fr|rf|auto|none | No |
| add_index | Specify the column indices of additional features to include in the PIN file. Multiple features can be added, separated by commas. ex) 5,6,7 | Integer | No |
| il_equivalent | Controls whether pXg treats isoleucine (I) and leucine (L) as equivalent for peptide identification. Default is true | true|false | No |
| lengths | Peptide length range to consider (min-max, inclusive). Default is 8-15. ex) 8-13 | Integer | No |
| fasta | Canonical sequence database used to conservatively assign noncanonical PSMs | String | No |
| rank | Number of ranked candidates to consider per scan. Default is 100 (effectively all ranked candidates) | Integer | No |
| aa_variant | File path of the amino acid variant table | String | No |
| output_sam | Report matched reads as a SAM file (true or false). Default is false | true|false | No |
| output_canonical | Report canonical peptides in the SAM output (true or false). Default is true | true|false | No |
| output_noncanonical | Report noncanonical peptides in the SAM output (true or false). Default is true | true|false | No |
| penalty_mutation | Penalty per mutation. Default is 1 | Float | No |
| penalty_alternative_splicing | Penalty for alternative splicing. Default is 10 | Float | No |
| penalty_5utr | Penalty for 5`-UTR. Default is 20 | Float | No |
| penalty_3utr | Penalty for 3`-UTR. Default is 20 | Float | No |
| penalty_ncrna | Penalty for noncoding RNA. Default is 20 | Float | No |
| penalty_frameshift | Penalty for frameshift. Default is 20 | Float | No |
| penalty_intron_retention | Penalty for intron retention. Default is 30 | Float | No |
| penalty_intergenic_region | Penalty for an intergenic region. Default is 30 | Float | No |
| penalty_asrna | Penalty for antisense RNA. Default is 30 | Float | No |
| penalty_softclip | Penalty for softclipped reads. Default is 50 | Float | No |
| penalty_unknown | Penalty for unmapped reads. Default is 100 | Float | No |
| gtf_partition_size* | Size of the genomic region processed at once. Default is 5000000 | Integer | No |
| sam_partition_size* | Number of reads processed at once. Default is 1000000 | Integer | No |
| threads* | Number of worker threads. Default is 4 | Integer | No |
*These partition-size parameters affect memory usage and runtime. If your machine has limited memory, reduce these values.
java -Xmx30G -jar pXg.jar \
--gtf [gene annotation file path] \
--bam [sorted SAM/BAM file path] \
--psm [de novo result file path] \
--fasta [protein sequence fasta file path] \
--identifier_index [index of file name column] \
--charge_index [index of charge state column] \
--peptide_index [index of peptide column] \
--score_index [index of search score column] \
--output [base output file name]This tutorial walks through how to run pXg and estimate FDR from its results. It covers 1) running the STAR2 aligner with the 2-pass option, 2) preparing the SAM file from the alignment, 3) running pXg, and 4) post-processing steps, including running Percolator, merging the pXg result with the Percolator result, and estimating separate FDRs. Note that this tutorial does not cover how to run de novo peptide sequencing engines such as PEAKS, pNovo3, and Casanovo, nor how to generate deep-learning-based features.
We recommend aligning FASTQ files with STAR2 using the two-pass alignment option from The Cancer Genome Atlas (TCGA) pipeline.
Once you have the aligned BAM or SAM file, you MUST sort it by chromosomal coordinates.
Below is example code for preprocessing the SAM file using SAMtools:
samtools sort -o in.sorted.bam in.bam -@ 8
samtools index in.sorted.bam -@ 8The resulting "in.sorted.bam" file is then used as input for pXg.
This tutorial provides toy datasets — 1) de novo results, 2) in.sorted.sam, 3) gene annotation (GTF), and 4) a protein sequence FASTA file — in the tutorial folder, so you can try running the pXg pipeline yourself.
Using the toy datasets, you can run the pXg pipeline with the following command:
java -Xmx2G -jar pXg.v2.0.1.jar \
--gtf toy.gtf \
--sam toy.sorted.sam \
--psm toy.psm.csv \
--fasta toy.fasta \
--output toy \
--identifier_index 2,5 \
--peptide_index 4 \
--score_index 8 \
--charge_index 11 \
--add_index 15 \
--sep csv \
--mode none \
--threads 2This should take about 2 minutes.
Note that the required memory (e.g., "-Xmx50G") depends on the size of the BAM file. In our experience, "-Xmx30G" is enough to handle a ~20GB file.
Once you have the pXg result, you can add extra features — such as spectral similarity and delta retention time — as described in our manuscript. Even without these additional features, you can still run Percolator and estimate FDR from the pXg results.
We recommend using Percolator version >= v3.06.1, since earlier versions have an issue printing proteinIds.
Post processing codes are also provided in the tutorial folder (post_process.ipynb).
- Export the pXg result as a GTF file.
