Skip to content

Commit 33a5978

Browse files
committed
Adding indirect synonyms via basionym for the BFO backbone
1 parent 67ab614 commit 33a5978

File tree

5 files changed

+28
-0
lines changed

5 files changed

+28
-0
lines changed

data-raw/get_bfo.R

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,34 @@ if (last_updated != last_download) {
147147
data <- rbind.data.frame(data, miss_data1)
148148
}
149149

150+
## adding missing info for synonyms (probably basionyms)
151+
miss_syn <- data$taxonomicStatus %in% "synonym" &
152+
data$acceptedNameUsageID %in% c("", " ", NA) &
153+
!data$originalNameUsageID %in% c("", " ", NA)
154+
if (any(miss_syn)) {
155+
miss_data <- data[miss_syn, ]
156+
originals <- miss_data$originalNameUsageID
157+
accepted.ids <- data[data$taxonID %in% originals, ]
158+
synonym.ids <-
159+
accepted.ids[accepted.ids$taxonomicStatus %in% "synonym" &
160+
!accepted.ids$acceptedNameUsageID %in% c("", " ", NA),]
161+
accepted.ids <-
162+
accepted.ids[accepted.ids$taxonomicStatus %in% "accepted",]
163+
164+
if (dim(accepted.ids)[1] > 0)
165+
miss_data$acceptedNameUsageID <-
166+
accepted.ids$taxonID[match(miss_data$originalNameUsageID, accepted.ids$taxonID)]
167+
168+
if (dim(synonym.ids)[1] > 0) {
169+
rep_ids <- miss_data$acceptedNameUsageID %in% c("", " ", NA)
170+
miss_data$acceptedNameUsageID[rep_ids] <-
171+
synonym.ids$acceptedNameUsageID[match(miss_data$originalNameUsageID[rep_ids],
172+
synonym.ids$taxonID)]
173+
}
174+
data$acceptedNameUsageID[miss_syn] <-
175+
miss_data$acceptedNameUsageID
176+
}
177+
150178
## filtering and standardizing important column names
151179
cols <- c("taxonID", "higherClassification" ,"phylum", "family",
152180
"taxon_name", "scientificNameAuthorship",

data/bfoNamesAlgae.rda

4 Bytes
Binary file not shown.

data/bfoNamesBryophyta.rda

-32 Bytes
Binary file not shown.

data/bfoNamesFungi.rda

80 Bytes
Binary file not shown.

data/bfoNamesTracheophyta.rda

30.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)