Skip to content

Commit 283d872

Browse files
Merge pull request #84 from USEPA/83-batch-functions-to-get-experimental-and-predicted-chemical-properties-seem-to-be-swapped
Fixed 'experimental' and 'predicted' batch functions that had been sw…
2 parents 9095af0 + 139fa02 commit 283d872

File tree

1 file changed

+52
-53
lines changed

1 file changed

+52
-53
lines changed

R/chemical-APIs-batch.R

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -875,41 +875,42 @@ get_chem_props_exp_batch <- function(DTXSID = NULL,
875875
indices <- generate_ranges(num_dtxsid)
876876

877877
dt <- data.table::data.table(id = integer(),
878-
dtxsid = character(),
879-
dtxcid = character(),
880878
smiles = character(),
881-
canonQsarSmiles = character(),
882-
genericSubstanceUpdatedAt = character(),
883-
propName = character(),
884-
propCategory = character(),
885-
propDescription = character(),
886-
modelName = character(),
887-
modelId = integer(),
879+
dtxcid = character(),
880+
dtxsid = character(),
888881
sourceName = character(),
889-
sourceDescription = character(),
890-
propValueExperimental = numeric(),
891-
propValueExperimentalString = character(),
892882
propValue = numeric(),
883+
lscitation = character(),
884+
propValueText = character(),
885+
expDetailsPh = integer(),
886+
directUrl = character(),
887+
publicSourceUrl = character(),
888+
propValueId = integer(),
889+
briefCitation = character(),
890+
propName = character(),
893891
propUnit = character(),
894-
propValueString = character(),
895-
propValueError = character(),
896-
adMethod = character(),
897-
adValue = numeric(),
898-
adConclusion = character(),
899-
adReasoning = character(),
900-
adMethodGlobal = character(),
901-
adValueGlobal = numeric(),
902-
adConclusionGlobal = character(),
903-
adReasoningGlobal = character(),
904-
hasQmrf = logical(),
905-
qmrfUrl = character()
906-
)
892+
propValueOriginal = character(),
893+
expDetailsTemperatureC = integer(),
894+
expDetailsPressureMmhg = integer(),
895+
publicSourceName = character(),
896+
publicSourceOriginalUrl = character(),
897+
expDetailsSpeciesLatin = character(),
898+
expDetailsResponseSite = character(),
899+
expDetailsSpeciesCommon = character(),
900+
sourceDescription = character(),
901+
publicSourceDescription = character(),
902+
expDetailsSpeciesSupercategory = character(),
903+
publicSourceOriginalDescription = character(),
904+
publicSourceOriginalName = character(),
905+
lsDoi = character(),
906+
lsName = character(),
907+
dataset = character())
907908

908909
for (i in seq_along(indices)){
909910

910911
# print(paste('The current index is i =', i, 'out of', length(indices)))
911912

912-
response <- httr::POST(url = paste0(Server, '/property/predicted/search/by-dtxsid/'),
913+
response <- httr::POST(url = paste0(Server, '/property/experimental/search/by-dtxsid/'),
913914
httr::add_headers(.headers = c(
914915
'Accept' = 'application/json',
915916
'Content-Type' = 'application/json',
@@ -980,42 +981,40 @@ get_chem_props_pred_batch <- function(DTXSID = NULL,
980981
indices <- generate_ranges(num_dtxsid)
981982

982983
dt <- data.table::data.table(id = integer(),
983-
smiles = character(),
984-
dtxcid = character(),
985984
dtxsid = character(),
985+
dtxcid = character(),
986+
smiles = character(),
987+
canonQsarSmiles = character(),
988+
genericSubstanceUpdatedAt = character(),
989+
propName = character(),
990+
propCategory = character(),
991+
propDescription = character(),
992+
modelName = character(),
993+
modelId = integer(),
986994
sourceName = character(),
995+
sourceDescription = character(),
996+
propValueExperimental = numeric(),
997+
propValueExperimentalString = character(),
987998
propValue = numeric(),
988-
lscitation = character(),
989-
propValueText = character(),
990-
expDetailsPh = integer(),
991-
directUrl = character(),
992-
publicSourceUrl = character(),
993-
propValueId = integer(),
994-
briefCitation = character(),
995-
propName = character(),
996999
propUnit = character(),
997-
propValueOriginal = character(),
998-
expDetailsTemperatureC = integer(),
999-
expDetailsPressureMmhg = integer(),
1000-
publicSourceName = character(),
1001-
publicSourceOriginalUrl = character(),
1002-
expDetailsSpeciesLatin = character(),
1003-
expDetailsResponseSite = character(),
1004-
expDetailsSpeciesCommon = character(),
1005-
sourceDescription = character(),
1006-
publicSourceDescription = character(),
1007-
expDetailsSpeciesSupercategory = character(),
1008-
publicSourceOriginalDescription = character(),
1009-
publicSourceOriginalName = character(),
1010-
lsDoi = character(),
1011-
lsName = character(),
1012-
dataset = character())
1000+
propValueString = character(),
1001+
propValueError = character(),
1002+
adMethod = character(),
1003+
adValue = numeric(),
1004+
adConclusion = character(),
1005+
adReasoning = character(),
1006+
adMethodGlobal = character(),
1007+
adValueGlobal = numeric(),
1008+
adConclusionGlobal = character(),
1009+
adReasoningGlobal = character(),
1010+
hasQmrf = logical(),
1011+
qmrfUrl = character())
10131012

10141013
for (i in seq_along(indices)){
10151014

10161015
# print(paste('The current index is i =', i, 'out of', length(indices)))
10171016

1018-
response <- httr::POST(url = paste0(Server, '/property/experimental/search/by-dtxsid/'),
1017+
response <- httr::POST(url = paste0(Server, '/property/predicted/search/by-dtxsid/'),
10191018
httr::add_headers(.headers = c(
10201019
'Accept' = 'application/json',
10211020
'Content-Type' = 'application/json',

0 commit comments

Comments
 (0)