view bdss_client.Rmd @ 10:b7171118a078 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:31:47 -0400
parents efb1938c3020
children bfc6133f3a2b
line wrap: on
line source

---
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)
    system(bdss_command, intern = TRUE)
}
move_files_command = 'find . -type f -print0 | xargs -0 mv -t ./read_files_directory'
system(move_files_command, intern = TRUE)
```

* `fastq-dump` command
```{r}
print(command)
```

* `command line stdout`

```{r}
system(command = command, intern = TRUE)
```