@@ -28,10 +28,10 @@ annotation_rule <- function(outputFrom, which = c("format_as", "annotate_as", "t
28
28
" featureCounts" = list (format_as = function (x ) { " txt" }, annotate_as = " annotate_quantified_expression" , template = " bts:ProcessedExpressionTemplate" ),
29
29
" SAMtools" = list (format_as = function (x ) { substring(x , nchar(x )- 2 , nchar(x )) }, annotate_as = " annotate_aligned_reads" , template = " bts:ProcessedAlignedReadsTemplate" ),
30
30
" CNVkit" = list (format_as = function (x ) { substring(x , nchar(x )- 2 , nchar(x )) }, annotate_as = " annotate_called_variants" , template = " bts:ProcessedVariantCallsTemplate" ),
31
- " DeepVariant" = list (format_as = function (x ) { " vcf" }, annotate_as = " annotate_called_variants" , template = " bts:ProcessedVariantCallsTemplate" ),
32
- " Strelka2" = list (format_as = function (x ) { " vcf" }, annotate_as = " annotate_called_variants" , template = " bts:ProcessedVariantCallsTemplate" ),
33
- " Mutect2" = list (format_as = function (x ) { " vcf" }, annotate_as = " annotate_called_variants" , template = " bts:ProcessedVariantCallsTemplate" ),
34
- " FreeBayes" = list (format_as = function (x ) { " vcf" }, annotate_as = " annotate_called_variants" , template = " bts:ProcessedVariantCallsTemplate" ))
31
+ " DeepVariant" = list (format_as = function (x ) { ifelse(grepl( " tbi$ " , x ), " tbi " , " vcf" ) }, annotate_as = " annotate_called_variants" , template = " bts:ProcessedVariantCallsTemplate" ),
32
+ " Strelka2" = list (format_as = function (x ) { ifelse(grepl( " tbi$ " , x ), " tbi " , " vcf" ) }, annotate_as = " annotate_called_variants" , template = " bts:ProcessedVariantCallsTemplate" ),
33
+ " Mutect2" = list (format_as = function (x ) { ifelse(grepl( " tbi$ " , x ), " tbi " , " vcf" ) }, annotate_as = " annotate_called_variants" , template = " bts:ProcessedVariantCallsTemplate" ),
34
+ " FreeBayes" = list (format_as = function (x ) { ifelse(grepl( " tbi$ " , x ), " tbi " , " vcf" ) }, annotate_as = " annotate_called_variants" , template = " bts:ProcessedVariantCallsTemplate" ))
35
35
36
36
switch (
37
37
which ,
@@ -230,7 +230,7 @@ map_sample_output_sarek <- function(syn_out,
230
230
231
231
index_fun <- function (x ) {
232
232
caller_index <- grep(" cnvkit|deepvariant|strelka|mutect|freebayes" , x , ignore.case = TRUE )[1 ]
233
- if (! length(caller_index )) stop(" Issue with figuring out sample output organization. Is there non-standard output?" )
233
+ if (! length(caller_index )) stop(" Issue with inferring sample output organization. Is this non-standard output?" )
234
234
file_index <- length(x )
235
235
if ((file_index - caller_index ) == 1 ) {
236
236
file_index - 2 # i.e. `VariantCalling/<SAMPLE>/<CALLER>`
@@ -243,7 +243,10 @@ map_sample_output_sarek <- function(syn_out,
243
243
# For nf-sarek tumor somatic variant calling, sample references tumor vs normal from same indiv
244
244
# The sample assigned to the processed data is the tumor sample
245
245
result [, sample : = path_extract(path , index_fun = index_fun )]
246
- if (grepl(" _vs_" , first(result $ output_name ))) result [, sample : = gsub(" _vs.*" , " " , sample )]
246
+ if (.output %in% c(" Strelka2" , " FreeBayes" , " Mutect2" ) && any(grepl(" _vs_" , result $ sample ))) {
247
+ message(" - Somatic data present." )
248
+ result [, sample : = gsub(" _vs.*" , " " , sample )]
249
+ }
247
250
248
251
results [[.output ]] <- result
249
252
setattr(results [[.output ]], " outputFrom" , .output )
@@ -450,6 +453,8 @@ annotate_called_variants <- function(metadata,
450
453
" AnnotatedSomaticVariants"
451
454
} else if (! grepl(" _vs_" , name ) && format == " maf" ) {
452
455
" AnnotatedGermlineVariants"
456
+ } else if (format == " tbi" ) {
457
+ " dataIndex"
453
458
} else if (format %in% c(" cns" , " cnn" , " cnr" , " bed" , " pdf" , " png" )) {
454
459
" CopyNumberVariants"
455
460
} else {
@@ -504,7 +509,6 @@ annotate_with_samtools_stats <- function(meta,
504
509
# ' Wrapper for all steps to get manifest for processed product
505
510
# '
506
511
# ' @inheritParams map_sample_io
507
- # ' @param
508
512
# ' @param workflow_link Workflow link.
509
513
# ' @export
510
514
# ' @return List `manifest` with manifests for each processed dataset,
0 commit comments