@@ -311,7 +311,6 @@ rule isoformswitchanalyzer_diffswitching:
311311 vec = join (workpath , "differential_switching" , batch_id , "{case}_vs_{control}" , "sample_vector.tsv" ),
312312 output :
313313 swt = join (workpath , "differential_switching" , batch_id , "{case}_vs_{control}" , "{case}-{control}_top_isoform_switches.tsv" ),
314-
315314 params :
316315 rname = "diffswitch" ,
317316 outdir = join (workpath , "differential_switching" , batch_id , "{case}_vs_{control}" ),
@@ -340,3 +339,45 @@ rule isoformswitchanalyzer_diffswitching:
340339 --control_group {wildcards.control} \\
341340 --method saturn
342341 """
342+
343+
344+ rule isoformswitchanalyzer_isoformfasta :
345+ """
346+ Data-processing step to write isoform sequences based on the
347+ IsoformSwitchAnalyzeR results. This rule will create a FASTA
348+ file containing the sequence of each transcript of an gene
349+ with a significant isoform switch. So if a gene contains N
350+ transcripts and it had a signficant switching event (based
351+ on the fdr_filter), then the transcript sequences of all
352+ N transcripts will be written to the FASTA file.
353+ @Input:
354+ Differential isoform switching results (indirect-gather-per-contrast),
355+ Splicing annotation file
356+ @Output:
357+ Differential isoform switching results
358+ """
359+ input :
360+ swt = join (workpath , "differential_switching" , batch_id , "{case}_vs_{control}" , "{case}-{control}_top_isoform_switches.tsv" ),
361+ spl = join (workpath , "temp" , "splicing_annotation.tsv" ),
362+ output :
363+ fa = join (workpath , "differential_switching" , batch_id , "{case}_vs_{control}" , "{case}-{control}_top_isoform_switches.fa" ),
364+ params :
365+ rname = "isofasta" ,
366+ pyscript = join (workpath , "workflow" , "scripts" , "isoform_sequences.py" ),
367+ transcripts = quantify_transcripts ,
368+ fdr_filter = 0.1 ,
369+ resources :
370+ mem = allocated ("mem" , "isoformswitchanalyzer_isoformfasta" , cluster ),
371+ time = allocated ("time" , "isoformswitchanalyzer_isoformfasta" , cluster ),
372+ threads : int (allocated ("threads" , "isoformswitchanalyzer_isoformfasta" , cluster ))
373+ container : config ["images" ]["isoformswitchanalyzer" ]
374+ shell : """
375+ # Create the filtered transcripts FASTA file
376+ {params.pyscript} \\
377+ -i {input.swt} \\
378+ -s {input.spl} \\
379+ -t {params.transcripts} \\
380+ -o {output.fa} \\
381+ -f {params.fdr_filter} \\
382+ -d '|'
383+ """
0 commit comments