Mercurial > repos > mingchen0919 > rmarkdown_bdss_client
diff bdss_client.Rmd @ 7:efb1938c3020 draft
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_bdss_client commit ea6df97960569d247d64be1549aa90768c9786f4-dirty
author | mingchen0919 |
---|---|
date | Wed, 11 Oct 2017 13:21:54 -0400 |
parents | |
children | b7171118a078 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bdss_client.Rmd Wed Oct 11 13:21:54 2017 -0400 @@ -0,0 +1,59 @@ +--- +title: 'Download with BDSS client' +output: + html_document: + number_sections: true + toc: true + theme: cosmo + highlight: tango +--- + +```{r setup, include=FALSE, warning=FALSE, message=FALSE} +knitr::opts_chunk$set( + echo = ECHO +) +``` + +# Command line arguments + +```{r 'command line arguments'} +str(opt) +``` + +# BDSS configuration file + +First, we create a bdss configuration file `bdss.cfg` in the current directory. + +```{r} +system('echo "[metadata_repository]" > bdss.cfg') +system('echo url=http://bdss.bioinfo.wsu.edu/ >> bdss.cfg') +``` + +# Download and extract reads + +```{r 'download and extract reads'} +# create a directory to store read files +dir.create('read_files_directory') +# download and extract reads +urls = strsplit(gsub(',', ' ', 'URLS'), ' ')[[1]] +urls = urls[urls != ''] +# loop through SRA accessions to download and extract reads. +for(url in urls) { + bdss_command = paste0('/tool_deps/_conda/bin/bdss transfer -u ', url) + print(system(bdss_command, intern = TRUE)) +} +move_files_command = 'find . -type f -print0 | xargs -0 mv -t ./read_files_directory' +print(system(move_files_command, intern = TRUE)) +``` + +* `fastq-dump` command +```{r} +print(command) +``` + +* `command line stdout` + +```{r} +system(command = command, intern = TRUE) +``` +