forked from Sage-Bionetworks/ampAdScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixFileAnnotationsFeb2015.R
26 lines (21 loc) · 1.05 KB
/
fixFileAnnotationsFeb2015.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require(synapseClient)
synapseLogin()
res <- synQuery('select name, dataType, dataSubType, study, modifiedOn, platform, tissueType, organism, disease from file where center=="Rush-Broad" and projectId=="syn2580853"')
for (i in 1:nrow(res)){
a <- synGet(res$file.id[i],downloadFile=FALSE)
annotValue(a,'center') <- 'Broad-Rush'
a <- synStore(a,forceVersion=FALSE)
}
res <- synQuery('select name, dataType, dataSubType, study, modifiedOn, platform, tissueType, organism, disease from file where organism=="human" and projectId=="syn2580853"')
for (i in 1:nrow(res)){
a <- synGet(res$file.id[i],downloadFile=FALSE)
annotValue(a,'organism') <- 'Homo sapiens'
cat(i,res$file.name[i],'\n')
a <- synStore(a,forceVersion=FALSE)
}
res <- synQuery('select name, dataType, dataSubType, study, modifiedOn, platform, tissueType, organism, disease from file where organism=="mouse" and projectId=="syn2580853"')
for (i in 1:nrow(res)){
a <- synGet(res$file.id[i],downloadFile=FALSE)
annotValue(a,'organism') <- 'Mus musculus'
a <- synStore(a,forceVersion=FALSE)
}