Mercurial > repos > iuc > isoformswitchanalyzer
comparison IsoformSwitchAnalyzeR.R @ 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 |
comparison
equal
deleted
inserted
replaced
1:2c4e879a81cf | 2:2b0a6af4b85e |
---|---|
32 parser$add_argument("--readLength", | 32 parser$add_argument("--readLength", |
33 required = FALSE, | 33 required = FALSE, |
34 type = "integer", | 34 type = "integer", |
35 help = "Read length (required for stringtie)") | 35 help = "Read length (required for stringtie)") |
36 parser$add_argument("--annotation", required = FALSE, help = "Annotation") | 36 parser$add_argument("--annotation", required = FALSE, help = "Annotation") |
37 parser$add_argument("--stringtieAnnotation", required = FALSE, help = "Stringtie annotation") | |
37 parser$add_argument("--transcriptome", required = FALSE, help = "Transcriptome") | 38 parser$add_argument("--transcriptome", required = FALSE, help = "Transcriptome") |
38 parser$add_argument( | 39 parser$add_argument( |
39 "--fixStringTieAnnotationProblem", | 40 "--fixStringTieAnnotationProblem", |
40 action = "store_true", | 41 action = "store_true", |
41 required = FALSE, | 42 required = FALSE, |
101 parser$add_argument( | 102 parser$add_argument( |
102 "--overwriteIFvalues", | 103 "--overwriteIFvalues", |
103 required = FALSE, | 104 required = FALSE, |
104 action = "store_true", | 105 action = "store_true", |
105 help = "Overwrite IF values" | 106 help = "Overwrite IF values" |
107 ) | |
108 parser$add_argument( | |
109 "--removeNonConvensionalChr", | |
110 required = FALSE, | |
111 action = "store_true", | |
112 help = "Remove non-conventional chromosomes" | |
106 ) | 113 ) |
107 parser$add_argument( | 114 parser$add_argument( |
108 "--reduceToSwitchingGenes", | 115 "--reduceToSwitchingGenes", |
109 required = FALSE, | 116 required = FALSE, |
110 action = "store_true", | 117 action = "store_true", |
346 colnames(quantificationData$abundance)[-1] | 353 colnames(quantificationData$abundance)[-1] |
347 ) | 354 ) |
348 ) | 355 ) |
349 | 356 |
350 if (args$toolSource == "stringtie") { | 357 if (args$toolSource == "stringtie") { |
351 SwitchList <- importRdata( | 358 if (!is.null(args$stringtieAnnotation)) { |
352 isoformCountMatrix = quantificationData$counts, | 359 SwitchList <- importRdata( |
353 isoformRepExpression = quantificationData$abundance, | 360 isoformCountMatrix = quantificationData$counts, |
354 designMatrix = myDesign, | 361 isoformRepExpression = quantificationData$abundance, |
355 isoformExonAnnoation = args$annotation, | 362 designMatrix = myDesign, |
356 isoformNtFasta = args$transcriptome, | 363 removeNonConvensionalChr = args$removeNonConvensionalChr, |
357 showProgress = TRUE, | 364 isoformExonAnnoation = args$stringtieAnnotation, |
358 fixStringTieAnnotationProblem = args$fixStringTieAnnotationProblem | 365 isoformNtFasta = args$transcriptome, |
359 ) | 366 addAnnotatedORFs = FALSE, |
367 showProgress = TRUE, | |
368 fixStringTieAnnotationProblem = args$fixStringTieAnnotationProblem | |
369 ) | |
370 | |
371 SwitchList <- addORFfromGTF( | |
372 SwitchList, | |
373 removeNonConvensionalChr = args$removeNonConvensionalChr, | |
374 pathToGTF = args$annotation | |
375 ) | |
376 | |
377 } else { | |
378 SwitchList <- importRdata( | |
379 isoformCountMatrix = quantificationData$counts, | |
380 isoformRepExpression = quantificationData$abundance, | |
381 designMatrix = myDesign, | |
382 removeNonConvensionalChr = args$removeNonConvensionalChr, | |
383 isoformNtFasta = args$transcriptome, | |
384 isoformExonAnnoation = args$annotation, | |
385 showProgress = TRUE, | |
386 fixStringTieAnnotationProblem = args$fixStringTieAnnotationProblem | |
387 ) | |
388 } | |
389 | |
360 } else { | 390 } else { |
361 SwitchList <- importRdata( | 391 SwitchList <- importRdata( |
362 isoformCountMatrix = quantificationData$counts, | 392 isoformCountMatrix = quantificationData$counts, |
363 isoformRepExpression = quantificationData$abundance, | 393 isoformRepExpression = quantificationData$abundance, |
364 designMatrix = myDesign, | 394 designMatrix = myDesign, |
395 removeNonConvensionalChr = args$removeNonConvensionalChr, | |
365 isoformExonAnnoation = args$annotation, | 396 isoformExonAnnoation = args$annotation, |
366 isoformNtFasta = args$transcriptome, | 397 isoformNtFasta = args$transcriptome, |
367 showProgress = TRUE | 398 showProgress = TRUE |
368 ) | 399 ) |
369 } | 400 } |
370 | |
371 | 401 |
372 geneCountMatrix <- extractGeneExpression( | 402 geneCountMatrix <- extractGeneExpression( |
373 SwitchList, | 403 SwitchList, |
374 extractCounts = TRUE, | 404 extractCounts = TRUE, |
375 addGeneNames = FALSE, | 405 addGeneNames = FALSE, |
482 onlySigIsoforms = args$onlySigIsoforms, | 512 onlySigIsoforms = args$onlySigIsoforms, |
483 keepIsoformInAllConditions = args$keepIsoformInAllConditions2, | 513 keepIsoformInAllConditions = args$keepIsoformInAllConditions2, |
484 showProgress = TRUE, | 514 showProgress = TRUE, |
485 ) | 515 ) |
486 | 516 |
487 SwitchList <- analyzeNovelIsoformORF( | 517 if (!is.null(args$stringtieAnnotation)) { |
488 SwitchList, | 518 SwitchList <- analyzeNovelIsoformORF( |
489 analysisAllIsoformsWithoutORF = TRUE, | 519 SwitchList, |
490 minORFlength = args$minORFlength, | 520 analysisAllIsoformsWithoutORF = TRUE, |
491 orfMethod = args$orfMethod, | 521 minORFlength = args$minORFlength, |
492 PTCDistance = args$PTCDistance, | 522 orfMethod = args$orfMethod, |
493 startCodons = "ATG", | 523 PTCDistance = args$PTCDistance, |
494 stopCodons = c("TAA", "TAG", "TGA"), | 524 startCodons = "ATG", |
495 showProgress = TRUE, | 525 stopCodons = c("TAA", "TAG", "TGA"), |
496 ) | 526 showProgress = TRUE, |
527 ) | |
528 } | |
497 | 529 |
498 ### Extract Sequences | 530 ### Extract Sequences |
499 SwitchList <- extractSequence( | 531 SwitchList <- extractSequence( |
500 SwitchList, | 532 SwitchList, |
501 onlySwitchingGenes = args$onlySwitchingGenes, | 533 onlySwitchingGenes = args$onlySwitchingGenes, |