Protein Identifier Cleaning and Annotation

Published

Jun 2026

After filtering and ranking differentially abundant proteins, the next step is to clean protein identifiers and prepare annotation-ready tables.

Proteomics result tables often contain protein accessions, protein groups, gene symbols, or mixed identifiers exported from upstream software.

Before functional enrichment or STRING network analysis, these identifiers need to be checked, cleaned, and organized.

This chapter prepares clean protein, gene, and annotation input tables for downstream interpretation.

Starting Point

This chapter uses the ranked significant protein table created in Chapter 06:

results/ranked-significant-proteins.tsv

This file was generated by:

Rscript scripts/R/06-rank-and-filter-dep.R \
  results/differential-proteins.tsv \
  results \
  10

The expected input contains columns such as:

protein_id
gene_symbol
protein_name
log2fc
adjusted_p_value
comparison
regulation
rank

Why Identifier Cleaning Matters

Downstream tools depend on clean identifiers.

For example:

GO enrichment       → often needs gene symbols or Entrez IDs
KEGG/Reactome       → may need gene IDs or UniProt accessions
STRING              → accepts protein identifiers, gene symbols, or UniProt IDs
manual reporting    → benefits from gene symbols and protein names

If identifiers are inconsistent, enrichment and network analysis may fail or produce incomplete results.

Common Proteomics Identifier Issues

Proteomics result tables may contain:

  • UniProt accessions
  • gene symbols
  • protein group identifiers
  • multiple accessions in one field
  • isoform identifiers
  • contaminant labels
  • reverse-sequence labels
  • missing gene symbols
  • species-specific identifiers
  • mixed identifier formats

Examples include:

P12345
Q67890;Q67891
sp|P12345|PROT_HUMAN
CON__P12345
REV__Q67890

The goal of this chapter is not to fully solve every database-mapping problem.

The goal is to create clean, reproducible identifier lists that can be reviewed and used in the next steps.

Identifier Cleaning Strategy

The cleaning strategy used here is intentionally conservative.

start with ranked significant proteins
        ↓
detect protein identifier column
        ↓
clean common accession formatting
        ↓
split multiple identifiers when needed
        ↓
flag contaminants and reverse entries
        ↓
prepare gene-symbol and protein-ID lists
        ↓
save annotation-ready outputs

This keeps the original information while creating cleaner downstream inputs.

Expected Input

The expected input is:

results/ranked-significant-proteins.tsv

For a real project, the same file is produced from the real filtered results.

Output Files

The identifier cleaning script creates:

results/
├── cleaned-protein-identifiers.tsv
├── annotation-ready-protein-list.tsv
├── annotation-ready-gene-list.tsv
├── string-network-input.tsv
└── identifier-cleaning-summary.tsv

Cleaning Script

The executable script is saved as:

scripts/R/07-clean-protein-identifiers.R

The guide shows how to run the script. The full executable code is maintained in scripts/R/.

Running the Script

From the project root, run:

Rscript scripts/R/07-clean-protein-identifiers.R \
  results/ranked-significant-proteins.tsv \
  results

The arguments are:

1st argument → ranked significant protein table
2nd argument → output directory

Output 1: Cleaned Protein Identifiers

The main cleaned identifier table is:

results/cleaned-protein-identifiers.tsv

This file keeps the ranked protein information and adds cleaned identifier fields such as:

protein_id_original
protein_id_clean
primary_protein_id
is_multi_identifier
is_contaminant
is_reverse
identifier_status

This table is useful for review before enrichment or network analysis.

Output 2: Annotation-Ready Protein List

The protein-list output is:

results/annotation-ready-protein-list.tsv

This file contains a clean set of protein identifiers.

It is useful for tools that accept UniProt accessions or protein accessions.

Output 3: Annotation-Ready Gene List

The gene-list output is:

results/annotation-ready-gene-list.tsv

This file contains gene symbols when available.

It is useful for tools that expect gene symbols.

If gene symbols are missing, this file may be incomplete. In that case, external identifier mapping may be needed.

Output 4: STRING Network Input

The STRING input file is:

results/string-network-input.tsv

This file contains a practical identifier set for STRING network analysis.

The preferred identifier column is selected in this order:

gene_symbol
        ↓
primary_protein_id
        ↓
protein_id_clean

The file also preserves ranking and regulation information when available.

Output 5: Identifier Cleaning Summary

The summary file is:

results/identifier-cleaning-summary.tsv

It records:

input proteins
unique cleaned protein identifiers
gene symbols available
multi-identifier rows
contaminant-like rows
reverse-like rows
annotation-ready protein IDs
annotation-ready gene symbols

This summary is a checkpoint before functional enrichment.

Contaminants and Reverse Entries

Some proteomics tables include contaminants or reverse-sequence hits.

Common patterns include:

CON__
REV__
Reverse
contaminant

These entries should usually not be used for biological interpretation.

The script flags likely contaminant and reverse entries but does not automatically delete the original rows from the cleaned identifier table.

Instead, annotation-ready outputs exclude flagged entries by default.

Multiple Protein Identifiers

Some rows may contain multiple protein identifiers.

Example:

Q67890;Q67891

This may represent a protein group.

The script creates:

primary_protein_id

using the first identifier after splitting on common separators.

This is a practical default, but protein groups should be reviewed carefully in real projects.

Gene Symbols and Biological Meaning

Gene symbols are useful for readability, but they should be treated carefully.

Potential issues include:

  • missing symbols
  • outdated symbols
  • ambiguous symbols
  • species-specific naming differences
  • symbols that do not map cleanly to enrichment databases

For formal enrichment, the organism and identifier type should be documented.

Relationship to GO and Pathway Enrichment

The next chapter uses the cleaned identifiers to prepare functional enrichment analysis.

The key outputs from this chapter are:

annotation-ready-gene-list.tsv
annotation-ready-protein-list.tsv

These files are the bridge between statistical protein results and biological function.

Looking Ahead

The next chapter focuses on functional enrichment and GO annotation.

Ranked significant proteins
        ↓
Cleaned identifiers
        ↓
Annotation-ready gene/protein lists
        ↓
GO enrichment
        ↓
Pathway interpretation