Nextflow pipeline that annotates VCF variants with RNA-seq transcript expression data using vcf-expression-annotator. Integrates output from nf-core/rnaseq and nf-core/sarek.
nextflow run main.nf -profile test,docker # Test run
nextflow run main.nf -profile docker \
--patient_id 'PID_262622_' \
--samplesheet samplesheet.csv \
--transcript_counts salmon.merged.transcript_counts.tsv \
--outdir resultsRequirements: Nextflow ≥23.04.0, Docker/Singularity
Samplesheet CSV (--samplesheet):
sample_id,vcf_path,vcf_tumor_sample
SAMPLE_A,/data/vcfs/sample_A.vcf.gz,PATIENT001_tumor_SAMPLE_ATranscript counts TSV (--transcript_counts): Output from nf-core/rnaseq at results/star_salmon/salmon.merged.transcript_counts.tsv
Required parameters:
--patient_id: Patient prefix (must end with_)--samplesheet: CSV with sample metadata--transcript_counts: Merged transcript counts TSV--outdir: Output directory
Annotated VCFs with TX field containing transcript expression:
results/clean_vcf/
├── {sample_id}.clean.vcf # TX field: ENST00000456328:150.5|ENST00000450305:45.2
└── {sample_id}.clean.csv # CSV export
This pipeline uses nf-test for automated testing with the nft-vcf and nft-csv plugins.
Install nf-test (requires Java 11+):
curl -fsSL https://code.askimed.com/install/nf-test | bash
mv nf-test /usr/local/bin/ # or anywhere on your PATHnf-test testThis uses the configuration in nf-test.config, which automatically applies the test,docker profile and loads the required plugins.
# Full pipeline integration test
nf-test test tests/main.nf.test
# Individual module tests
nf-test test tests/modules/split_transcript_counts.nf.test
nf-test test tests/modules/vcf_expression_annotator.nf.test
nf-test test tests/modules/clean_vcf.nf.test
nf-test test tests/modules/vcf_to_csv.nf.testTest fixtures live in tests/data/ and the sample sheet used for testing is at tests/samplesheet.csv. The test profile (-profile test) configures paths to these fixtures automatically.
- Ensure
--patient_idends with_ sample_idshould NOT include patient_id prefix- Verify VCF sample names:
bcftools query -l file.vcf.gz - Empty TX field? Check transcript IDs match between VCF and counts file
Gross, T. (2025). VCF Expression Annotator. https://github.com/tylergross97/vcf_expression_annotation
MIT License