Skip to content

Commit c78424c

Browse files
authored
Merge pull request #16 from Juke34/edit_site_tool_option
add option to select the edit site detection tool. the default is red…
2 parents 786fb94 + 0f11c0f commit c78424c

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

rain.nf

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ params.library_type = "auto" // can be 'U', 'IU', 'MU', 'OU', 'ISF', 'ISR', 'MSF
2626
params.bam_library_type = null // can be 'U', 'IU', 'MU', 'OU', 'ISF', 'ISR', 'MSF', 'MSR', 'OSF', 'OSR', 'auto' - see https://github.com/Juke34/AliNe for more information
2727

2828
// Edit counting params
29+
edit_site_tools = ["reditools2", "jacusa2", "sapin"]
30+
params.edit_site_tool = "reditools2"
2931
params.edit_threshold = 1
3032
params.aggregation_mode = "all"
3133

@@ -82,6 +84,7 @@ def helpMSG() {
8284
8385
Optional input:
8486
--aligner Aligner to use [default: $params.aligner]
87+
--edit_site_tool Tool used for detecting edited sites. Default: $params.edit_site_tool
8588
--read_type Type of reads among this list ${read_type_allowed} (default: short_paired)
8689
--library_type Set the library_type of your fastq reads (default: auto). In auto mode salmon will guess the library type for each sample. [ 'U', 'IU', 'MU', 'OU', 'ISF', 'ISR', 'MSF', 'MSR', 'OSF', 'OSR', 'auto' ]
8790
--bam_library_type Set the library_type of your BAM reads (default: null). When using BAM you must set a library type: [ 'U', 'IU', 'MU', 'OU', 'ISF', 'ISR', 'MSF', 'MSR', 'OSF', 'OSR', 'auto' ]
@@ -112,6 +115,9 @@ Alignment Parameters
112115
aline_profiles : ${params.aline_profiles}
113116
aligner : ${params.aligner}
114117
reads_library_type : ${params.library_type}
118+
119+
Edited Site Detection Parameters
120+
edit_site_tool : ${params.edit_site_tool}
115121
edit_threshold : ${params.edit_threshold}
116122
117123
Report Parameters
@@ -162,6 +168,11 @@ if( !params.aligner ){
162168
}
163169
}
164170

171+
// Check edit site tool params. Does not accept list yet, but validates input.
172+
if ( ! (params.edit_site_tool in edit_site_tools) ){
173+
exit 1, "Error: <${it}> edit site tool not accepted, please provide a tool in this list ${edit_site_tools}.\n"
174+
}
175+
165176
// check RAIN profile - /!\ profile must be sync with AliNe profile as much as possible
166177
if (
167178
workflow.profile.contains('singularity') ||
@@ -440,14 +451,25 @@ workflow rain {
440451
samtools_index(bamutil_clipoverlap.out.tuple_sample_clipoverbam)
441452
// report with multiqc
442453
// multiqc(logs.collect(),params.multiqc_config)
443-
// Detect RNA editing with reditools2
444-
reditools2(samtools_index.out.tuple_sample_bam_bamindex, genome, params.region)
445454
// Create a fasta index file of the reference genome
446455
samtools_fasta_index(genome)
447-
jacusa2(samtools_index.out.tuple_sample_bam_bamindex, samtools_fasta_index.out.tuple_fasta_fastaindex)
448-
sapin(bamutil_clipoverlap.out.tuple_sample_clipoverbam, genome)
449-
normalize_gxf(annnotation)
450-
pluviometer(reditools2.out.tuple_sample_serial_table, normalize_gxf.out.gff, "reditools")
456+
457+
// Select site detection tool
458+
switch (params.edit_site_tool) {
459+
case "jacusa2":
460+
jacusa2(samtools_index.out.tuple_sample_bam_bamindex, samtools_fasta_index.out.tuple_fasta_fastaindex)
461+
break
462+
case "sapin":
463+
sapin(bamutil_clipoverlap.out.tuple_sample_clipoverbam, genome)
464+
break
465+
case "reditools2":
466+
reditools2(samtools_index.out.tuple_sample_bam_bamindex, genome, params.region)
467+
normalize_gxf(annnotation)
468+
pluviometer(reditools2.out.tuple_sample_serial_table, normalize_gxf.out.gff, "reditools")
469+
break
470+
default:
471+
exit(1, "Wrong edit site tool was passed")
472+
}
451473
}
452474

453475

0 commit comments

Comments
 (0)