changeset 2:2b0a6af4b85e draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/isoformswitchanalyzer commit d00628bfc2ac36914885e0941a2b4453ca0bff9a
author iuc
date Wed, 24 May 2023 06:06:54 +0000
parents 2c4e879a81cf
children 02a77166b29a
files IsoformSwitchAnalyzeR.R isoformswitchanalyzer.xml macros.xml
diffstat 3 files changed, 81 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/IsoformSwitchAnalyzeR.R	Fri May 19 21:26:00 2023 +0000
+++ b/IsoformSwitchAnalyzeR.R	Wed May 24 06:06:54 2023 +0000
@@ -34,6 +34,7 @@
                     type = "integer",
                     help = "Read length (required for stringtie)")
 parser$add_argument("--annotation", required = FALSE, help = "Annotation")
+parser$add_argument("--stringtieAnnotation", required = FALSE, help = "Stringtie annotation")
 parser$add_argument("--transcriptome", required = FALSE, help = "Transcriptome")
 parser$add_argument(
   "--fixStringTieAnnotationProblem",
@@ -105,6 +106,12 @@
   help = "Overwrite IF values"
 )
 parser$add_argument(
+  "--removeNonConvensionalChr",
+  required = FALSE,
+  action = "store_true",
+  help = "Remove non-conventional chromosomes"
+)
+parser$add_argument(
   "--reduceToSwitchingGenes",
   required = FALSE,
   action = "store_true",
@@ -348,27 +355,50 @@
   )
 
   if (args$toolSource == "stringtie") {
-    SwitchList <- importRdata(
-      isoformCountMatrix   = quantificationData$counts,
-      isoformRepExpression = quantificationData$abundance,
-      designMatrix         = myDesign,
-      isoformExonAnnoation = args$annotation,
-      isoformNtFasta       = args$transcriptome,
-      showProgress = TRUE,
-      fixStringTieAnnotationProblem = args$fixStringTieAnnotationProblem
-    )
+    if (!is.null(args$stringtieAnnotation)) {
+      SwitchList <- importRdata(
+        isoformCountMatrix   = quantificationData$counts,
+        isoformRepExpression = quantificationData$abundance,
+        designMatrix         = myDesign,
+        removeNonConvensionalChr = args$removeNonConvensionalChr,
+        isoformExonAnnoation = args$stringtieAnnotation,
+        isoformNtFasta       = args$transcriptome,
+        addAnnotatedORFs = FALSE,
+        showProgress = TRUE,
+        fixStringTieAnnotationProblem = args$fixStringTieAnnotationProblem
+      )
+
+      SwitchList <- addORFfromGTF(
+        SwitchList,
+        removeNonConvensionalChr = args$removeNonConvensionalChr,
+        pathToGTF = args$annotation
+      )
+
+    } else {
+      SwitchList <- importRdata(
+        isoformCountMatrix   = quantificationData$counts,
+        isoformRepExpression = quantificationData$abundance,
+        designMatrix         = myDesign,
+        removeNonConvensionalChr = args$removeNonConvensionalChr,
+        isoformNtFasta       = args$transcriptome,
+        isoformExonAnnoation = args$annotation,
+        showProgress = TRUE,
+        fixStringTieAnnotationProblem = args$fixStringTieAnnotationProblem
+      )
+    }
+
   } else {
     SwitchList <- importRdata(
       isoformCountMatrix   = quantificationData$counts,
       isoformRepExpression = quantificationData$abundance,
       designMatrix         = myDesign,
+      removeNonConvensionalChr = args$removeNonConvensionalChr,
       isoformExonAnnoation = args$annotation,
       isoformNtFasta       = args$transcriptome,
       showProgress = TRUE
     )
   }
 
-
   geneCountMatrix <- extractGeneExpression(
     SwitchList,
     extractCounts = TRUE,
@@ -484,16 +514,18 @@
     showProgress = TRUE,
   )
 
-  SwitchList <- analyzeNovelIsoformORF(
-    SwitchList,
-    analysisAllIsoformsWithoutORF = TRUE,
-    minORFlength = args$minORFlength,
-    orfMethod = args$orfMethod,
-    PTCDistance = args$PTCDistance,
-    startCodons = "ATG",
-    stopCodons = c("TAA", "TAG", "TGA"),
-    showProgress = TRUE,
-  )
+  if (!is.null(args$stringtieAnnotation)) {
+    SwitchList <- analyzeNovelIsoformORF(
+      SwitchList,
+      analysisAllIsoformsWithoutORF = TRUE,
+      minORFlength = args$minORFlength,
+      orfMethod = args$orfMethod,
+      PTCDistance = args$PTCDistance,
+      startCodons = "ATG",
+      stopCodons = c("TAA", "TAG", "TGA"),
+      showProgress = TRUE,
+    )
+  }
 
   ### Extract Sequences
   SwitchList <- extractSequence(
--- a/isoformswitchanalyzer.xml	Fri May 19 21:26:00 2023 +0000
+++ b/isoformswitchanalyzer.xml	Wed May 24 06:06:54 2023 +0000
@@ -42,6 +42,15 @@
                 #end if
                 #if $functionMode.tool_source.selector == 'stringtie'
                     #set $filename = 't_data.ctab'
+                    #if $functionMode.tool_source.novoisoforms.selector == 'novel'
+                        #if $functionMode.tool_source.novoisoforms.stringtieAnnotation.is_of_type("gtf.gz"):
+                            ln -s '${$functionMode.tool_source.novoisoforms.stringtieAnnotation}' './stringtie_annotation.gtf.gz' &&
+                            #set $stringtie_annotation = './stringtie_annotation.gtf.gz' 
+                        #else
+                            ln -s '${$functionMode.tool_source.novoisoforms.stringtieAnnotation}' './stringtie_annotation.gtf' &&
+                            #set $stringtie_annotation = './stringtie_annotation.gtf' 
+                        #end if
+                    #end if
                 #else
                     #set $filename = 'quant.sf'
                 #end if
@@ -61,8 +70,12 @@
                     --parentDir './input_files'
                     --annotation $annotation
                     --transcriptome $transcriptome
+                    $functionMode.removeNonConvensionalChr
                     --toolSource $functionMode.tool_source.selector
                     #if $functionMode.tool_source.selector == 'stringtie'
+                        #if $functionMode.tool_source.novoisoforms.selector == 'novel'
+                            --stringtieAnnotation $stringtie_annotation
+                        #end if
                         --readLength $functionMode.tool_source.averageSize
                         $functionMode.tool_source.fixStringTieAnnotationProblem
                     #end if
@@ -224,18 +237,32 @@
                         <param argument="fixStringTieAnnotationProblem" type="boolean" truevalue="--fixStringTieAnnotationProblem" falsevalue="" checked="true" 
                             label="Fix StringTie annotation problem" help="This option will automatically try and correct some of the annoation problems created when 
                                 doing transcript assembly (unassigned transcripts and merged genes)" />
+                        <conditional name="novoisoforms">
+                            <param name="selector" type="select" label="Analsys mode">
+                                <option value="novel">Include novel isoforms in analysis</option>
+                                <option value="reference">Reference-only analysis</option>
+                            </param>
+                            <when value="novel">
+                                <param name="stringtieAnnotation" type="data" format="gtf,gtf.gz" label="Annotation generated by StringTie merge" 
+                                    help="The merged GTF is used to recalculate expression estimates using the merged, novel transcripts." />
+                            </when>
+                            <when value="reference"/>
+                        </conditional>
                     </when>
                 </conditional>
-                <param name="genomeAnnotation" type="data" format="gtf,gtf.gz" label="Genome annotation (GTF)" 
+                <param name="genomeAnnotation" type="data" format="gtf,gtf.gz" label="Genome annotation" 
                     help="It is used to integrate the coding sequence (CDS) regions from in the GTF file as the ORF regions used by IsoformSwitchAnalyzeR." />
                 <param name="transcriptome" type="data" format="fasta,fasta.gz" label="Transcriptome" 
                     help="Please note this different from a fasta file with the sequences of the entire genome." />
+                <param argument="removeNonConvensionalChr" type="boolean" truevalue="--removeNonConvensionalChr" falsevalue="" checked="false" 
+                    label="Remove non-conventional chromosomes" help="These regions are typically used to annotate regions that cannot be associated to a specific region." />
                 <param name="countFiles" type="select" label="Generate count matrix files" help="If IsoformSwitchAnalyzeR is used for fixing Stringtie annotation
                     problem, it can generate count files for analyzing differential expression with DESeq2 (when selecting collection) or CEMiTool (when secting the expression matrix format).">
                     <option value="disabled">Disabled</option>
                     <option value="collection">Collection of count files</option>
                     <option value="matrix">Expression matrix</option>
                 </param>
+
             </when>
 
             <!--WRAPPER FIRST STEP SECTION-->
--- a/macros.xml	Fri May 19 21:26:00 2023 +0000
+++ b/macros.xml	Wed May 24 06:06:54 2023 +0000
@@ -1,6 +1,6 @@
 <macros>
     <token name="@TOOL_VERSION@">1.20.0</token>
-    <token name="@SUFFIX_VERSION@">1</token>
+    <token name="@SUFFIX_VERSION@">2</token>
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="@TOOL_VERSION@">bioconductor-isoformswitchanalyzer</requirement>