Packages to Load

First, you need to load the JournalAnalysis package in order to load variables and functions.

library(JournalAnalysis)
library(dplyr)

Decide on a query and generate pubmed data

Since we are interested in the microbiome in the context of psychiatry, our query is as such.

query3 <- "microbiome AND (psychiatry OR psychology OR neuroscience) AND (rhesus OR macaque or human or stress or monkey) AND (NOT ecology)"
pub_data <- get_publication_data(journal_source = "scimago", queries = query3, limit = 30000, min_citations = 5)
#> 2970 records found, returning 2970
#> Removed records published before 2008.
#> Removed records published after 2018.
#> Removed records with less than 5 citations.
#> Removed records with NA values for pmid, doi, and authors.
#> 1147 records passed the filter.

The pub_data objects includes $articles, $journals, and $combined data.

View the resulting pubmed ids

# View the resulting pubmed ids
pmids <- pub_data$articles$pmid
pmids
#>    [1] "27647198" "28804508" "27540164" "28966571" "29249803" "28757456"
#>    [7] "28064357" "28700459" "26324227" "28546750" "28242013" "28556833"
#>   [13] "28965876" "28398339" "27423492" "28375209" "28943841" "28224183"
#>   [19] "26375241" "25698977" "26598580" "27480574" "27393829" "28400259"
#>   [25] "27986469" "27793434" "28243222" "28179108" "28244981" "28617197"
#>   [31] "27865949" "28659790" "28068788" "28368029" "27462204" "27801892"
#>   [37] "27648916" "27604565" "28724431" "28018353" "28117839" "28137375"
#>   [43] "28283186" "27918315" "25852686" "28838324" "28661940" "27779624"
#>   [49] "28229114" "27843150" "29051531" "27608809" "27392632" "28676747"
#>   [55] "27244232" "26527110" "27649625" "27288567" "27417321" "28053341"
#>   [61] "27090302" "27005587" "26898639" "28093256" "28239408" "28242200"
#>   [67] "28628918" "28266612" "27744123" "27832923" "27832936" "26760398"
#>   [73] "28235194" "28483500" "27483380" "27919253" "29039142" "27742460"
#>   [79] "27511838" "26412364" "28050310" "28270247" "26662472" "27413138"
#>   [85] "28301775" "27045844" "27881403" "28012830" "26426902" "27121424"
#>   [91] "27892518" "28744452" "28237726" "28676754" "26432952" "27048547"
#>   [97] "27553784" "27752130" "26476141" "26912607" "27090305" "27738642"
#>  [103] "26408987" "26594873" "27884012" "28951525" "28928740" "27232999"
#>  [109] "25794930" "28703640" "27256072" "27555382" "27891089" "27319972"
#>  [115] "26357876" "27491067" "28893978" "27922089" "27070349" "27346602"
#>  [121] "26046241" "26881136" "26479188" "23821341" "27773355" "27270497"
#>  [127] "27890486" "27676359" "27489376" "28729832" "27598189" "28135659"
#>  [133] "26881095" "27067014" "26903212" "28303137" "28254370" "28536926"
#>  [139] "27981187" "28034915" "28070760" "29160841" "28723415" "28636959"
#>  [145] "27445651" "28503135" "26135201" "27191486" "27266978" "27433087"
#>  [151] "26906761" "25309394" "26904161" "26184083" "28259623" "25417146"
#>  [157] "28300084" "26589226" "28485733" "28179566" "28356427" "27988330"
#>  [163] "27573827" "26912499" "23873964" "26528128" "27651175" "25756928"
#>  [169] "24690880" "27882443" "27492386" "27254412" "27943360" "26079804"
#>  [175] "26372511" "23914151" "27714645" "28035686" "25772005" "26795070"
#>  [181] "24401109" "26973523" "28273482" "26029209" "29163522" "28902840"
#>  [187] "25448230" "27090095" "28194099" "27943202" "25415497" "28416717"
#>  [193] "25482171" "27176552" "28092661" "28898979" "26945017" "26589225"
#>  [199] "25652365" "25300465" "27509521" "26372770" "27402495" "27605876"
#>  [205] "26175487" "26967229" "28446656" "24747144" "27653288" "27677781"
#>  [211] "28341160" "26868600" "26450630" "28242160" "28035935" "27903834"
#>  [217] "28446989" "25288135" "27701771" "27013943" "28441450" "25834446"
#>  [223] "27260271" "26215386" "27585820" "27032544" "26615187" "26419460"
#>  [229] "24914504" "28045913" "27814521" "27097105" "27031373" "25762939"
#>  [235] "28253911" "27825953" "27749086" "27228404" "26190966" "27621225"
#>  [241] "28941089" "27510423" "25170769" "28203479" "27776263" "28186177"
#>  [247] "25982560" "28374308" "28414329" "25700599" "28041931" "27900260"
#>  [253] "27566465" "24956966" "27198196" "27665050" "25088912" "23689536"
#>  [259] "25380056" "26370263" "29064009" "27413153" "25078296" "26187394"
#>  [265] "27793226" "26162711" "24875898" "28577489" "26941380" "21560070"
#>  [271] "27773805" "25392516" "27532502" "24466331" "26564131" "28341646"
#>  [277] "27424917" "27694934" "26500584" "25532787" "25411471" "27725817"
#>  [283] "28231836" "24976697" "28207848" "27051585" "27316342" "25846319"
#>  [289] "28126382" "27047989" "26307347" "28243360" "27255860" "24732404"
#>  [295] "25866195" "27239536" "28079523" "27461975" "25290265" "27688650"
#>  [301] "27889186" "27343895" "28229538" "25911232" "25408914" "26964681"
#>  [307] "26790970" "26108718" "26929865" "25773227" "28158276" "27210745"
#>  [313] "28275689" "25727007" "25778408" "27567591" "26176590" "27432060"
#>  [319] "25510186" "25675494" "27594980" "27273168" "25628593" "26048305"
#>  [325] "26848171" "28028357" "28041633" "26771000" "27930307" "26367776"
#>  [331] "27013171" "27464994" "27492617" "26188287" "27632908" "26218293"
#>  [337] "26900391" "27073093" "26657483" "26221192" "26648598" "27639806"
#>  [343] "28154097" "27144618" "25947328" "27083478" "25638481" "26580325"
#>  [349] "27450201" "26833829" "27145057" "27235816" "24778631" "27713700"
#>  [355] "27291514" "25710209" "27033377" "26879573" "28096305" "28604916"
#>  [361] "25135776" "26395811" "25678701" "24711545" "27444134" "22752723"
#>  [367] "26422754" "26928523" "26697008" "26279833" "27134665" "27611967"
#>  [373] "25713531" "28274109" "25705750" "27846210" "26851553" "26359903"
#>  [379] "28686856" "20413623" "27463672" "27012770" "24884515" "27764237"
#>  [385] "27642271" "27378919" "25291121" "26768621" "27665271" "26170833"
#>  [391] "28430973" "27159638" "24717448" "24216160" "22584143" "26939763"
#>  [397] "26349802" "26869611" "27510422" "27170558" "27458727" "28033388"
#>  [403] "26092111" "27853957" "23384445" "26937618" "26706567" "26706413"
#>  [409] "27013462" "25759691" "25944307" "26440540" "25110235" "26912633"
#>  [415] "26497477" "26426680" "25565946" "27115295" "26805875" "26690871"
#>  [421] "29206104" "27861126" "27400279" "23644052" "25631714" "26855951"
#>  [427] "26276631" "28179378" "25060574" "25449699" "24685620" "25288760"
#>  [433] "27038326" "26381230" "28069350" "26923630" "27270989" "27006445"
#>  [439] "26264216" "25869599" "27144623" "25446754" "27159875" "25522313"
#>  [445] "27307423" "24885374" "29055040" "27680942" "27144619" "26647967"
#>  [451] "26783503" "23742229" "25365763" "26580313" "18929461" "27458372"
#>  [457] "24982633" "27197307" "29207379" "25339800" "27994591" "23340503"
#>  [463] "26457021" "25639767" "24798884" "22556363" "24679536" "24744425"
#>  [469] "27255494" "28650954" "26445114" "26757840" "26878114" "26189694"
#>  [475] "26052224" "24772103" "28620373" "27087480" "25934170" "27773782"
#>  [481] "26030851" "25349393" "25974299" "25147950" "26559394" "26129950"
#>  [487] "24629538" "29067297" "25228292" "26379564" "24997038" "26224864"
#>  [493] "23506618" "26474156" "28104812" "27121286" "27078021" "26644347"
#>  [499] "26089773" "25173628" "22171138" "26900287" "27314026" "25902408"
#>  [505] "28134808" "26733805" "26829621" "25202975" "25548896" "25927528"
#>  [511] "27413125" "24659554" "24247023" "25587358" "28356466" "26340819"
#>  [517] "25882912" "27081392" "25710826" "26061883" "25628526" "25853989"
#>  [523] "27270085" "24084940" "26978456" "25339801" "26733780" "25754082"
#>  [529] "26467668" "24937094" "25518872" "24422720" "27100827" "22314029"
#>  [535] "26029487" "26578751" "26692578" "26209321" "25641946" "25744944"
#>  [541] "26427004" "28655883" "25869281" "25412152" "24062644" "25853426"
#>  [547] "23202796" "24674836" "27599104" "24637038" "26442694" "25738373"
#>  [553] "23734091" "24417382" "25161627" "25313558" "25705365" "26840096"
#>  [559] "25891864" "26811644" "25904735" "27418137" "27313534" "27226437"
#>  [565] "25167923" "25222142" "26621107" "25456047" "21947740" "26919743"
#>  [571] "27909435" "25882059" "25703537" "28357055" "26565971" "27512019"
#>  [577] "27255669" "26472761" "27986392" "26026390" "25217888" "26516908"
#>  [583] "25620929" "23988221" "25212412" "26037603" "27425771" "25862297"
#>  [589] "24568717" "27368878" "26524592" "25301381" "25815979" "25918262"
#>  [595] "26867181" "24228900" "25240858" "26493496" "27760374" "24021863"
#>  [601] "26689598" "26284788" "25506602" "25540138" "27522506" "25823690"
#>  [607] "25484876" "25339738" "26042119" "26582919" "26712550" "25589491"
#>  [613] "26428623" "27160306" "25637492" "26259965" "26484665" "22162969"
#>  [619] "26690135" "25792098" "25789437" "24709119" "22838383" "25462874"
#>  [625] "23964195" "23759244" "26641646" "25597866" "25324715" "24621061"
#>  [631] "25760553" "25204849" "25545766" "25623659" "25368100" "23986657"
#>  [637] "25565996" "24628464" "25982834" "27059883" "28417994" "24879791"
#>  [643] "25004447" "26430150" "23236381" "26074864" "24223144" "24049450"
#>  [649] "25224893" "25391939" "25083061" "27770569" "24520424" "24707138"
#>  [655] "25531553" "25168158" "25815991" "26985722" "26512135" "25977932"
#>  [661] "25083058" "24848969" "26491123" "25857868" "24944466" "23497633"
#>  [667] "21966581" "25550456" "24889369" "25871646" "24348350" "25932952"
#>  [673] "25138026" "24576997" "24222865" "24030199" "27050589" "25383869"
#>  [679] "26921425" "25128459" "22688187" "23706525" "26691223" "24145051"
#>  [685] "26775294" "25896511" "26819529" "26972828" "26646243" "22968153"
#>  [691] "26386597" "25946987" "25755242" "26164219" "24566169" "25698989"
#>  [697] "26731111" "25061141" "26307850" "23162465" "24140431" "25083282"
#>  [703] "24590688" "25092084" "23307560" "26147989" "26589955" "20939923"
#>  [709] "24803013" "23630473" "26151137" "25368552" "23349972" "24412639"
#>  [715] "25132496" "24428901" "23992228" "23063970" "23798531" "24557009"
#>  [721] "25920452" "23152732" "26096570" "25034760" "24588821" "25428369"
#>  [727] "28095459" "25751305" "25527669" "24699691" "26053862" "24726793"
#>  [733] "24991177" "24860967" "26199950" "22366706" "24768920" "26643348"
#>  [739] "22665702" "24958636" "25322459" "25146170" "23460617" "24440038"
#>  [745] "24567379" "25796370" "22979996" "24144322" "24929795" "25762984"
#>  [751] "25249787" "24763552" "23939821" "20056603" "21876150" "27303627"
#>  [757] "26708939" "24587240" "24665101" "25063659" "23336977" "24550220"
#>  [763] "24193171" "24876724" "24250227" "24395774" "24669209" "24098451"
#>  [769] "25062846" "24639668" "27737952" "24410883" "22984058" "25977934"
#>  [775] "21918508" "23071537" "23500100" "20145094" "25178701" "24370827"
#>  [781] "24621068" "23892476" "23497090" "24679539" "24709620" "24438438"
#>  [787] "25241326" "23915308" "22100833" "26421334" "23106572" "25355473"
#>  [793] "27521438" "24245565" "24381531" "25835281" "25193428" "23474627"
#>  [799] "25035478" "23066308" "25422508" "24586321" "25972618" "24202171"
#>  [805] "24402654" "26599575" "25296886" "24167375" "27804269" "24184118"
#>  [811] "24424041" "24220289" "22645637" "24576332" "24639375" "25090362"
#>  [817] "22115311" "24096422" "22825446" "23962873" "24145019" "25151481"
#>  [823] "24085744" "24240321" "23745830" "25084177" "23151182" "26291516"
#>  [829] "23232494" "24410472" "23149072" "23185248" "24602083" "25120092"
#>  [835] "23872826" "21281490" "23598526" "23533776" "23209841" "24167349"
#>  [841] "23755285" "22832349" "25378658" "23656797" "24215981" "21040780"
#>  [847] "23049264" "25264237" "23991830" "23259942" "26485429" "21443722"
#>  [853] "24009397" "26000156" "23746484" "24602085" "25037579" "25360022"
#>  [859] "24486406" "23905920" "22747919" "25070848" "22700493" "23814584"
#>  [865] "23659636" "25414636" "25930081" "23686013" "23621920" "24859298"
#>  [871] "24039842" "25263833" "24164317" "23842599" "22027566" "22928654"
#>  [877] "25278689" "22808006" "24981838" "24090343" "23139216" "20011045"
#>  [883] "24229374" "25018747" "22590466" "25671699" "23828941" "25278572"
#>  [889] "23382717" "24528371" "25934857" "25445636" "25651891" "24023611"
#>  [895] "20944004" "24198436" "25888525" "23298648" "23760428" "24133661"
#>  [901] "23258401" "25825777" "22578138" "25852554" "24930973" "25132119"
#>  [907] "24972070" "23814583" "24305827" "23091474" "23647647" "24880830"
#>  [913] "23776216" "24587653" "18723164" "21282636" "22762024" "26364544"
#>  [919] "26200659" "25085328" "23898259" "22220274" "21986443" "22876032"
#>  [925] "24648292" "23898780" "24587296" "25540039" "23984403" "21681774"
#>  [931] "23332363" "25994221" "23088889" "22227274" "22761662" "23624888"
#>  [937] "21982589" "26431937" "23166707" "21732396" "21750565" "24145871"
#>  [943] "25164323" "23450133" "23357715" "23410786" "22042916" "23758787"
#>  [949] "23544991" "22829676" "24324895" "22917574" "21907418" "23543720"
#>  [955] "24385966" "24663435" "21988661" "23986533" "24287850" "22802640"
#>  [961] "21090962" "23083400" "24891519" "23231464" "21317993" "22926221"
#>  [967] "22484627" "22802646" "22219721" "23237666" "23036996" "22669246"
#>  [973] "23951133" "22081976" "21998395" "24327954" "22807325" "23356884"
#>  [979] "20554042" "23536766" "22780564" "21099429" "23042942" "22163251"
#>  [985] "22053929" "22406348" "19154758" "21476605" "19903265" "22918691"
#>  [991] "21278764" "25083990" "22521342" "23148161" "25673413" "23261065"
#>  [997] "21868195" "21317366" "23095056" "23941275" "23637627" "22863120"
#> [1003] "21550442" "21362199" "22253759" "24906874" "23717262" "21326918"
#> [1009] "22870198" "20571116" "19960394" "21596930" "26650439" "23289702"
#> [1015] "19352371" "23300802" "20691635" "21532045" "23393605" "23297830"
#> [1021] "20631792" "21949732" "25293763" "19763278" "22530713" "24709703"
#> [1027] "23670974" "21818345" "23667746" "25567972" "19700760" "22412388"
#> [1033] "21088234" "22684101" "23630244" "22892838" "20937326" "20647790"
#> [1039] "25164768" "21636646" "23601101" "19833563" "19338686" "19915572"
#> [1045] "25028588" "23902802" "24956173" "19931537" "23853595" "22747852"
#> [1051] "19835625" "21674026" "20154684" "22952955" "21410934" "21330441"
#> [1057] "21263444" "21986999" "19846797" "19674941" "21234351" "22259647"
#> [1063] "21450916" "24223725" "26492141" "22806643" "24605013" "25866590"
#> [1069] "20620991" "22247509" "20528117" "22470063" "19841960" "25865048"
#> [1075] "22927809" "21429189" "21636801" "23529939" "24184186" "23529351"
#> [1081] "20538033" "21872730" "23039285" "20102566" "24218476" "23177478"
#> [1087] "22371720" "28122885" "23914153" "24517644" "22020785" "20639337"
#> [1093] "20211888" "24296575" "21209938" "21800218" "19493060" "20941389"
#> [1099] "20533355" "21900639" "23864273" "19067399" "21152017" "21297633"
#> [1105] "19122664"

Retrieve abstracts from pmids and create a wordcloud from the pubmed abstracts

get_word_cloud(pubmed_ids = pmids, plot_name = "microbiome_psych_wordcloud.png")
#> There are total 1105 PMIDs
#> downloading abstracts for PMIDs from 1 to 100 ...
#> downloading abstracts for PMIDs from 101 to 200 ...
#> downloading abstracts for PMIDs from 201 to 300 ...
#> downloading abstracts for PMIDs from 301 to 400 ...
#> downloading abstracts for PMIDs from 401 to 500 ...
#> downloading abstracts for PMIDs from 501 to 600 ...
#> downloading abstracts for PMIDs from 601 to 700 ...
#> downloading abstracts for PMIDs from 701 to 800 ...
#> downloading abstracts for PMIDs from 801 to 900 ...
#> downloading abstracts for PMIDs from 901 to 1000 ...
#> downloading abstracts for PMIDs from 1001 to 1100 ...
#> downloading abstracts for PMIDs from 1101 to 1105 ...
#> png 
#>   2

knitr::include_graphics('./microbiome_psych_wordcloud.png')

Accessing and analyzing journal data

View unique journals based on the articles retrieved with the below command.

pub_data$journals
#> # A tibble: 455 x 18
#>     Rank Title Type    SJR SJR.Best.Quarti~ H.index Total.Docs...20~
#>    <int> <fct> <fct> <dbl> <fct>              <int>            <int>
#>  1     6 Cell  jour~  26.9 Q1                   655              693
#>  2    13 Natu~ jour~  20.9 Q1                   496              259
#>  3    14 Natu~ jour~  20.3 Q1                   361              335
#>  4    16 Natu~ jour~  19.5 Q1                   224              306
#>  5    18 Natu~ jour~  19.0 Q1                   337              172
#>  6    19 Natu~ jour~  18.7 Q1                   242              232
#>  7    20 Natu~ jour~  18.1 Q1                  1011             2661
#>  8    22 Phys~ jour~  16.9 Q1                   293               31
#>  9    23 Immu~ jour~  16.5 Q1                   329              284
#> 10    30 Natu~ jour~  14.5 Q1                   323              224
#> # ... with 445 more rows, and 11 more variables:
#> #   Total.Docs...3years. <int>, Total.Refs. <int>,
#> #   Total.Cites..3years. <int>, Citable.Docs...3years. <int>,
#> #   Cites...Doc...2years. <dbl>, Ref....Doc. <dbl>, Country <fct>,
#> #   Categories <fct>, ISSN <chr>, ISSN.1 <fct>, ISSN.2 <fct>

Now, you can do some further analysis of journals based on SJR, which is.

# Decide on categorical words to keep
cats <- "Multidisciplinary|Neuroscience|Psychology|Psychiatry"

Select “best” journals based on median or any other statistical method. It may be valuable to do some clustering although the journals are ranked into quartiles. We chose the median SJR to look at any journals above the median and qualify them as the upper tier.

# Only keep journals above the median that are journals and include the categories above.
best_journals <- filter(pub_data$journals, SJR >= median(pub_data$journals$SJR) & grepl(cats, Categories) & Type == "journal")

After filtering the journal data, you can now select specific columns to view and save your tibble as a csv file.

# Decide on columns to keep
best_journals <- best_journals %>% select(Title, Rank, Type, SJR, Country, Categories)

best_journals
#> # A tibble: 69 x 6
#>    Title         Rank Type     SJR Country   Categories                   
#>    <fct>        <int> <fct>  <dbl> <fct>     <fct>                        
#>  1 Nature Revi~    18 journ~ 19.0  United K~ Neuroscience (miscellaneous)~
#>  2 Nature          20 journ~ 18.1  United K~ Multidisciplinary (Q1)       
#>  3 Nature Neur~    35 journ~ 14.1  United K~ Neuroscience (miscellaneous)~
#>  4 Science         38 journ~ 13.5  United S~ History and Philosophy of Sc~
#>  5 Neuron          63 journ~ 11.1  United S~ Neuroscience (miscellaneous)~
#>  6 Psychologic~    88 journ~  9.00 United S~ History and Philosophy of Sc~
#>  7 JAMA Psychi~    92 journ~  8.83 United S~ Arts and Humanities (miscell~
#>  8 Trends in N~   138 journ~  7.27 Netherla~ Neuroscience (miscellaneous)~
#>  9 Molecular P~   154 journ~  6.92 United K~ Cellular and Molecular Neuro~
#> 10 EMBO Journal   164 journ~  6.57 Germany   Biochemistry, Genetics and M~
#> # ... with 59 more rows

# Save as a csv file
save_as_csv(best_journals, filename = "highest_impact_relevant_journals")