Generating a conflict of interest form automatically

R
Grant Writing
Some code and examples showing how to generate a conflict of interest statement required by some funding agencies in an almost completely automated manner.
Author

Andreas Handel

Published

May 29, 2020

Overview

While most of my grant proposals go to the NIH, which thankfully does not require an arcane conflict of interest (COI) document, I am sometimes part of a grant proposal that goes to the NSF or another agency that require a COI. Instead of just asking for any actual conflicts of interest, these documents ask one to list every co-author in the last N years, which is fairly stupid these days when most papers in the biomedical sciences have many co-authors. I hope the agencies get rid of this in my opinion pointless document soon. Until then, I have to do it.

I don’t want to retrieve all my co-authors and fill the form by hand. In a previous post, I showed how one can use the bibliometrix R package to do an analysis of a set of publications. Among other things, this approach returns all co-authors, which I will use here to make the COI table almost completely automated.

The RMarkdown/Quarto file to run this analysis is here.

Required packages

library(dplyr)
library(knitr)
library(flextable)
#remotes::install_github('massimoaria/bibliometrix')
library(bibliometrix)

Loading data

As explained in a previous post, the currently best way to get all my papers is to download them from NIH’s “My Bibliography” and export it in MEDLINE format. Then read in the file with the code below.

#read bib file, turn file of references into data frame
pubs <- bibliometrix::convert2df("medline.txt", dbsource="pubmed",format="pubmed") 

Converting your pubmed collection into a bibliographic dataframe

Done!


Generating affiliation field tag AU_UN from C1:  Done!

Each row of the data frame created by the convert2df function is a publication, the columns contain information for each publication. For a list of what each column variable codes for, see the bibliometrix website.

Getting the right time period

This specific funding agency I’m currently writing a COI for (NIFA) requires co-authors of the last 3 years, so let’s get them. I don’t know if they mean 3 full years. I’m doing this mid-2020, so to be on safe side, I go back to 2017.

period_start = 2017
pubs_new = pubs[pubs$PY>=period_start,]

I need the full names of the authors. They are stored for each publication in the AF field. This is the only information I need for the COI form. I pull it out, then do a bit of processing to get it in the right shape, then remove duplicates and sort.

allauthors = paste0(pubs_new$AF,collapse = ";") #merge all authors into one vector
allauthors2 = unlist(strsplit(allauthors, split =";"))
authors = sort(unique(allauthors2)) #split vector of authors, get unique authors

Note that I originally did the above steps using biblioAnalysis(pubs_new). However, this function/approach broke in a recent version of the package, and I realized that I can just use a few base R commands to get what I need, which is the approach shown above. If you use the biblioAnalysis() function, the Authors are in the Authors field of the returned object.

Getting a table of co-authors

Here is the full table of my co-authors in the specified time period. I made a tibble that looks similar to what the COI document requires.

#removing the 1st one since that's me
authortable = dplyr::tibble(Name = authors, 
                            "Co-Author" = 'x', 
                            Collaborator = '', 
                            'Advisees/Advisors' = '', 
                            'Other – Specify Nature' = '')

Finally, I’m using the flextable package to make a decent looking table and save it to a word document.

ft <- flextable::flextable(authortable)
flextable::autofit(ft)

Name

Co-Author

Collaborator

Advisees/Advisors

Other – Specify Nature

AHMED, HASAN

x

ALIKHAN, MALIHA A

x

AMANNA, IAN J

x

ANTIA, ALICE

x

ANTIA, RUSTOM

x

BOOM, W HENRY

x

BULUSHEVA, IRINA

x

CARLSON, NICHOLE E

x

CASTELLANOS, M E

x

CASTELLANOS, MARIA

x

CHAKRABURTY, SRIJITA

x

CHEN, ENFU

x

CHENG, WEI

x

COATES, P TOBY

x

CROFT, NATHAN P

x

DALE, ARIELLA PERRY

x

DENHOLM, J T

x

DOBBIN, KEVIN

x

DUDEK, NADINE L

x

EBELL, MARK

x

EBELL, MARK H

x

EGGENHUIZEN, PETER J

x

FOREHAND, RONALD

x

FUGGER, LARS

x

GAN, POH Y

x

GARCIA-SASTRE, ADOLFO

x

GREGERSEN, JON W

x

GUAN, JING

x

HALLORAN, M ELIZABETH

x

HANDEL, A

x

HANDEL, ANDREAS

x

HECKMAN, TIMOTHY G

x

HOLDSWORTH, STEPHEN R

x

HOLT, STEPHEN G

x

HOUBEN, R M G J

x

HUANG, HAODI

x

HUDSON, BILLY G

x

HUO, XIANG

x

HUYNH, MEGAN

x

JOLOBA, MOSES L

x

KAKAIRE, R

x

KIRIMUNDA, S

x

KITCHING, A RICHARD

x

KIWANUKA, N

x

LA GRUTA, NICOLE L

x

LI, CHANGWEI

x

LI, CHAO

x

LI, YAN

x

LING, FENG

x

LOH, KHAI L

x

LONGINI, IRA M

x

MALONE, LASHAUNDA L

x

MANICASSAMY, BALAJI

x

MARTINEZ, L

x

MARTINEZ, LEONARDO

x

MCBRYDE, E S

x

MCKAY, BRIAN

x

MOORE, JAMES R

x

MU, LAN

x

OOI, JOSHUA D

x

PAWELEK, KASIA A

x

PETERSEN, JAN

x

POWER, DAVID A

x

PURCELL, ANTHONY W

x

QUACH, T

x

QUINN, FREDERICK D

x

RAGONNET, R

x

RAMARATHINAM, SRI H

x

REID, HUGH H

x

ROSSJOHN, JAMIE

x

SETTE, ALESSANDRO

x

SHEN, YE

x

SIDNEY, JOHN

x

SLIFKA, MARK

x

SNG, XAVIER Y X

x

STEIN, CATHERINE M

x

SUMNER, T

x

TAN, YU H

x

THOMAS, PAUL G

x

TRAUER, J M

x

TSCHARKE, DAVID C

x

WAKIM, LINDA M

x

WANG, XIAOXIAO

x

WATSON, KATHERINE A

x

WHALEN, C C

x

WHALEN, CHRISTOPHER C

x

WILLETT, ZOE J

x

WOLDU, H

x

WOLDU, HENOK

x

WU, TING

x

ZALWANGO, S

x

ZALWANGO, SARAH

x

ZARNITSYNA, VERONIKA

x

ZARNITSYNA, VERONIKA I

x

ZHU, LIMEI

x

flextable::save_as_docx("my table" = ft, path = "COItable.docx")

I notice a few duplicates in the table that need to be removed. Of course I also need to remove myself. And for some, the full name doesn’t show. I need to fill in a few of the other columns and potentially add a few individuals who were not captured. So it’s not fully automated, but I can copy this table into the COI statement and the remaining edits are still annoying but not that terrible.

Discussion

These kinds of COI documents that ask for all co-authors are in my opinion antiquated and should go away. In the meantime using a somewhat automated approach makes the problem not too bad. I will have to make a few manual adjustments to the table, but overall it’s not too bad. I’m still glad that NIH does not require this.