<- readxl::read_excel("../Data/Lab3.xlsx")
barometer_dt_raw_2021 <- read.csv("../Data/Lab4.csv") barometer_dt_raw_2021
Cattle barometer
THE ROAD TO A REPRODUCIBLE CATTLE BAROMETER: HAZARDS TO AVOID AND TOOLS TO GET YOU THERE SAFELY
Aim
This tool visualizes pathogen-specific lab results of field samples obtained from cattle over Europe. It shows the historical trend, dynamics and current presence of specific pathogens per area. It holds the potential for early warning and to support decision-making on farm to control infectious diseases, such as antimicrobial use, vaccination, and purchase of animals.
Data preparation
Minimum data requirements
Individual or pooled samples from the respiratory tract of cattle (preferably from ill animals) with the results of diagnostic test for some respiratory pathogens (e.g. Pasteurella multocida, Mycoplasmopsis bovis (previously Mycoplasma bovis), Mannheimia haemolytica, Histophilus somni, Bovine respiratory syncytial virus, Parainfluenza-type 3, and Bovine coronavirus):
Date of sample
Diagnostic sample type (e.g. BAL, swab, lung, ..)
Diagnostic test (e.g. PCR, culture, nanopore sequencing, paired-serum)
Farm identification (anonymized)
Geolocation of farm (e.g. postal code/province, country)
(Breed/production type of animal/herd)
How to handle results?
The result can be either ‘negative’ (0), ‘positive’ (1) or ‘not tested’ (NA):
PCR: when to consider a test results positive or negative will be at the discretion of the laboratory (cutoff values may differ per lab). Dubious test results such as ‘not conclusive’, ‘no test results due to inhibition’, are recommended to file as not tested (NA).
Culture (Pasteurellaceae): it is expected that culture results are either positive (1) or negative (0). For example, when a swab has been cultured on blood agar plates, we assume that P. multocida, M. haemolytica, and Histophilus somni are tested. For example, when only P. multocida is present, the result for that specific sample should be reported as: PM (1), MH (0), HS (0). Dubious test results due to overgrowth by for example Proteus species could be filed as not tested (NA) for all Pasteurellaceae.
Culture (M. bovis): for M. bovis specific culture media are necessary, however, when tested, result can be positive (1) or negative (0). Dubious test results due to overgrowth by fungi could be filed as not tested (NA).
Nanopore sequencing: when to consider a test results positive or negative will be at the discretion of the laboratory (cutoff values may differ per lab).
Data manipulation
Load your data and libraries
For example an excel or csv file:
When you add separate files, combine them:
<- rbind(barometer_dt_raw_2021, barometer_dt_raw_2022) barometer_dt_combined
Load the necessary libraries, which depends on your data(file) and script:
<- c("data.table", "tidyverse", "naniar", "stringr", "readr", "dplyr",
package_list "magrittr", "readxl", "writexl", "sjmisc", "tidyr")
for (pkg in package_list) {
if (pkg %in% rownames(.packages()) == FALSE)
library(pkg, character.only = TRUE)}
{
}
Start wrangling your data
It may be necessary to filter some of your data:
<- barometer_dt_combined %>%
barometer_dt_filter ::filter(SYSTEM %in% c('Respiratory', 'NA')
dplyr
)<- barometer_dt_filter %>%
barometer_dt_filter2 ::filter(MATRIX %in% c('Pleural Fluid', 'Tissue swab', 'Tonsil', 'Trachea', 'Thoracic Fluid',
dplyr'Lung', 'Swab', 'Tissue swab', 'Nasal Swab', 'Nasal Fluid', 'Tissue-Pool',
'Carcass', 'Pooled swab')
) <- barometer_dt_filter2 %>%
barometer_dt_filter3 ::filter(TEST %in% c("PI3V PCR", "PCR M. haemolytica - ARVL", "Mycoplasma bovis (PCR)",
dplyr"PCR H. somni - ARVL", "PCR P. multocida - ARVL", "Miscellaneous Test",
"Routine Culture", "PCR M. bovis - ARVL", "BRSV PCR",
"Culture Growth", "PCR BoCoV", "Mycoplasma bovis (PCR)")
)
Or add rows for pathogens when all results are reported in one field (e.g. sequencing data):
<- barometer_dt_raw %>%
barometer_dt ::mutate(
dplyrHS = ifelse(str_detect(pathogens, "Histophilus somni"), 1, 0),
MH = ifelse(str_detect(pathogens, "Mannheimia haemolytica"), 1, 0),
PM = ifelse(str_detect(pathogens, "Pasteurella multocida"), 1, 0),
BCV = ifelse(str_detect(pathogens, "Bovine coronavirus"), 1, 0),
MB = ifelse(str_detect(pathogens, "Mycoplasmopsis bovis"), 1, 0),
PI3 = ifelse(str_detect(pathogens, "Bovine respirovirus 3"), 1, 0),
BRSV = ifelse(str_detect(pathogens, "Bovine orthopneumovirus"), 1, 0),
)
Or add rows for culture results:
$HS <- ifelse(barometer_dt$Diagnostic_test == "Culture", 0, NA)
barometer_dt$MH <- ifelse(barometer_dt$Diagnostic_test == "Culture", 0, NA)
barometer_dt$PM <- ifelse(barometer_dt$Diagnostic_test == "Culture", 0, NA)
barometer_dt
<- barometer_dt %>%
barometer_dt_culture_wide ::pivot_longer(
tidyrcols = c('PM', 'MH', 'HS'),
names_to = 'Pathogen_culture',
values_to = 'Result_culture'
)
$Pathogen <-
barometer_dt_culture_wideifelse(barometer_dt_culture_wide$Pathogen == "Missing",
$Pathogen_culture,
barometer_dt_culture_wide$Pathogen) barometer_dt_culture_wide
Or need an intermediate table for culture results:
<- data.frame(
df_samples Result = c('OK', 'OK', 'OK', 'OK'),
Parameter_code = c('BAC_AERO','BAC_AERO','BAC_AERO', 'BAC_MYCOPLASMA'),
Diagnostic_test= c('Culture','Culture','Culture', 'Culture'),
Pathogen_identification=c("Pasteurella multocida","Mannheimia haemolytica","Histophilus somni",
'Mycoplasma bovis')
)
Or need to create binary results for PCR & culture
<- barometer_dt_culture_wide %>%
barometer_results ::mutate(
dplyrResult = case_when(
# Positive tests
== 'PCR' &
Diagnostic_test %in% c("Positive", "Weak Positive", "Mycoplasma bovis PCR Positive",
RESULT "Strong Positive") ~ 1,
# Negative tests
== 'PCR' &
Diagnostic_test %in% c("No Pathogen detected", "Negative", "Sterile",
RESULT "No Significant Growth", "No CT",
"Mycoplasma bovis PCR Negative",
"Mixed Non-Significant Bacterial Growth",
"No Significant Growth @48hrs", "No Growth",
"No Pathogen detected", "No RNA detected",
"No DNA detected", "No Virus Detected", "Not Detected") ~ 0,
# Inconclusive tests
== 'PCR' &
Diagnostic_test %in% c("Inconclusive", "Mixed Bacterial Growth", "Mixed Growth",
RESULT "Very Mixed Growth") ~ as.numeric(NA),
# Culture tests
== 'Culture' & Pathogen %in% c('MH', 'PM', 'HS') ~
Diagnostic_test case_when(
== 'MH' & RESULT == "Mannheimia haemolytica" ~ 1,
Pathogen == 'PM' & RESULT %in% c("Pasteurella multocida",
Pathogen "P. multocida") ~ 1,
== 'HS' & RESULT %in% c("Histophilus somni",
Pathogen "Histophilus somnus",
"Histophilus somnii") ~ 1,
# Default case
TRUE ~ 0
), )
Or need to merge files:
<-
barometer %>%
barometer_dt ::left_join(df_samples, by = c('Diagnostic_test','Result', 'Parameter_code')) %>%
dplyr::left_join(
dplyrby = c('Filenumber', 'Samplenumber', 'Result', 'Parameter_code',
barometer_aero_cult, 'Pathogen_identification')
%>%
) ::left_join(
dplyrby = c('Filenumber', 'Samplenumber', 'Result', 'Parameter_code',
barometer_myco_cult, 'Pathogen_identification')
)
Reaching the final format
Floor date to the 1st of the month:
$Floored_date <- lubridate::floor_date(barometer_dt$Date, "month") barometer_dt
Aggregate data on farm_ID and month (WIDE):
<- barometer_dt %>%
barometer_groupby group_by(Lab_reference, Country, Breed, Floored_date, Province, Farm_ID, Diagnostic_test, Sample_type) %>%
summarise(across(c(PM, MH, HS, MB, BRSV, PI3, BCV), max))
Convert to long version:
<- barometer_groupby %>%
barometer_long ::pivot_longer(
tidyrcols = c('PM', 'MH', 'HS', 'MB', 'BRSV', 'PI3', 'BCV'),
names_to = 'Pathogen',
values_to = 'Result',
)
Save file to csv:
write.csv(barometer_long, "../Data/dummyfile", row.names=TRUE)
In case you want to convert to the wide version:
<- barometer_groupby %>%
barometer_wide ::pivot_wider(names_from = c(Pathogen), values_from = Result) tidyr
Example with dummy file (WIDE data)
Please find here a dummy file which can help you understand the different steps we are taking in the next chunk. You can find the step-by-step explanation below the R chunk.
<- barometer_dt_raw %>%
barometer_dt ::rename(
dplyrDossier = 'N° échantillon',
Date = 'Date of Sample',
Sample_type= 'Sample Type',
Diagnostic_test = METH,
Farm_ID = TRP,
PM = P_multocida,
MH = M_haemolytica,
HS = H_somnus,
MB = M_bovis,
BRSV = BRSV,
PI3 = PI3,
BCV = Coronavirus
%>%
) ::separate(ADDRESS, c('Postal_code', 'City')) %>%
tidyr::mutate(
dplyrPostal_code = as.double(Postal_code),
Filenumber = str_sub(Dossier, 1, 12),
Samplenumber = str_sub(Dossier, -3),
Country ='Belgium',
Lab_reference ='3',
Sample_type = case_when(
== "BAL" ~ 'BAL',
Sample_type == "SWAB" ~'Swab',
Sample_type == "CARCASS" ~ 'Autopsy',
Sample_type TRUE ~ 'Missing'
),Breed = case_when(
== "MEAT" ~ 'Beef',
SPECUL == "MILK" ~'Dairy',
SPECUL == "MXD" ~ 'Mixed',
SPECUL TRUE ~ 'Unknown'
),Province = case_when(
between(as.numeric(Postal_code), 1000, 1299) ~ 'Brussels',
between(as.numeric(Postal_code), 1300, 1499) ~ 'Walloon Brabant',
between(as.numeric(Postal_code), 1500, 1999) ~ 'Flemish Brabant',
between(as.numeric(Postal_code), 3000, 3499) ~ 'Antwerp',
between(as.numeric(Postal_code), 2000, 2999) ~ 'Limburg',
between(as.numeric(Postal_code), 3500, 3999) ~ 'Limburg',
between(as.numeric(Postal_code), 4000, 4999) ~ 'Liège',
between(as.numeric(Postal_code), 5000, 5999) ~ 'Namur',
between(as.numeric(Postal_code), 6000, 6599) ~ 'Hainaut',
between(as.numeric(Postal_code), 7000, 7999) ~ 'Hainaut',
between(as.numeric(Postal_code), 6600, 6999) ~ 'Luxembourg',
between(as.numeric(Postal_code), 8000, 8999) ~ 'West Flanders',
TRUE ~ 'East Flanders'
)%>%
)::select(
dplyr
Filenumber,
Diagnostic_test,
Samplenumber,
Country,
Lab_reference,
Sample_type,
Breed,
PM,
MH,
HS,
MB,
BRSV,
PI3,
BCV,
Date,
Postal_code,
Province,
Farm_ID%>%
) ::distinct() %>%
dplyr::mutate(
dplyrFilenumber = sha256_hash(as.character(Filenumber)),
Farm_ID = sha256_hash(as.character(Samplenumber))
)
First we make sure that all column names are in the final format and understandable (in English):
Filenumber, Samplenumber, Date, Sample_type, Diagnostic_test, Farm_ID, Postal_code, Breed, Province
The following abbreviations for the 7 most important pathogens involved in bovine respiratory disease are used: PM (Pasteurella multocida), MB (Mycoplasmopsis bovis, previously Mycoplasma bovis), MH (Mannheimia haemolytica), HS (Histophilus somni), BRSV (bovine respiratory syncytial virus), PI3 (parainfluenza-type 3), and BCV (bovine coronavirus)
Subsequently we mutate/add data to the final format:
Samplenumber: in case more than one sample is submitted to the lab under one filenumber (e.g. 001, 002 or 1, 2, ..)
Date (DD-MM-YYYY): either date of sampling or creation date in lab. The date of sampling is preferred, however, when this date is (often) lacking, it may be easier to take the creation date of the lab. This is only recommended when time between taking samples and creation date remains short (1-2 days)
Geolocation at the province level. Therefore, in this case we needed to separate the postal code (e.g. 2388) from the municipality/city to extract the province (e.g. Brussels)
Country (e.g. Belgium) should be mentioned in a separate column
Lab reference: a number (e.g. 3)
Sample type: ‘BAL’ (bronchoalveolar lavage), ‘Swab’ (nasal swab, eye swab, deep nasopharyngeal swab, … from a living animal), ‘TTA’ (transtracheal aspirate/wash), ‘Autopsy’ (all samples from carcasses) or ‘Unknown’
Breed or production type: ‘Dairy’, ‘Beef’, ‘Mixed’,’Veal’, ‘Fattening calves’, ‘Unknown’
Diagnostic test: ‘Culture’, ‘PCR’, ‘NPS’ (nanopore sequencing) or ‘Paired serum’. In this dataset the Diagnostic test has already been mentioned in the correct format
Finally, the Filenumber and Farm_ID are anonymized by using the SHA-256 hashing function.
Example of final format
Examples of complete R-scripts (and Python)
Lab 1
Lab 2
Lab 3
Visualization: Tableau
The Tableau workbook will become open source at the end of the project.
Data Transfer Agreement
Please find an example of a data transfer agreement here.
Want to contribute, contact us or give feedback?
Please contact Jade Bokma: jade.bokma@ugent.be
Pathogen-specific information
Bovine respiratory syncytial virus
Pathogen: Bovine respiratory syncytial virus (BRSV, also Bovine orthopneumovirus, multiple subtypes, genus: Orthopneumovirus, family: Pneumoviridae)
Incubation period: 2-5 days
Clinical relevance: primary pathogen involved in bovine respiratory disease, predisposing for secondary bacterial infections
Clinical signs: respiratory disease (coughing, nasal discharge, dyspnea, fever), potentially lethal as single agent
Diagnostic sample: respiratory tract (nasopharyngeal swab, bronchoalveolair lavage, transtracheal wash)¹ᐧ², necropsy
Diagnostic test*: Direct: PCR, nanopore sequencing, antigen ELISA. Indirect: paired serum samples for antibody ELISA (interpretation may be hampered by maternal immunity)
Carriers: persistent infection suggested but not evidenced, subclinical infections likely most important for infection maintenance in the population
Infection route: airborne³, aerosol, nasal secretions (direct contact), fomites
Vaccines: both monovalent vaccines and multivalent vaccines (combined with bPI-3, BVDV, M. haemolytica), inactivated or live attenuated, parenteral or intranasal are available in Europe
Eradication programs: voluntary program in Norway
* List incomplete, availability of commercial tests can differ between countries
1. Doyle D., Credille B., Lehenbauer T.W., Berghaus R., Aly S.S., Champagne J., Blanchard P., Crossley B., Berghaus L., Cochran S., Woolums A. 2017. Agreement among 4 sampling methods to identify respiratory pathogens in dairy calves with acute bovine respiratory disease. J Vet Intern Med 31, 954-959.
2. Makoschey B., Berge A.C. 2021. Review on bovine respiratory syncytial virus and bovine parainfluenza – usual suspects in bovine respiratory disease – a narrative review. BMC Veterinary Research 17, 261.
3. Mars M.H., Bruschke C.J.M., Van Oirschot J.T. 1999. Airborne transmission of BHV1, BRSV, and BVDV among cattle is possible under experimental conditions. Vet Microbiol 66, 197-207.
Bovine parainfluenza-3 virus
Pathogen: Bovine parainfluenza-3 virus (bPI-3, also bovine respirovirus 3, 3 genotypes (A, B, C) genus: Respirovirus, family: Paramyxoviridae)
Incubation period: 2-6 days
Clinical relevance: primary pathogen involved in bovine respiratory disease, predisposing for secondary bacterial infections
Clinical signs: respiratory disease (coughing, nasal discharge, dyspnea, fever), presumably mild as single infection
Diagnostic sample: respiratory tract (nasopharyngeal swab, bronchoalveolair lavage, transtracheal wash), necropsy
Carriers: presumably not, subclinical infections likely most important for infection maintenance in the population
Diagnostic test*: Direct: PCR, nanopore sequencing, antigen ELISA. Indirect: paired serum samples for antibody ELISA1 (interpretation may be hampered by maternal immunity)
Infection route: aerosols, nasal secretion (direct contact), fomites
Vaccines: Several multivalent vaccines (BRSV, BVD, M. haemolytica), inactivated or live-attenuated, parenteral or intranasal are available in Europe
Eradication programs: no
* List incomplete, availability of commercial tests can differ between countries
Pasteurella multocida
Clinical relevance: P. multocida is an opportunistic bacterium and part of the common respiratory tract flora.¹ᐧ² Problems can occur during co-infection with viruses/Mycoplasma bovis or after extensive antimicrobial treatment.
Clinical signs: respiratory disease (coughing, nasal discharge, dyspnea, fever), septicemia
Diagnostic sample: respiratory tract (bronchoalveolair lavage, transtracheal wash), blood culture, peritoneal fluid, necropsy
Diagnostic test*: culture and antimicrobial susceptibility testing, PCR**
Carriers: yes
Infection route: direct contact (nasal secretions), potentially close distance aerosol spread, potentially fomites
Vaccines: Inactivated divalent vaccine (with Salmonella typhimurium) available in some EU countries
1. Lima S.F., Teixeria A.G.V., Higgins C.H., Lima S.F., Bicalho R.C. 2016. The upper respiratory tract microbiome and its potential role in bovine respiratory disease and otitis media. Sci Rep 6.
2. Gaeta N.C., Lima S.F., Teixeria A.G., Ganda E.K., Oikonomou G., Gregory L., Bicalho R.C. 2017. Deciphering upper respiratory tract microbiota complexity in healthy calves and calves that develop respiratory disease using shotgun metagenomics. J Dairy Sci 100, 1445-1458.
** Detection of an opportunistic pathogen by PCR confirms it present in the animal/herd, but does not evidence involvement in disease. P. multocida is that prevalent that PCR analysis is virtually useless.
Mannheimia haemolytica
Pathogen: Mannheimia haemolytica (member of the Pasteurellaceae family, two major genotypes (1 and 2))
Clinical relevance: M. haemolytica is an opportunistic bacterium and part of the common respiratory tract flora.¹ᐧ² Problems can occur during co-infection with viruses/Mycoplasma bovis and potentially also after breaches in the innate immunity of the respiratory tract by other factors. Outbreaks of virulent M. haemolytica strains in adult dairy cattle with acute mortality are described.³ᐧ⁴
Clinical signs: respiratory disease (coughing, nasal discharge, dyspnea, fever), septicemia
Diagnostic sample: respiratory tract (bronchoalveolair lavage, transtracheal wash), peritoneal fluid, necropsy
Diagnostic test*: culture and antimicrobial susceptibility testing; PCR**
Carriers: yes
Infection route: direct contact (nasal secretions), potentially close distance aerosol spread, potentially fomites
Vaccines: both inactivated monovalent and multivalent vaccines (with H. somni, PI-3 or BRSV) are available in Europe.
1. Lima S.F., Teixeria A.G.V., Higgins C.H., Lima S.F., Bicalho R.C. 2016. The upper respiratory tract microbiome and its potential role in bovine respiratory disease and otitis media. Sci Rep 6.
2. Gaeta N.C., Lima S.F., Teixeria A.G., Ganda E.K., Oikonomou G., Gregory L., Bicalho R.C. 2017. Deciphering upper respiratory tract microbiota complexity in healthy calves and calves that develop respiratory disease using shotgun metagenomics. J Dairy Sci 100, 1445-1458.
3. Dorso L., Rouault M., Barbotin C., Chartier C., Assié S. 2021. Infectious bovine respiratory disease in adult cattle: an extensive necropsic and etiological study. Animals (Basel) 11, 2280.
4. Mahu M., Valgaeren B., Pardon B., Deprez P., Haesebrouck F., Boyen F. 2015. Non-haemolytic Mannheimia haemolytica as a cause of pleuropneumonia and septicemia in a calf. Vet Microbiol 180, 157-160.
** Detection of an opportunistic pathogen by PCR confirms it present in the animal/herd, but does not evidence involvement in disease
Mycoplasma bovis
Pathogen: Mycoplasma bovis
Incubation period: 2-10 days
Clinical relevance: primary pathogen involved in bovine respiratory disease, mastitis, otitis and arthritis, often reported in co-infection with other viral or bacterial pathogens
Clinical signs: respiratory disease (coughing, nasal discharge, dyspnea, fever), ear drop, swollen joints, mastitis, seromas and rarer presentations¹
Diagnostic sample: respiratory tract (nasopharyngeal swab, bronchoalveolair lavage, transtracheal wash), milk, synovial fluid, necropsy
Carriers: yes
Diagnostic test*: Direct: culture (special media and CO2 rich incubation needed), PCR, MALDI-TOF MS, nanopore sequencing. Indirect: paired serum samples for antibody ELISA (interpretation may be hampered by maternal immunity)
Infection route: nasal secretions (direct contact), colostrum, milk, semen, fomites¹ᐧ²
Vaccines: Restrictedavailability of a monovalent registered vaccine and in some European countries autovaccines are allowed
Eradication programs: voluntary program in Finland
1. Maunsell FP., Donovan G.A. 2009. Mycoplasma bovis infections in young calves. Vet Clin North Am Food Anim Pract 25, 139-177.
2. Haapala V., Pohjanvirta T., Vähänikkilä N., Halkilahti J., Simonen H., Pelkonen S., Soveri T., Simojoki H., Autio T. 2018. Semen as a source of Mycoplasma bovis mastitis in dairy herds. Vet Microbiol 216, 60-66.
Histophilus somni
Pathogen: Histophilus somni (member of the Pasteurellaceae family)
Clinical relevance: opportunistic pathogen involved in respiratory disease, septicemia, otitis, polyserositis and thrombotic meningoencephalitis-myelitis
Clinical signs: respiratory disease (coughing, nasal discharge, dyspnea, fever), central nervous signs (sleeper syndrome), swollen joints, ear drop and sudden death
Diagnostic sample: respiratory tract (bronchoalveolair lavage, transtracheal wash)¹, blood culture, necropsy
Diagnostic test*: PCR**, culture (CO2 rich incubation needed) and antimicrobial susceptibility testing
Carriers: yes
Infection route: direct contact (nasal secretions), urine, potentially fomites
Vaccines: divalent inactivated vaccines ( M. haemolytica, H. somni) are available in Europe
1. Van Driessche L., Valgaeren B.R., Gille L., Boyen F., Ducatelle R., Haesebrouck F., Deprez P., Pardon B. 2017. A deep nasopharyngeal swab versus nonendoscopic bronchoalveolar lavage for isolation of bacterial pathogens from preweaned calves with respiratory disease. J Vet Intern Med 31, 946-953.