changeset 23:fd15cf620d5d draft

planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_bdss_client commit 3d2a2c46f10b7f00a36771d2a0fc334d2c177730-dirty
author mingchen0919
date Sun, 15 Oct 2017 00:50:10 -0400
parents 89cc5b026494
children a1c0ebd05f2f
files bdss_client.Rmd bdss_client_sra.Rmd bdss_client_sra.xml
diffstat 3 files changed, 17 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/bdss_client.Rmd	Sat Oct 14 22:59:06 2017 -0400
+++ b/bdss_client.Rmd	Sun Oct 15 00:50:10 2017 -0400
@@ -41,7 +41,7 @@
 # loop through SRA accessions to download and extract reads.
 for(url in urls) {
     print(url)
-    bdss_command = paste0('/tool_deps/_conda/bin/bdss transfer --destination read_files_directory -u ', url)
+    bdss_command = paste0('/main/sites/galaxy/galaxy/tools/_conda/bin/bdss transfer --destination read_files_directory -u ', url)
     print(bdss_command)
     print(system(bdss_command, intern = TRUE))
 }
--- a/bdss_client_sra.Rmd	Sat Oct 14 22:59:06 2017 -0400
+++ b/bdss_client_sra.Rmd	Sun Oct 15 00:50:10 2017 -0400
@@ -46,7 +46,7 @@
                  substr(id, 1, 3), '/',
                  substr(id, 1, 6), '/', id, '/', id, '.sra')
     # download sra file with bdss
-    bdss_command = paste0('/tool_deps/_conda/bin/bdss transfer -u ', url)
+    bdss_command = paste0('/main/sites/galaxy/galaxy/tools/_conda/bin/bdss transfer -u ', url)
     system(bdss_command, intern = TRUE)
     # convert .sra to .fastq/.fasta
     if('FORMAT' == 'fasta') {
@@ -68,7 +68,7 @@
                  substr(id, 1, 3), '/',
                  substr(id, 1, 6), '/', id, '/', id, '.sra')
     # download sra file with bdss
-    bdss_command = paste0('/tool_deps/_conda/bin/bdss transfer -u ', url)
+    bdss_command = paste0('/main/sites/galaxy/galaxy/tools/_conda/bin/bdss transfer -u ', url)
     system(bdss_command, intern = TRUE)
     # convert .sra to .fastq/.fasta
     if('FORMAT' == 'fasta') {
@@ -79,9 +79,9 @@
     cat('----convert SRA to fastq/fasta------\n')
     command_stdout = system(command, intern = TRUE)
     print(command_stdout)
-    if(length(command_stdout) < 3) {
+    if(!(paste0(id, '_2.FORMAT') %in% list.files('pe_read_files_directory'))) {
       # this is not a paired end SRA file. The corresponding file will be deleted.
-      cat(paste0(id, 'is not paired end SRA, the corresponding fastq/fasta file will deleted.'))
+      cat(paste0(id, ' is not paired end SRA, the corresponding fastq/fasta file will deleted.'))
       system(paste0('rm pe_read_files_directory/', id, '_1.*'), intern = TRUE)
     }
     
@@ -95,8 +95,10 @@
 cat('-----Renaming files------\n')
 # rename files for paired end reads
 old_files = paste0('./pe_read_files_directory/', list.files('./pe_read_files_directory'))
+print(old_files)
 new_files = gsub('_1', '_forward', old_files)
 new_files = gsub('_2', '_reverse', new_files)
+print(new_files)
 file.rename(old_files, new_files)
 ```
 
--- a/bdss_client_sra.xml	Sat Oct 14 22:59:06 2017 -0400
+++ b/bdss_client_sra.xml	Sun Oct 15 00:50:10 2017 -0400
@@ -10,7 +10,8 @@
         <requirement type="package" version="1.95_4.8">r-rcurl</requirement>
     </requirements>
     <description>
-        Download data with BDSS client and generate list (single end SRA data) and list:paired dataset collection (paired end SRA data).
+        Download data with BDSS client and generate list (single end SRA data) and list:paired dataset collection
+        (paired end SRA data).
     </description>
     <stdio>
         <!--All stderr are redirected to a file. "XXX" is used to match with nothing-->
@@ -35,10 +36,10 @@
         ]]>
     </command>
     <inputs>
-        <param type="text" name="sra_ids_se" area="true" size="5x25" label="SRR/DRR/ERR accessions of single end SRA" optional="false"
-               help="A list of SRR/DRR/ERR accessions separated by comma or space. e.g. SRR6077558,ERR343809"/>
-        <param type="text" name="sra_ids_pe" area="true" size="5x25" label="SRR/DRR/ERR accessions of paired end SRA" optional="false"
-               help="A list of SRR/DRR/ERR accessions separated by comma or space. e.g. ERR2105526"/>
+        <param type="text" name="sra_ids_se" area="true" size="5x25" label="SRR/DRR/ERR accessions of single end SRA"
+               help="A list of SRR/DRR/ERR accessions separated by comma or space. e.g. SRR039885"/>
+        <param type="text" name="sra_ids_pe" area="true" size="5x25" label="SRR/DRR/ERR accessions of paired end SRA"
+               help="A list of SRR/DRR/ERR accessions separated by comma or space. e.g. ERR1679739"/>
         <param type="boolean" name="format" truevalue="fastq" falsevalue="fasta" checked="true"
                label="output files in fastq (Yes) or fasta (No)?"/>
         <param type="boolean" name="echo" truevalue="TRUE" falsevalue="FALSE" checked="false"
@@ -48,11 +49,13 @@
         <data format="html" name="report" label="BDSS client report"/>
         <!--list dataset collection for single end SRA data-->
         <collection type="list" name="list_collection" label="BDSS download data (single end reads)">
-            <discover_datasets pattern="__name_and_ext__" directory="se_read_files_directory" />
+            <discover_datasets pattern="__name_and_ext__" directory="se_read_files_directory"/>
         </collection>
         <!--list:paired dataset collection for paired end SRA data-->
         <collection type="list:paired" name="list:paired_collection" label="BDSS download data (paired end reads)">
-            <discover_datasets pattern="(?P&lt;identifier_0&gt;[^_]+)_(?P&lt;identifier_1&gt;[^_]+)\.(?P&lt;ext&gt;[^\._]+)?" directory="pe_read_files_directory" />
+            <discover_datasets
+                    pattern="(?P&lt;identifier_0&gt;[^_]+)_(?P&lt;identifier_1&gt;[^_]+)\.(?P&lt;ext&gt;[^\._]+)?"
+                    directory="pe_read_files_directory"/>
         </collection>
         <data format="txt" name="sink_message" label="Warnings and Errors" from_work_dir="warnings_and_errors.txt"/>
     </outputs>