Mercurial > repos > mingchen0919 > rmarkdown_bdss_client_main
comparison bdss_client.Rmd @ 0:1cc0ed4567e1 draft default tip
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_bdss_client_main commit d9ab791a7ce12362dc6e28c0a518a3f23dd581fe-dirty
author | mingchen0919 |
---|---|
date | Tue, 17 Oct 2017 14:07:18 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1cc0ed4567e1 |
---|---|
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 error=TRUE | |
15 ) | |
16 ``` | |
17 | |
18 # Command line arguments | |
19 | |
20 ```{r 'command line arguments'} | |
21 str(opt) | |
22 ``` | |
23 | |
24 # BDSS configuration file | |
25 | |
26 First, we create a bdss configuration file `bdss.cfg` in the current directory. | |
27 | |
28 ```{r} | |
29 system('echo "[metadata_repository]" > bdss.cfg') | |
30 system('echo url=http://bdss.bioinfo.wsu.edu/ >> bdss.cfg') | |
31 ``` | |
32 | |
33 # Download data | |
34 | |
35 ```{r 'download and extract reads'} | |
36 # create a directory to store read files | |
37 dir.create('read_files_directory') | |
38 # download and extract reads | |
39 urls = strsplit(gsub(',', ' ', 'URLS'), ' ')[[1]] | |
40 urls = urls[urls != ''] | |
41 # loop through SRA accessions to download and extract reads. | |
42 for(url in urls) { | |
43 print(url) | |
44 bdss_command = paste0('/tool_deps/_conda/bin/bdss transfer --destination read_files_directory -u ', url) | |
45 print(bdss_command) | |
46 print(system(bdss_command, intern = TRUE)) | |
47 } | |
48 # all files that need to be saved should be moved to REPORT_DIR directory | |
49 # print(system('mv read_files_directory REPORT_DIR', intern = TRUE)) | |
50 ``` | |
51 | |
52 |