Skip to content

multiplierz.post_process

Max Alexander edited this page Feb 12, 2018 · 3 revisions

There are various post-database search result processing procedures that are useful in typical proteomic workflows. Several useful algorithms for evaluating and categorizing Peptide Spectrum Match (PSM) result files are collected in this module. These are all designed to operate on result files of the types returned from mzSearch sessions.


combine_accessions(reportfile, outputfile = None)

Many database search algorithms return a set of results for each spectrum, where various peptide matches have different similarity scores to the observed ion pattern in the spectra and each peptide can be assigned to several different potential protein matches. In most cases, it is most parsimonious to consider only the highest-scoring peptide match for a given spectrum, and protein matches are either disregarded (in favor of protein/gene mappings from, e.g., Pep2Gene) or considered in sum. Therefore, this function combines all PSMs matching a given spectrum into one PSM, representing the highest-scoring peptide and all corresponding potential protein assignments.

calculate_FDR(reportfile, outputfile = None, threshold = 0.01, decoyString = 'rev_', includeStatisticsSheet = True, includeDuplicates = True, separateDuplicateSheet = True, includeFailedSheet = True, includeReverseSheet = True, single_cutoff = True)

An important step in the statistical validation of an MS experiment is to determine the False Discovery Rate of PSMs in the final report, and to remove PSMs whose estimated FDR is above a given threshold (popularly, 1%.) This is usually performed by searching the spectra data against both a true sequence database for the target organism(s) and a decoy database generated from the same sequences (e.g., by taking the organism sequences and reversing them.) Since sequences in the decoy databases are assumed to be not present in the sample, the rate of matches to these sequences is considered to indicate the rate of false matches in the data as a whole.
This function searches through the PSM report for PSMs assigned to a reverse-database 'protein', indicated by the presence of an indicator substring given in decoyString; for reverse databases created by multiplierz.fasta.reverse_database(), this is 'rev_' (which is the default value in this function.) FDR calculation is performed and a peptide score corresponding to the FDR threshold is determined; PSMs scoring below this determined score are removed from the main data. Additional arguments specify whether additional statistics and data are retained in additional sheets.

concatenate_reports(reportfile, outputfile)

Given a set of report files, writes a single file that contains all rows from each in a single table. Note that if files have differing columns, the output file columns will be the intersection of all the input files' columns.


fractionation_plot(fractions, outputfile = None, fig_size = None, **kwargs)

Multi-fraction MS experiments produce large datasets by spreading out peptide detection over many individual instrument runs, but the effectiveness of this method depends on the highly variable elution profiles of the sample being studied. It is useful therefore to have a concise visual indication of fractionation effectiveness as part of an analytical workflow, so that subsequent experiments can be adjusted to better utilize the available instrument time. fractionation_plot produces a scatterplot over the fractionation space (the degrees of organic/salt substrates used over the course of fractionation) indicating how many peptide identifications were made under each condition tested. fractions must be a list of (organic, salt, search_results) tuples; here organic and salt can be arbitrary numbers quantifying the composition of the substrate (these will be used as the data dimensions of the plot), while search_results can either be the path to a PSM result file or a PSM count.

Clone this wiki locally