Skip to content

Commit e3db2f2

Browse files
author
Madison Raposa
committed
Zenodo to R Download
1 parent 625d3a7 commit e3db2f2

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Zenodo_to_R_Updated.R

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
get_amplicon <- function(amplicon) {
2+
#put R code inside here
3+
4+
library(dplyr)
5+
library(tidyverse)
6+
7+
## Read in the table from zenodo using the url
8+
sample_att = read.csv(
9+
'https://zenodo.org/record/3774043/files/SRA%20Sample%20Worksheet.csv'
10+
)
11+
12+
amp = filter(sample_att, samp_mat_process == amplicon)
13+
amp
14+
15+
## Pull the column containing the sample names.fastq
16+
amp %>% pull(sample_title.fastq)
17+
18+
## Change rbcl into a vector
19+
amp_name <- as.vector(amp$sample_title.fastq)
20+
21+
## Create the urls for the files using the paste function and download the files
22+
urls = vector()
23+
for (x in 1:length(amp_name)) {
24+
urls[x] = paste('https://zenodo.org/record/3736457/files/',
25+
amp_name[x],
26+
sep = '')
27+
download.file(urls[x], amp_name[x])
28+
}
29+
30+
return()
31+
}
32+
33+
get_amplicon('rbcLa_amplicon')
34+
35+
36+
get_amplicon("ITS2_amplicon")

0 commit comments

Comments
 (0)