Previous changeset 1:2a16413ec60d (2018-01-30) Next changeset 3:d79ed3ec25fe (2018-05-06) |
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/edger commit 910ffba48cb5f981aad1e00b77056bbbec7f9617 |
modified:
edger.R edger.xml |
added:
test-data/out_rscript.txt |
removed:
test-data/edgeR_Mut-WT.tsv test-data/edgeR_Mut-WT_2fact.tsv test-data/edgeR_Mut-WT_2fact_anno.tsv test-data/edgeR_Mut-WT_anno.tsv test-data/edgeR_Mut-WT_filt.tsv test-data/edgeR_WT-Mut.tsv test-data/edgeR_WT-Mut_2fact_anno.tsv test-data/edgeR_normcounts.tsv test-data/edgeR_normcounts_anno.tsv |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 edger.R --- a/edger.R Tue Jan 30 04:07:08 2018 -0500 +++ b/edger.R Thu Apr 19 17:26:38 2018 -0400 |
[ |
@@ -486,9 +486,9 @@ sumStatus <- summary(status) # Collect counts for differential expression - upCount[i] <- sumStatus["Up"] - downCount[i] <- sumStatus["Down"] - flatCount[i] <- sumStatus["NotSig"] + upCount[i] <- sumStatus["Up", ] + downCount[i] <- sumStatus["Down", ] + flatCount[i] <- sumStatus["NotSig", ] # Write top expressions table top <- topTags(res, n=Inf, sort.by="PValue") |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 edger.xml --- a/edger.xml Tue Jan 30 04:07:08 2018 -0500 +++ b/edger.xml Thu Apr 19 17:26:38 2018 -0400 |
[ |
b'@@ -1,10 +1,11 @@\n-<tool id="edger" name="edgeR" version="3.20.7.0">\n+<tool id="edger" name="edgeR" version="3.20.7.1">\n <description>\n Perform differential expression of count data\n </description>\n \n <requirements>\n <requirement type="package" version="3.20.7">bioconductor-edger</requirement>\n+ <requirement type="package" version="3.34.9">bioconductor-limma</requirement>\n <requirement type="package" version="0.2.15">r-rjson</requirement>\n <requirement type="package" version="1.20.0">r-getopt</requirement>\n <requirement type="package" version="1.4.30">r-statmod</requirement>\n@@ -13,7 +14,7 @@\n </requirements>\n \n <version_command><![CDATA[\n-echo $(R --version | grep version | grep -v GNU)", edgeR version" $(R --vanilla --slave -e "library(edgeR); cat(sessionInfo()\\$otherPkgs\\$edgeR\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", scales version" $(R --vanilla --slave -e "library(scales); cat(sessionInfo()\\$otherPkgs\\$scales\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", rjson version" $(R --vanilla --slave -e "library(rjson); cat(sessionInfo()\\$otherPkgs\\$rjson\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", getopt version" $(R --vanilla --slave -e "library(getopt); cat(sessionInfo()\\$otherPkgs\\$getopt\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")\n+echo $(R --version | grep version | grep -v GNU)", edgeR version" $(R --vanilla --slave -e "library(edgeR); cat(sessionInfo()\\$otherPkgs\\$edgeR\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", limma version" $(R --vanilla --slave -e "library(limma); cat(sessionInfo()\\$otherPkgs\\$limma\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", scales version" $(R --vanilla --slave -e "library(scales); cat(sessionInfo()\\$otherPkgs\\$scales\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", rjson version" $(R --vanilla --slave -e "library(rjson); cat(sessionInfo()\\$otherPkgs\\$rjson\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", getopt version" $(R --vanilla --slave -e "library(getopt); cat(sessionInfo()\\$otherPkgs\\$getopt\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")\n ]]></version_command>\n \n <command detect_errors="exit_code"><![CDATA[\n@@ -94,6 +95,10 @@\n \n &&\n cp \'$outReport.files_path\'/*.tsv output_dir/\n+\n+#if $out.rscript:\n+ && cp \'$__tool_directory__/edger.R\' \'$rscript\'\n+#end if\n ]]></command>\n \n <inputs>\n@@ -222,6 +227,7 @@\n label="Output Normalised Counts Table?"\n help="Output a file containing the normalised counts, these are in log2 counts per million (logCPM). Default: No">\n </param>\n+ <param name="rscript" type="boolean" truevalue="True" falsevalue="False" checked="False" label="Output Rscript?" help="If this option is set to Yes, the Rscript used will be provided as a text file in the output. Default: No"/>\n <param name="rdaOption" type="boolean" truevalue="1" falsevalue="0" checked="false"\n label="Output RData file?"\n help="Output all the data used by R to construct the plots and tables, can be loaded into R. A link to the RData file will be provided in the HTML report. Default: No">\n@@ -259,6 +265,9 @@\n <collection name="outTables" type="list" label="${tool.name} on ${on_string}: Tables">\n <discover_datasets pattern="(?P<name>.+)\\.tsv$" format="tabular" directory="output_dir" visible="false" />\n </collection>\n+ <data name="rscript" format="txt" label="${tool.name} on ${on_string}: Rscript">\n+ <filter>out[\'rscript\']</filter>\n+ </data>\n </outputs>\n \n <tests>\n@@ -278,8 +287,18 @@\n </repeat>\n <param name="normalisationOption" value="TMM" />\n <output_collection name="outTables" count="2">\n- <element name="edgeR_Mut-WT" ftype="tabular" file="edgeR_Mut-WT.tsv" />\n- <element name="edgeR_WT-Mut" ftype="tabular" file="edgeR_WT-Mut.tsv" />\n+ '..b' -438,9 +484,24 @@\n </repeat>\n <param name="normCounts" value="true" />\n <output_collection name="outTables" count="3">\n- <element name="edgeR_Mut-WT" ftype="tabular" file="edgeR_Mut-WT_2fact_anno.tsv" />\n- <element name="edgeR_WT-Mut" ftype="tabular" file="edgeR_WT-Mut_2fact_anno.tsv" />\n- <element name="edgeR_normcounts" ftype="tabular" file="edgeR_normcounts_anno.tsv" />\n+ <element name="edgeR_Mut-WT" ftype="tabular" >\n+ <assert_contents>\n+ <has_text_matching expression="EntrezID.*Symbol.*logFC.*logCPM.*F.*PValue.*FDR" />\n+ <has_text_matching expression="11304.*Abca4.*0.4584" />\n+ </assert_contents>\n+ </element>\n+ <element name="edgeR_WT-Mut" ftype="tabular" >\n+ <assert_contents>\n+ <has_text_matching expression="logFC.*logCPM.*F.*PValue.*FDR" />\n+ <has_text_matching expression="11304.*Abca4.*-0.4584" />\n+ </assert_contents>\n+ </element>\n+ <element name="edgeR_normcounts" ftype="tabular" >\n+ <assert_contents>\n+ <has_text_matching expression="Mut1.*Mut2.*Mut3.*WT1.*WT2.*WT3" />\n+ <has_text_matching expression="11304.*Abca4.*15.7535" />\n+ </assert_contents>\n+ </element>\n </output_collection>\n </test>\n <!-- Ensure filtering on CPM in Mnimum Samples works -->\n@@ -469,7 +530,13 @@\n </assert_contents>\n </output>\n <output_collection name="outTables" count="1" >\n- <element name="edgeR_Mut-WT" ftype="tabular" file="edgeR_Mut-WT_filt.tsv" />\n+ <element name="edgeR_Mut-WT" ftype="tabular" >\n+ <assert_contents>\n+ <has_text_matching expression="GeneID.*logFC.*logCPM.*F.*PValue.*FDR" />\n+ <has_text_matching expression="11304.*0.4568" />\n+ <not_has_text text="-0.0682" />\n+ </assert_contents>\n+ </element>\n </output_collection>\n </test>\n <!-- Ensure filtering on Count in Minmum Samples works -->\n@@ -497,7 +564,14 @@\n </assert_contents>\n </output>\n <output_collection name="outTables" count="1" >\n- <element name="edgeR_Mut-WT" ftype="tabular" file="edgeR_Mut-WT_filt.tsv" />\n+ <element name="edgeR_Mut-WT" ftype="tabular" >\n+ <assert_contents>\n+ <has_text_matching expression="GeneID.*logFC.*logCPM.*F.*PValue.*FDR" />\n+ <has_text_matching expression="11304.*0.4568" />\n+ <not_has_text text="-0.0682" />\n+ </assert_contents>\n+ </element>\n+\n </output_collection>\n </test>\n <!-- Ensure filtering on Total Count works -->\n@@ -527,7 +601,13 @@\n </assert_contents>\n </output>\n <output_collection name="outTables" count="1" >\n- <element name="edgeR_Mut-WT" ftype="tabular" file="edgeR_Mut-WT_filt.tsv" />\n+ <element name="edgeR_Mut-WT" ftype="tabular" >\n+ <assert_contents>\n+ <has_text_matching expression="GeneID.*logFC.*logCPM.*F.*PValue.*FDR" />\n+ <has_text_matching expression="11304.*0.4568" />\n+ <not_has_text text="-0.0682" />\n+ </assert_contents>\n+ </element>\n </output_collection>\n </test>\n </tests>\n@@ -716,6 +796,7 @@\n Optionally, under **Output Options** you can choose to output\n \n * a normalised counts table\n+ * the R script used by this tool\n * an RData file\n \n -----\n' |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/edgeR_Mut-WT.tsv --- a/test-data/edgeR_Mut-WT.tsv Tue Jan 30 04:07:08 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -"GeneID" "logFC" "logCPM" "F" "PValue" "FDR" -"11304" 0.458203001410391 15.530162861746 32.6285109553746 6.943370724917e-06 4.1660224349502e-05 -"11287" 0.188840644104212 17.6536729774735 20.5671667733158 0.000135453949597801 0.000406361848793403 -"11298" -0.138359578382475 17.6815280107154 10.8470695851279 0.00306012801564425 0.00612025603128849 -"11303" -0.0561156581317604 17.8897677663033 1.50815092591008 0.231329593888878 0.346994390833318 -"11305" -0.0579340818829784 18.1615839598046 1.09689306676368 0.305382540289637 0.366459048347564 -"11302" -0.0682406105165454 10.0898264751075 0.137130529665157 0.884266488139469 0.884266488139469 |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/edgeR_Mut-WT_2fact.tsv --- a/test-data/edgeR_Mut-WT_2fact.tsv Tue Jan 30 04:07:08 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -"GeneID" "logFC" "logCPM" "F" "PValue" "FDR" -"11287" 0.189281291475186 17.6499778192954 198.646314971919 7.90598427634242e-09 4.74359056580545e-08 -"11298" -0.13798041694802 17.6843133699537 96.2224552671758 4.15830411749776e-06 1.24749123524933e-05 -"11304" 0.458490715244216 15.526484673111 14.5864146735617 0.00244295799161999 0.00488591598323999 -"11303" -0.0560600217169691 17.8909334307093 6.53006937817236 0.0442859767053646 0.0664289650580469 -"11305" -0.0585095825423414 18.1629882429457 1.07140336604322 0.32103822810743 0.385245873728915 -"11302" -0.0716631320244627 10.0898336653124 0.376796260569999 0.878304702615846 0.878304702615846 |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/edgeR_Mut-WT_2fact_anno.tsv --- a/test-data/edgeR_Mut-WT_2fact_anno.tsv Tue Jan 30 04:07:08 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -"EntrezID" "Symbol" "GeneName" "Chr" "Length" "logFC" "logCPM" "F" "PValue" "FDR" -11287 "Pzp" "pregnancy zone protein" 6 4681 0.189281947498313 17.6499778192954 198.646315096405 7.90598424818915e-09 4.74359054891349e-08 -11298 "Aanat" "arylalkylamine N-acetyltransferase" 11 1455 -0.137980416947824 17.6843133699537 96.2224553233548 4.15830411749738e-06 1.24749123524921e-05 -11304 "Abca4" "ATP-binding cassette, sub-family A (ABC1), member 4" 3 7248 0.45849071524422 15.526484673111 14.5864146737822 0.00244295799149183 0.00488591598298366 -11303 "Abca1" "ATP-binding cassette, sub-family A (ABC1), member 1" 4 10260 -0.0560600215744048 17.8909334307093 6.53006938009001 0.0442859767053567 0.066428965058035 -11305 "Abca2" "ATP-binding cassette, sub-family A (ABC1), member 2" 2 8061 -0.0585095828508861 18.1629882429457 1.07140336564628 0.321038228193371 0.385245873832045 -11302 "Aatk" "apoptosis-associated tyrosine kinase" 11 5743 -0.0716631320197652 10.0898336653124 0.376796260576849 0.878304702615839 0.878304702615839 |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/edgeR_Mut-WT_anno.tsv --- a/test-data/edgeR_Mut-WT_anno.tsv Tue Jan 30 04:07:08 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -"EntrezID" "Symbol" "GeneName" "Chr" "Length" "logFC" "logCPM" "F" "PValue" "FDR" -11304 "Abca4" "ATP-binding cassette, sub-family A (ABC1), member 4" 3 7248 0.458203001410391 15.530162861746 32.6285109553746 6.943370724917e-06 4.1660224349502e-05 -11287 "Pzp" "pregnancy zone protein" 6 4681 0.188840644104212 17.6536729774735 20.5671667733158 0.000135453949597801 0.000406361848793403 -11298 "Aanat" "arylalkylamine N-acetyltransferase" 11 1455 -0.138359578382475 17.6815280107154 10.8470695851279 0.00306012801564425 0.00612025603128849 -11303 "Abca1" "ATP-binding cassette, sub-family A (ABC1), member 1" 4 10260 -0.0561156581317604 17.8897677663033 1.50815092591008 0.231329593888878 0.346994390833318 -11305 "Abca2" "ATP-binding cassette, sub-family A (ABC1), member 2" 2 8061 -0.0579340818829784 18.1615839598046 1.09689306676368 0.305382540289637 0.366459048347564 -11302 "Aatk" "apoptosis-associated tyrosine kinase" 11 5743 -0.0682406105165454 10.0898264751075 0.137130529665157 0.884266488139469 0.884266488139469 |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/edgeR_Mut-WT_filt.tsv --- a/test-data/edgeR_Mut-WT_filt.tsv Tue Jan 30 04:07:08 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,6 +0,0 @@ -"GeneID" "logFC" "logCPM" "F" "PValue" "FDR" -"11287" 0.187201149217925 17.6526225386971 165.500659651998 5.18054239620105e-10 2.59027119810053e-09 -"11298" -0.140077523013286 17.6838446963123 82.0496288033128 2.92613742709898e-06 7.31534356774746e-06 -"11304" 0.456820345055957 15.5288695886958 25.2675517854784 6.46433259176098e-05 0.00010773887652935 -"11303" -0.0578468398229744 17.8912127135125 5.26103367901545 0.0384341523491632 0.048042690436454 -"11305" -0.0593023205976883 18.1634104549086 0.864302521617601 0.363623540536245 0.363623540536245 |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/edgeR_WT-Mut.tsv --- a/test-data/edgeR_WT-Mut.tsv Tue Jan 30 04:07:08 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -"GeneID" "logFC" "logCPM" "F" "PValue" "FDR" -"11304" -0.458203001410391 15.530162861746 32.6285109553746 6.943370724917e-06 4.1660224349502e-05 -"11287" -0.188840644104212 17.6536729774735 20.5671667733158 0.000135453949597801 0.000406361848793403 -"11298" 0.138359578382475 17.6815280107154 10.8470695851279 0.00306012801564425 0.00612025603128849 -"11303" 0.0561156581317604 17.8897677663033 1.50815092591008 0.231329593888878 0.346994390833318 -"11305" 0.0579340818829784 18.1615839598046 1.09689306676368 0.305382540289637 0.366459048347564 -"11302" 0.0682406105165454 10.0898264751075 0.137130529665157 0.884266488139469 0.884266488139469 |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/edgeR_WT-Mut_2fact_anno.tsv --- a/test-data/edgeR_WT-Mut_2fact_anno.tsv Tue Jan 30 04:07:08 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -"EntrezID" "Symbol" "GeneName" "Chr" "Length" "logFC" "logCPM" "F" "PValue" "FDR" -11287 "Pzp" "pregnancy zone protein" 6 4681 -0.189281947498313 17.6499778192954 198.646315096405 7.90598424818915e-09 4.74359054891349e-08 -11298 "Aanat" "arylalkylamine N-acetyltransferase" 11 1455 0.137980416947824 17.6843133699537 96.2224553233548 4.15830411749738e-06 1.24749123524921e-05 -11304 "Abca4" "ATP-binding cassette, sub-family A (ABC1), member 4" 3 7248 -0.45849071524422 15.526484673111 14.5864146737822 0.00244295799149183 0.00488591598298366 -11303 "Abca1" "ATP-binding cassette, sub-family A (ABC1), member 1" 4 10260 0.0560600215744048 17.8909334307093 6.53006938009001 0.0442859767053567 0.066428965058035 -11305 "Abca2" "ATP-binding cassette, sub-family A (ABC1), member 2" 2 8061 0.0585095828508861 18.1629882429457 1.07140336564628 0.321038228193371 0.385245873832045 -11302 "Aatk" "apoptosis-associated tyrosine kinase" 11 5743 0.0716631320197652 10.0898336653124 0.376796260576849 0.878304702615839 0.878304702615839 |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/edgeR_normcounts.tsv --- a/test-data/edgeR_normcounts.tsv Tue Jan 30 04:07:08 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -"GeneID" "Mut1" "Mut2" "Mut3" "WT1" "WT2" "WT3" -"11287" 17.7717801382127 17.7103668584544 17.7656984572699 17.6075444214943 17.5078565133576 17.5637960881114 -"11298" 17.6504754185442 17.55181161064 17.6142553019077 17.7726234935868 17.6985800110028 17.7597848438911 -"11302" 9.64041099082467 9.8551982993804 9.60469198931215 9.52851478148979 9.97869946791847 9.78190633986473 -"11303" 17.8772707356813 17.7864068634935 17.9114914356477 17.9125147871338 17.8772755854201 17.9551530504837 -"11304" 15.753577788623 15.8510977521242 15.6551142861549 15.3537170121875 15.2168364952853 15.3165751633072 -"11305" 18.0400277799982 18.1407817993511 18.2048423497925 18.1807759635442 18.1818136580236 18.2026167343562 |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/edgeR_normcounts_anno.tsv --- a/test-data/edgeR_normcounts_anno.tsv Tue Jan 30 04:07:08 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -"EntrezID" "Symbol" "GeneName" "Chr" "Length" "Mut1" "Mut2" "Mut3" "WT1" "WT2" "WT3" -11287 "Pzp" "pregnancy zone protein" 6 4681 17.7717801382127 17.7103668584544 17.7656984572699 17.6075444214943 17.5078565133576 17.5637960881114 -11298 "Aanat" "arylalkylamine N-acetyltransferase" 11 1455 17.6504754185442 17.55181161064 17.6142553019077 17.7726234935868 17.6985800110028 17.7597848438911 -11302 "Aatk" "apoptosis-associated tyrosine kinase" 11 5743 9.64041099082467 9.8551982993804 9.60469198931215 9.52851478148979 9.97869946791847 9.78190633986473 -11303 "Abca1" "ATP-binding cassette, sub-family A (ABC1), member 1" 4 10260 17.8772707356813 17.7864068634935 17.9114914356477 17.9125147871338 17.8772755854201 17.9551530504837 -11304 "Abca4" "ATP-binding cassette, sub-family A (ABC1), member 4" 3 7248 15.753577788623 15.8510977521242 15.6551142861549 15.3537170121875 15.2168364952853 15.3165751633072 -11305 "Abca2" "ATP-binding cassette, sub-family A (ABC1), member 2" 2 8061 18.0400277799982 18.1407817993511 18.2048423497925 18.1807759635442 18.1818136580236 18.2026167343562 |
b |
diff -r 2a16413ec60d -r a1634a9c2ee1 test-data/out_rscript.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/out_rscript.txt Thu Apr 19 17:26:38 2018 -0400 |
[ |
b'@@ -0,0 +1,718 @@\n+# This tool takes in a matrix of feature counts as well as gene annotations and\n+# outputs a table of top expressions as well as various plots for differential\n+# expression analysis\n+#\n+# ARGS: htmlPath", "R", 1, "character" -Path to html file linking to other outputs\n+# outPath", "o", 1, "character" -Path to folder to write all output to\n+# filesPath", "j", 2, "character" -JSON list object if multiple files input\n+# matrixPath", "m", 2, "character" -Path to count matrix\n+# factFile", "f", 2, "character" -Path to factor information file\n+# factInput", "i", 2, "character" -String containing factors if manually input \n+# annoPath", "a", 2, "character" -Path to input containing gene annotations\n+# contrastData", "C", 1, "character" -String containing contrasts of interest\n+# cpmReq", "c", 2, "double" -Float specifying cpm requirement\n+# cntReq", "z", 2, "integer" -Integer specifying minimum total count requirement\n+# sampleReq", "s", 2, "integer" -Integer specifying cpm requirement\n+# normCounts", "x", 0, "logical" -String specifying if normalised counts should be output \n+# rdaOpt", "r", 0, "logical" -String specifying if RData should be output\n+# lfcReq", "l", 1, "double" -Float specifying the log-fold-change requirement \n+# pValReq", "p", 1, "double" -Float specifying the p-value requirement\n+# pAdjOpt", "d", 1, "character" -String specifying the p-value adjustment method \n+# normOpt", "n", 1, "character" -String specifying type of normalisation used \n+# robOpt", "b", 0, "logical" -String specifying if robust options should be used \n+# lrtOpt", "t", 0, "logical" -String specifying whether to perform LRT test instead \n+#\n+# OUT: \n+# MDS Plot \n+# BCV Plot\n+# QL Plot\n+# MD Plot\n+# Expression Table\n+# HTML file linking to the ouputs\n+# Optional:\n+# Normalised counts Table\n+# RData file\n+#\n+# Author: Shian Su - registertonysu@gmail.com - Jan 2014\n+# Modified by: Maria Doyle - Oct 2017 (some code taken from the DESeq2 wrapper)\n+\n+# Record starting time\n+timeStart <- as.character(Sys.time())\n+\n+# setup R error handling to go to stderr\n+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )\n+\n+# we need that to not crash galaxy with an UTF8 error on German LC settings.\n+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")\n+\n+# Load all required libraries\n+library(methods, quietly=TRUE, warn.conflicts=FALSE)\n+library(statmod, quietly=TRUE, warn.conflicts=FALSE)\n+library(splines, quietly=TRUE, warn.conflicts=FALSE)\n+library(edgeR, quietly=TRUE, warn.conflicts=FALSE)\n+library(limma, quietly=TRUE, warn.conflicts=FALSE)\n+library(scales, quietly=TRUE, warn.conflicts=FALSE)\n+library(getopt, quietly=TRUE, warn.conflicts=FALSE)\n+\n+################################################################################\n+### Function Delcaration\n+################################################################################\n+# Function to sanitise contrast equations so there are no whitespaces\n+# surrounding the arithmetic operators, leading or trailing whitespace\n+sanitiseEquation <- function(equation) {\n+ equation <- gsub(" *[+] *", "+", equation)\n+ equation <- gsub(" *[-] *", "-", equation)\n+ equation <- gsub(" *[/] *", "/", equation)\n+ equation <- gsub(" *[*] *", "*", equation)\n+ equation <- gsub("^\\\\s+|\\\\s+$", "", equation)\n+ return(equation)\n+}\n+\n+# Function to sanitise group information\n+sanitiseGroups <- function(string) {\n+ string <- gsub(" *[,] *", ",", string)\n+ string <- gsub("^\\\\s+|\\\\s+$", "", string)\n+ return(string)\n+}\n+\n+# Function to change periods to whitespace in a string\n+unmake.names <- function(string) {\n+ string <- gsub(".", " ", string, fixed=TRUE)'..b'ck floppy disc icon associated history item to download ")\n+cata("all files.</p>\\n")\n+cata("<p>.tsv files can be viewed in Excel or any spreadsheet program.</p>\\n")\n+\n+cata("<h4>Additional Information</h4>\\n")\n+cata("<ul>\\n")\n+\n+if (filtCPM || filtSmpCount || filtTotCount) {\n+ if (filtCPM) {\n+ tempStr <- paste("Genes without more than", opt$cmpReq,\n+ "CPM in at least", opt$sampleReq, "samples are insignificant",\n+ "and filtered out.")\n+ } else if (filtSmpCount) {\n+ tempStr <- paste("Genes without more than", opt$cntReq,\n+ "counts in at least", opt$sampleReq, "samples are insignificant",\n+ "and filtered out.")\n+ } else if (filtTotCount) {\n+ tempStr <- paste("Genes without more than", opt$cntReq,\n+ "counts, after summing counts for all samples, are insignificant",\n+ "and filtered out.")\n+ }\n+\n+ ListItem(tempStr)\n+ filterProp <- round(filteredCount/preFilterCount*100, digits=2)\n+ tempStr <- paste0(filteredCount, " of ", preFilterCount," (", filterProp,\n+ "%) genes were filtered out for low expression.")\n+ ListItem(tempStr)\n+}\n+ListItem(opt$normOpt, " was the method used to normalise library sizes.")\n+if (wantLRT) {\n+ ListItem("The edgeR likelihood ratio test was used.")\n+} else {\n+ if (wantRobust) {\n+ ListItem("The edgeR quasi-likelihood test was used with robust settings (robust=TRUE with estimateDisp and glmQLFit).")\n+ } else {\n+ ListItem("The edgeR quasi-likelihood test was used.")\n+ }\n+}\n+if (opt$pAdjOpt!="none") {\n+ if (opt$pAdjOpt=="BH" || opt$pAdjOpt=="BY") {\n+ tempStr <- paste0("MD-Plot highlighted genes are significant at FDR ",\n+ "of ", opt$pValReq," and exhibit log2-fold-change of at ", \n+ "least ", opt$lfcReq, ".")\n+ ListItem(tempStr)\n+ } else if (opt$pAdjOpt=="holm") {\n+ tempStr <- paste0("MD-Plot highlighted genes are significant at adjusted ",\n+ "p-value of ", opt$pValReq," by the Holm(1979) ",\n+ "method, and exhibit log2-fold-change of at least ", \n+ opt$lfcReq, ".")\n+ ListItem(tempStr)\n+ }\n+} else {\n+ tempStr <- paste0("MD-Plot highlighted genes are significant at p-value ",\n+ "of ", opt$pValReq," and exhibit log2-fold-change of at ", \n+ "least ", opt$lfcReq, ".")\n+ ListItem(tempStr)\n+}\n+cata("</ul>\\n")\n+\n+cata("<h4>Summary of experimental data:</h4>\\n")\n+\n+cata("<p>*CHECK THAT SAMPLES ARE ASSOCIATED WITH CORRECT GROUP(S)*</p>\\n")\n+\n+cata("<table border=\\"1\\" cellpadding=\\"3\\">\\n")\n+cata("<tr>\\n")\n+TableHeadItem("SampleID")\n+TableHeadItem(names(factors)[1], " (Primary Factor)")\n+\n+ if (ncol(factors) > 1) {\n+ for (i in names(factors)[2:length(names(factors))]) {\n+ TableHeadItem(i)\n+ }\n+ cata("</tr>\\n")\n+ }\n+\n+for (i in 1:nrow(factors)) {\n+ cata("<tr>\\n")\n+ TableHeadItem(row.names(factors)[i])\n+ for (j in 1:ncol(factors)) {\n+ TableItem(as.character(unmake.names(factors[i, j])))\n+ }\n+ cata("</tr>\\n")\n+}\n+cata("</table>")\n+\n+for (i in 1:nrow(linkData)) {\n+ if (grepl("session_info", linkData$Link[i])) {\n+ HtmlLink(linkData$Link[i], linkData$Label[i])\n+ }\n+}\n+\n+cata("<table border=\\"0\\">\\n")\n+cata("<tr>\\n")\n+TableItem("Task started at:"); TableItem(timeStart)\n+cata("</tr>\\n")\n+cata("<tr>\\n")\n+TableItem("Task ended at:"); TableItem(timeEnd)\n+cata("</tr>\\n")\n+cata("<tr>\\n")\n+TableItem("Task run time:"); TableItem(timeTaken)\n+cata("<tr>\\n")\n+cata("</table>\\n")\n+\n+cata("</body>\\n")\n+cata("</html>")\n' |