Pool together acoustic data and run acoustic analyses
You can have the sections listed here, for instance:
Raven annotation files
# consolidate raven annotation files
txt_cnsd <- consolidate(file.ext = "\\.txt", path = "./data/raw/acoustic_data/annotations",
dest.path = "./data/raw/annotations")
rav_dat <- imp_raven(path = "./data/raw/annotations", warbler.format = TRUE,
name.from.file = TRUE, ext.case = "lower")
rav_dat$sound.files <- gsub(".Table.1.selections-1|.Table.1.selections-2|.Table.1.selections-3|.Table.1.selections 2|.Table.1.selections kopyası|",
"", rav_dat$sound.files)
rav_dat$sound.files <- gsub("XC19878 - Lechuza de Célebes - Tyto rosenbergii_.wav",
"XC19878_Tyto_rosenbergii.wav", rav_dat$sound.files)
rav_dat$species_subsp <- gsub(".wav", "", sapply(strsplit(rav_dat$sound.files,
split = " - "), "[", 3))
rav_dat$species_subsp[is.na(rav_dat$species_subsp)] <- "Tyto rosenbergii"
rav_dat$species <- sapply(strsplit(rav_dat$species, split = " "),
function(x) paste(x[1:2], collapse = " "))
rav_dat <- check_sels(X = rav_dat, path = "./data/raw/recordings",
fix.selec = TRUE)
# remove empty selections
rav_dat <- rav_dat[rav_dat$check.res %in% c("exceeds sound file length",
"OK"), ]
write.csv(rav_dat, "./data/processed/pooled_annotations.csv", row.names = FALSE)
Sound files
rav_dat <- read.csv("./data/processed/pooled_annotations.csv")
sound_files <- list.files(path = "./data/raw/recordings", pattern = "wav$",
ignore.case = TRUE)
sound_files <- gsub("XC19878_Tyto_rosenbergii.wav", "XC19878 - Lechuza de Célebes - Tyto rosenbergii.wav",
sound_files)
485 sound files
459 annotated sound files
200 annotated species
Sound files without annotations:
setdiff(sound_files, unique(rav_dat$sound.files)) |
---|
XC148756 - Mochuelo de Blewitt - Athene blewitti.wav |
XC181902 - Búho moro - Asio capensis tingitanus.wav |
XC19878 - Lechuza de Célebes - Tyto rosenbergii.wav |
XC213140 - Mochuelo de jungla - Glaucidium radiatum radiatum.wav |
XC219348 - Búho nival - Bubo scandiacus.wav |
XC224191 - Mochuelo de Ceilán - Glaucidium castanotum.wav |
XC24649 - Nínox de las Bismarck - Ninox variegata.wav |
XC266575 - Autillo de Santa Catarina - Megascops sanctaecatarinae.wav |
XC339388 - Autillo cariblanco sureño - Ptilopsis granti.wav |
XC359935 - Autillo de la Sonda - Otus lempiji.wav |
XC389327 - Búho lechoso - Bubo lacteus.wav |
XC395248 - Mochuelo canela - Aegolius harrisii.wav |
XC396729 - Autillo oriental - Otus sunia distans.wav |
XC398052 - Mochuelo de El Cabo - Glaucidium capense.wav |
XC399155 - Mochuelo sijú - Glaucidium siju.wav |
XC399713 - Autillo cubano - Margarobyas lawrencii.wav |
XC422495 - Autillo japonés - Otus semitorques.wav |
XC425572 - Autillo africano - Otus senegalensis.wav |
XC454247 - Mochuelo europeo - Athene noctua.wav |
XC46011 - Mochuelo canela - Aegolius harrisii.wav |
XC473545 - Nínox pardo - Ninox scutulata hirsuta.wav |
XC477655 - Búho africano - Bubo africanus.wav |
XC498643 - Cárabo norteamericano - Strix varia.wav |
XC505343 - Mochuelo amazónico - Glaucidium hardyi.wav |
XC537771 - Cárabo ocelado - Strix ocellata.wav |
XC53918 - Autillo de la Mantanani - Otus mantananensis mantananensis.wav |
XC589306 - Búho americano - Bubo virginianus.wav |
Problematic annotations:
rav_dat[rav_dat$check.res != "OK" & !duplicated(rav_dat[, c("sound.files",
"check.res")]), c("sound.files", "check.res")]
sound.files | check.res |
---|---|
XC142493 - Nínox rojizo - Ninox rufa.wav | exceeds sound file length |
Species with recordings but without annotations:
sound_files <- data.frame(sound_files)
sound_files$species_subsp <- gsub(".wav", "", sapply(strsplit(sound_files$sound_files,
split = " - "), "[", 3))
sound_files$species <- sapply(strsplit(sound_files$species, split = " "),
function(x) paste(x[1:2], collapse = " "))
as.data.frame(setdiff(sound_files$species, unique(rav_dat$species)))
setdiff(sound_files\(species, unique(rav_dat\)species)) |
---|
Ninox variegata |
Margarobyas lawrencii |
Session information
## R version 4.1.0 (2021-05-18)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.2 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
## LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3
##
## locale:
## [1] LC_CTYPE=pt_BR.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=es_CR.UTF-8 LC_COLLATE=pt_BR.UTF-8
## [5] LC_MONETARY=es_CR.UTF-8 LC_MESSAGES=pt_BR.UTF-8
## [7] LC_PAPER=es_CR.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=es_CR.UTF-8 LC_IDENTIFICATION=C
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] Rraven_1.0.13 warbleR_1.1.28 NatureSounds_1.0.4
## [4] seewave_2.2.0 tuneR_1.4.1 xaringanExtra_0.7.0
## [7] rprojroot_2.0.3 formatR_1.11 knitr_1.41
## [10] kableExtra_1.3.4
##
## loaded via a namespace (and not attached):
## [1] xfun_0.36 bslib_0.4.2 pbapply_1.6-0 colorspace_2.0-3
## [5] vctrs_0.5.1 htmltools_0.5.4 viridisLite_0.4.1 yaml_2.3.6
## [9] utf8_1.2.2 rlang_1.0.6 jquerylib_0.1.4 pillar_1.8.1
## [13] glue_1.6.2 uuid_1.1-0 lifecycle_1.0.3 stringr_1.5.0
## [17] munsell_0.5.0 rvest_1.0.3 evaluate_0.19 fastmap_1.1.0
## [21] fftw_1.0-7 parallel_4.1.0 fansi_1.0.3 highr_0.10
## [25] Rcpp_1.0.9 scales_1.2.1 cachem_1.0.6 webshot_0.5.4
## [29] jsonlite_1.8.4 systemfonts_1.0.4 rjson_0.2.21 digest_0.6.31
## [33] stringi_1.7.8 dtw_1.23-1 cli_3.5.0 tools_4.1.0
## [37] bitops_1.0-7 magrittr_2.0.3 sass_0.4.4 proxy_0.4-27
## [41] RCurl_1.98-1.9 tibble_3.1.8 pkgconfig_2.0.3 MASS_7.3-54
## [45] xml2_1.3.3 rmarkdown_2.19 svglite_2.1.0 httr_1.4.4
## [49] rstudioapi_0.14 R6_2.5.1 signal_0.7-7 compiler_4.1.0