Mercurial > repos > mingchen0919 > rmarkdown_bdss_client
comparison 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 |
comparison
equal
deleted
inserted
replaced
6:415ebc9016da | 7:efb1938c3020 |
---|---|
1 --- | |
2 title: 'Download with BDSS client' | |
3 output: | |
4 html_document: | |
5 number_sections: true | |
6 toc: true | |
7 theme: cosmo | |
8 highlight: tango | |
9 --- | |
10 | |
11 ```{r setup, include=FALSE, warning=FALSE, message=FALSE} | |
12 knitr::opts_chunk$set( | |
13 echo = ECHO | |
14 ) | |
15 ``` | |
16 | |
17 # Command line arguments | |
18 | |
19 ```{r 'command line arguments'} | |
20 str(opt) | |
21 ``` | |
22 | |
23 # BDSS configuration file | |
24 | |
25 First, we create a bdss configuration file `bdss.cfg` in the current directory. | |
26 | |
27 ```{r} | |
28 system('echo "[metadata_repository]" > bdss.cfg') | |
29 system('echo url=http://bdss.bioinfo.wsu.edu/ >> bdss.cfg') | |
30 ``` | |
31 | |
32 # Download and extract reads | |
33 | |
34 ```{r 'download and extract reads'} | |
35 # create a directory to store read files | |
36 dir.create('read_files_directory') | |
37 # download and extract reads | |
38 urls = strsplit(gsub(',', ' ', 'URLS'), ' ')[[1]] | |
39 urls = urls[urls != ''] | |
40 # loop through SRA accessions to download and extract reads. | |
41 for(url in urls) { | |
42 bdss_command = paste0('/tool_deps/_conda/bin/bdss transfer -u ', url) | |
43 print(system(bdss_command, intern = TRUE)) | |
44 } | |
45 move_files_command = 'find . -type f -print0 | xargs -0 mv -t ./read_files_directory' | |
46 print(system(move_files_command, intern = TRUE)) | |
47 ``` | |
48 | |
49 * `fastq-dump` command | |
50 ```{r} | |
51 print(command) | |
52 ``` | |
53 | |
54 * `command line stdout` | |
55 | |
56 ```{r} | |
57 system(command = command, intern = TRUE) | |
58 ``` | |
59 |