Add snpclustering subworkflow - #11879
Conversation
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
|
thank you @famosab, |
Removed comments about optional files and signature inference.
|
Hi @famosab, |
Drop env/cpu overrides and default ext.args. Pin BEAGLE/PLINK2 seeds
for stable hashes and set GAWK_EIGENVEC_TO_TSV ext.suffix=tsv so the
output does not collide with PLINK2 ${meta.id}.eigenvec.
|
@famosab a short update on the test/config cleanup, then a question on merge timing.
Removed from that file: The eigenvec → TSV conversion ( Snapshots no longer md5 non-deterministic files. We still assert content where it is stable, following the
On topics: the three custom modules already emit Happy to change anything you still want touched. When you have a moment, is there anything left before this can be merged. |
| * column to sample_id. Output keeps its default naming (<meta.id>.eigenvec) | ||
| * — only the tab-separated content matters downstream, not the extension. | ||
| */ | ||
| GAWK_EIGENVEC_TO_TSV( |
There was a problem hiding this comment.
Personally, I wonder if having a dedicated process to remove # and rename IID to sample_id is necessary, especially considering that the recipient of this is a custom module, which could handle this trivial conversion if it is required?
There was a problem hiding this comment.
Fair question. I left it as a dedicated step so custom/pcaclustering stays generic (any TSV of sample × features) and does not absorb PLINK-specific quirks (# header, IID/FID). The rename to sample_id also matches what clustermetrics / clustervisualization already expect. I’d rather keep that adapter at the subworkflow boundary than special-case PLINK inside the clustering module.
There was a problem hiding this comment.
I think it would be better to special-case PLINK format in your clustering module, since it seems to commonly consume files that were generated in PLINK format. Which in my view would actually make the module more generic?
I understand that this is a custom module, but to me it would facilitate wider adoption if this module was tailored to the inputs, and it is a very simple operation (e.g. sed 's/#//; s/IID/sample_id/' "${plinkfile}" > "${tsvfile}" should do it), and I assume that you could simply test if it is necessary based on extension of the input file.
My main concern here is that I assume spawning all of these jobs creates some overhead, and the jobs do very little. Since @famosab has been involved more than I am, maybe there are considerations here that I am not aware of.
Co-authored-by: Niklas Schandry <schandry@gmail.com>
Co-authored-by: Niklas Schandry <schandry@gmail.com>
Updated the description to include k-distance analysis.
Split the description into multiple lines for better readability.
|
@nschan thanks — this is now in place.
|
Great, thanks for taking up that comment and incorporating it. In my view it improves the modules, and streamlines this workflow. I have no further comments. Since I was not involved in this from the beginning, maybe it would be good if @SPPearce and/or @famosab could take another look? |
Description
This PR adds the
snpclusteringsubworkflow for end-to-end unsupervised clustering of genomicsamples from genotyped multi-sample VCF files.
This is a revised and extended version of the subworkflow originally proposed in #11059, which was
based on FlashPCA2 (not available as an nf-core module). The current implementation replaces it
with official nf-core modules throughout and extends the pipeline with imputation, PCA-based
clustering, quality metrics, and visualization steps.
Pipeline
Features
beagle5/beagle(reference panel and genetic map optional)plink2/vcfplink2/pca.eigenvec→ TSV conversion via an embeddedEIGENVEC_TO_TSVprocess (gawk)custom/pcaclusteringcustom/clustermetricscustom/clustervisualizationRelated PRs
custom/pcaclustering,custom/clustermetrics, `custom/clustervisualization