LENSTools

Overview

The LENS lenstools module is the main report-assembly and peptide-postprocessing layer for the workflow. It wraps the LENSTools Python and R utilities inside Nextflow processes and workflows and is responsible for:

  • peptide-context generation support

  • peptide filtering and annotation

  • read-support quantification

  • review evidence extraction and scoring

  • report assembly, publication, and validation

  • QC summarization and cohort-level comparisons

Current repository

The current module repository is:

reproducible-analyses-framework-and-tools/modules/tools/lenstools

Within this project, the main wrapper files are:

  • workflow/modules/lenstools/lenstools.nf

  • workflow/modules/lenstools/lenstools.config

Functions used directly by LENS

The entries below are the lenstools processes and workflows currently imported by workflow/modules/lens/lens.nf.

Variant and pMHC processing

Function

Kind

Description

extract_variant_annotations

process

Extracts selected annotation fields from annotated VCFs for downstream report joins.

lenstools_annotate_pmhcs

process

Adds pMHC annotation fields and emits the high-affinity subset used downstream.

lenstools_annotate_pmhcs_second_pass

process

Re-annotates pMHCs after optional multipass filtering.

lenstools_multipass_filter_peps

process

Selects peptides for an optional second-pass MHC characterization run.

lenstools_filter_mutant_peptides

process

Removes peptides that should be filtered against the configured reference peptidome.

lenstools_parse_wt_peptides

process

Converts wildtype peptide FASTAs into lookup tables for agretopicity and report annotation.

lenstools_count_rna_variant_alleles

process

Counts RNA support for variant alleles at genomic loci represented in the report.

lenstools_calculate_ccf

process

Calculates cancer cell fraction values from variant, purity, and copy-number inputs.

lenstools_filter_high_confidence

process

Produces the final high-confidence reviewed report subset.

Peptide read-support quantification

Function

Kind

Description

lenstools_get_erv_and_cta_peptide_read_count

workflow

Wrapper that quantifies ERV- and CTA-derived peptide coding sequences in RNA alignments.

lenstools_get_viral_peptide_read_count

process

Quantifies RNA read support for viral peptide coding sequences.

lenstools_get_snv_peptide_read_count

process

Quantifies RNA read support for SNV-derived peptide coding sequences.

lenstools_get_indel_peptide_read_count

process

Quantifies RNA read support for InDel-derived peptide coding sequences.

lenstools_get_fusion_peptide_read_count

process

Quantifies RNA read support for fusion-derived peptide coding sequences.

lenstools_get_splice_peptide_read_count

process

Quantifies RNA read support for splice-derived peptide coding sequences.

lenstools_combine_read_counts

process

Merges source-specific peptide read-count outputs into a single report-ready table.

Report annotation and assembly

Function

Kind

Description

lenstools_add_generic_annotation

process

Adds tabular annotations to report rows using a single shared key.

lenstools_add_generic_annotation_multikey

process

Adds tabular annotations using multi-column join keys.

lenstools_add_external_annotation

process

Adds metadata from external reference tables such as ERV or CTA resources.

lenstools_prepare_cta_annotation_ref

process

Prepares and normalizes the CTA annotation reference used for report joins.

lenstools_add_viral_metadata

process

Adds virus-specific metadata to viral report rows.

lenstools_add_lohhla_status

process

Converts LOHHLA outputs into report-ready HLA loss annotations.

lenstools_make_tx_table

process

Builds transcript lookup tables used for transcript-to-gene and versionless joins.

lenstools_add_splice_gene_id

process

Adds splice-event gene identifiers to splice report rows.

lenstools_add_splice_gene_name

process

Adds splice-event gene symbols/names using the transcript lookup table.

lenstools_annotate_origin

process

Labels report rows with origin/source categories derived from upstream annotations.

lenstools_annotate_tpms

process

Adds expression values such as TPMs to report rows.

lenstools_make_lens_bed

process

Converts the report into a BED file for IGV/LENS visualization.

lenstools_make_lens_report

process

Builds the versioned LENS report deliverable from stripped report inputs.

lenstools_add_candidate_ids

process

Adds stable candidate identifiers to report rows before final publication.

lenstools_extract_hla_sidecar

process

Extracts HLA sidecar information used during final report generation.

lenstools_publish_base_report

process

Publishes the base, unreviewed report output.

lenstools_publish_reviewed_report

process

Publishes the reviewed report output package.

lenstools_validate_lens_report

process

Runs final structural/content validation on LENS report outputs.

lenstools_summarize_lens_run_qc

process

Produces run-level QC summaries for the report bundle.

lenstools_remove_empty_columns

process

Removes empty columns from assembled reports before publication.

lenstools_annotate_each_row

process

Applies row-wise annotation logic, used in LENS for APPM annotations.

lenstools_annotate_splice_regtools

process

Merges RegTools-derived splice annotations back into LENS splice review outputs.

Review, prioritization, and QC

Function

Kind

Description

lenstools_review_lens_reports

workflow

Master review workflow that assembles evidence, flags, and review-ready report outputs.

lenstools_prioritize_peptides

process

Computes the standard LENSTools peptide prioritization score.

lenstools_prioritize_peptides_custom

process

Computes custom prioritization outputs using configurable weighting logic.

lenstools_add_recommended_priority_score

process

Adds a recommended priority-score field to finalized report rows.

lenstools_snv_funnel_wrapper

workflow

Summarizes SNV candidate attrition across the LENS filtering funnel.

lenstools_indel_funnel_wrapper

workflow

Summarizes InDel candidate attrition across the LENS filtering funnel.

lenstools_splice_funnel_wrapper

workflow

Summarizes splice candidate attrition across the LENS filtering funnel.

lenstools_fusion_funnel_wrapper

workflow

Summarizes fusion candidate attrition across the LENS filtering funnel.

lenstools_erv_funnel_wrapper

workflow

Summarizes ERV candidate attrition across the LENS filtering funnel.

lenstools_virus_funnel_wrapper

workflow

Summarizes viral candidate attrition across the LENS filtering funnel.

lenstools_cta_funnel_wrapper

workflow

Summarizes CTA candidate attrition across the LENS filtering funnel.

lenstools_assess_appm

process

Assesses antigen-processing and presentation machinery features from expression inputs.

lenstools_assess_spliceosome

process

Assesses spliceosome-related expression features for downstream QC/interpretation.

lenstools_multigroup_analysis

process

Produces multi-group comparison outputs for patients with grouped samples.

Lower-level helper entry points in the current repo

The current lenstools repo also contains lower-level helper processes that are typically reached through other subworkflows rather than imported directly by lens.nf. Examples include:

  • lenstools_make_snv_peptides_context

  • lenstools_make_indel_peptides_context

  • lenstools_filter_expressed_variants

  • lenstools_get_expressed_transcripts_bed

  • lenstools_make_variant_specific_vcfs

  • lenstools_make_variant_specific_tx_seqs

  • lenstools_get_3prime_seq_bed

  • lenstools_filter_expressed_self_genes

  • lenstools_get_expressed_selfs_bed

  • lenstools_make_self_antigen_peptides

  • lenstools_filter_expressed_ervs

  • lenstools_filter_expressed_ervs_without_control

  • lenstools_filter_ervs_by_rna_coverage

  • lenstools_get_expressed_ervs_bed

  • lenstools_make_erv_peptides

  • lenstools_filter_expressed_viruses

  • lenstools_filter_viruses_by_rna_coverage

  • lenstools_get_expressed_viral_bed

  • lenstools_make_viral_peptides

  • lenstools_get_fusion_transcripts_bed

  • lenstools_make_fusion_specific_tx_seqs

  • lenstools_make_fusion_peptides_context

Those helpers are the implementation-level building blocks behind the antigen-source-specific behavior described in Antigen-specific technical details.