Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .groovylintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
},
"DuplicateStringLiteral": {
"enabled": false
},
"UnnecessaryGetter": {
"enabled": false
}
}
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.2.4

1. Fixed samplesheets being empty in 0.2.3
2. Added a filter for rnafusion samplesheets. Samples with less than 1 million reads will now be put in a `nfcore_rnafusion_samplesheet_failed.yaml` file

## 0.2.3

Added `tissue` samples to the vivar samplesheet
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:5.3.2'
}

version = '0.2.3'
version = '0.2.4'

nextflowPlugin {
nextflowVersion = '25.10.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,10 @@ class PipelineObserver implements TraceObserverV2 {
* @return the sample name for the given base path
*/
protected String safeGetSample(String inputBasePath) {
String basePath
String basePath = inputBasePath
// Make sure SNP tracking data will be added to the correct sample
if (basePath.startsWith('snp_')) {
basePath = inputBasePath.replaceFirst('snp_', '')
} else {
basePath = inputBasePath
}
List<String> possibleSamples = samples
.findAll { sample -> basePath.startsWith(sample) }.toList() as List<String>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ class PreprocessingObserver extends PipelineObserver {
void onFilePublish(FilePublishEvent event) {
String targetName = event.target.name
String targetPath = event.target.toUriString()

// Get metrics after demultiplexing
if (targetPath.endsWith('_SAV_data') && event.source.isDirectory()) {
Path bysamples = event.source.resolve('multiqc_bclconvert_bysample.txt')
if (bysamples.exists()) {
List<Map> sampleMetrics = bysamples.splitCsv(header:true, sep:'\t')
sampleMetrics.each { metric ->
String sample = metric['Sample']
String yield = metric['yield_']
if (entries.containsKey(sample)) {
entries[sample].add('yield', yield)
}
}
}
}

// Get specific files
switch (targetName) {
case ~/^snp_.*\.cram$/:
entries[safeGetSample(targetName)].add('snp_cram', targetPath)
Expand Down Expand Up @@ -103,24 +120,44 @@ class PreprocessingObserver extends PipelineObserver {
//
// nf-core/rnafusion samplesheet
//

Map<String, OutputEntry> rnafusionEntries = entries
.findAll { entry ->
// Only create samplesheet for RNAseqMDG runs of RNA samples that have FASTQ output
entry.value.get('sample_type')?.toLowerCase() == 'rna' &&
entry.value.get('tag')?.toLowerCase() == 'rnaseqmdg' &&
entry.value.get('fastq_1')
}
List rnafusionKeys = [
['id', 'sample'],
'fastq_1',
'fastq_2',
'strandedness',
['yield', 'reads']
]

// Passed data
creator.dump(
entries
rnafusionEntries
.findAll { entry ->
// Only create samplesheet for RNAseqMDG runs of RNA samples that have FASTQ output
entry.value.get('sample_type')?.toLowerCase() == 'rna' &&
entry.value.get('tag')?.toLowerCase() == 'rnaseqmdg' &&
entry.value.get('fastq_1')
entry.value.get('yield').toInteger() >= 1000000
}
.values()
*.subKeys([
['id', 'sample'],
'fastq_1',
'fastq_2',
'strandedness'
]),
*.subKeys(rnafusionKeys),
location.resolve('nfcore_rnafusion_samplesheet.yaml')
)

// Failed data
creator.dump(
rnafusionEntries
.findAll { entry ->
entry.value.get('yield').toInteger() < 1000000
}
.values()
*.subKeys(rnafusionKeys),
location.resolve('nfcore_rnafusion_samplesheet_failed.yaml')
)

//
// nf-cmgg/vivar samplesheet
//
Expand Down Expand Up @@ -209,6 +246,7 @@ class PreprocessingObserver extends PipelineObserver {
'library': sampleData.get('library', null),
'sex': sampleData.get('sex', 'U'),
'exomecnv_batch': (sampleData.get('library', null) as String) + '_' + sampleData.get('sex', 'U'),
'yield': -1
]
}

Expand Down
Loading