diff --git a/404.html b/404.html index 616e69f9..490b218a 100644 --- a/404.html +++ b/404.html @@ -33,7 +33,7 @@
diff --git a/LICENSE-text.html b/LICENSE-text.html index 11487abd..b00472de 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -17,7 +17,7 @@ diff --git a/articles/index.html b/articles/index.html index 8df6e038..d2d3e6ed 100644 --- a/articles/index.html +++ b/articles/index.html @@ -17,7 +17,7 @@ diff --git a/articles/miaViz.html b/articles/miaViz.html index 84537a3e..7ce92689 100644 --- a/articles/miaViz.html +++ b/articles/miaViz.html @@ -34,7 +34,7 @@ @@ -94,8 +94,8 @@Principal Coordinates Analysis using Bray-Curtis dissimilarity on the
hitchip1006
dataset:
Retrieving information about all available trajectories:
+library(miaTime)
+data(hitchip1006, package = "miaTime")
+tse <- hitchip1006
+tse <- transformAssay(tse, method = "relabundance")
+## Ordination with PCoA with Bray-Curtis dissimilarity
+tse <- runMDS(tse, FUN = vegan::vegdist, method = "bray", name = "PCoA_BC",
+ assay.type = "relabundance", na.rm = TRUE)
+# plot
+p <- plotReducedDim(tse, dimred = "PCoA_BC")
+p
Retrieving information about all available trajectories:
+
library(dplyr)
-#>
-#> Attaching package: 'dplyr'
-#> The following objects are masked from 'package:mia':
-#>
-#> full_join, inner_join, left_join, right_join
-#> The following objects are masked from 'package:Biostrings':
-#>
-#> collapse, intersect, setdiff, setequal, union
-#> The following object is masked from 'package:XVector':
-#>
-#> slice
-#> The following object is masked from 'package:Biobase':
-#>
-#> combine
-#> The following objects are masked from 'package:GenomicRanges':
-#>
-#> intersect, setdiff, union
-#> The following object is masked from 'package:GenomeInfoDb':
-#>
-#> intersect
-#> The following objects are masked from 'package:IRanges':
-#>
-#> collapse, desc, intersect, setdiff, slice, union
-#> The following objects are masked from 'package:S4Vectors':
-#>
-#> first, intersect, rename, setdiff, setequal, union
-#> The following objects are masked from 'package:BiocGenerics':
-#>
-#> combine, intersect, setdiff, union
-#> The following object is masked from 'package:matrixStats':
-#>
-#> count
-#> The following objects are masked from 'package:stats':
-#>
-#> filter, lag
-#> The following objects are masked from 'package:base':
-#>
-#> intersect, setdiff, setequal, union
# List subjects with two time points
selected.subjects <- names(which(table(tse$subject)==2))
# Subjects counts per number of time points available in the data
table(table(tse$subject)) %>% as.data.frame() %>%
- rename(Timepoints=Var1, Subjects=Freq)
-#> Timepoints Subjects
-#> 1 1 928
-#> 2 2 40
-#> 3 3 23
-#> 4 4 1
-#> 5 5 14
Lets look at all trajectories having two time points in the data:
-+-# plot p + geom_path(aes(x=X1, y=X2, group=subject), arrow=arrow(length = unit(0.1, "inches")), @@ -461,1020 +428,12 @@
Serial data ordination and traj subject %in% selected.subjects) %>% arrange(time))+ labs(title = "All trajectories with two time points")+ theme(plot.title = element_text(hjust = 0.5))
Filtering the two time point trajectories by divergence and displaying top 10%:
-@@ -64,6 +64,10 @@+-library(miaTime) # calculating step wise divergence based on the microbial profiles tse <- getStepwiseDivergence(tse, group = "subject", time_field = "time") -#> Merging with full join... -#> 1/1006 -2/1006 -3/1006 -4/1006 -5/1006 -6/1006 -7/1006 -8/1006 -9/1006 -10/1006 -11/1006 -12/1006 -13/1006 -14/1006 -15/1006 -16/1006 -17/1006 -18/1006 -19/1006 -20/1006 -21/1006 -22/1006 -23/1006 -24/1006 -25/1006 -26/1006 -27/1006 -28/1006 -29/1006 -30/1006 -31/1006 -32/1006 -33/1006 -34/1006 -35/1006 -36/1006 -37/1006 -38/1006 -39/1006 -40/1006 -41/1006 -42/1006 -43/1006 -44/1006 -45/1006 -46/1006 -47/1006 -48/1006 -49/1006 -50/1006 -51/1006 -52/1006 -53/1006 -54/1006 -55/1006 -56/1006 -57/1006 -58/1006 -59/1006 -60/1006 -61/1006 -62/1006 -63/1006 -64/1006 -65/1006 -66/1006 -67/1006 -68/1006 -69/1006 -70/1006 -71/1006 -72/1006 -73/1006 -74/1006 -75/1006 -76/1006 -77/1006 -78/1006 -79/1006 -80/1006 -81/1006 -82/1006 -83/1006 -84/1006 -85/1006 -86/1006 -87/1006 -88/1006 -89/1006 -90/1006 -91/1006 -92/1006 -93/1006 -94/1006 -95/1006 -96/1006 -97/1006 -98/1006 -99/1006 -100/1006 -101/1006 -102/1006 -103/1006 -104/1006 -105/1006 -106/1006 -107/1006 -108/1006 -109/1006 -110/1006 -111/1006 -112/1006 -113/1006 -114/1006 -115/1006 -116/1006 -117/1006 -118/1006 -119/1006 -120/1006 -121/1006 -122/1006 -123/1006 -124/1006 -125/1006 -126/1006 -127/1006 -128/1006 -129/1006 -130/1006 -131/1006 -132/1006 -133/1006 -134/1006 -135/1006 -136/1006 -137/1006 -138/1006 -139/1006 -140/1006 -141/1006 -142/1006 -143/1006 -144/1006 -145/1006 -146/1006 -147/1006 -148/1006 -149/1006 -150/1006 -151/1006 -152/1006 -153/1006 -154/1006 -155/1006 -156/1006 -157/1006 -158/1006 -159/1006 -160/1006 -161/1006 -162/1006 -163/1006 -164/1006 -165/1006 -166/1006 -167/1006 -168/1006 -169/1006 -170/1006 -171/1006 -172/1006 -173/1006 -174/1006 -175/1006 -176/1006 -177/1006 -178/1006 -179/1006 -180/1006 -181/1006 -182/1006 -183/1006 -184/1006 -185/1006 -186/1006 -187/1006 -188/1006 -189/1006 -190/1006 -191/1006 -192/1006 -193/1006 -194/1006 -195/1006 -196/1006 -197/1006 -198/1006 -199/1006 -200/1006 -201/1006 -202/1006 -203/1006 -204/1006 -205/1006 -206/1006 -207/1006 -208/1006 -209/1006 -210/1006 -211/1006 -212/1006 -213/1006 -214/1006 -215/1006 -216/1006 -217/1006 -218/1006 -219/1006 -220/1006 -221/1006 -222/1006 -223/1006 -224/1006 -225/1006 -226/1006 -227/1006 -228/1006 -229/1006 -230/1006 -231/1006 -232/1006 -233/1006 -234/1006 -235/1006 -236/1006 -237/1006 -238/1006 -239/1006 -240/1006 -241/1006 -242/1006 -243/1006 -244/1006 -245/1006 -246/1006 -247/1006 -248/1006 -249/1006 -250/1006 -251/1006 -252/1006 -253/1006 -254/1006 -255/1006 -256/1006 -257/1006 -258/1006 -259/1006 -260/1006 -261/1006 -262/1006 -263/1006 -264/1006 -265/1006 -266/1006 -267/1006 -268/1006 -269/1006 -270/1006 -271/1006 -272/1006 -273/1006 -274/1006 -275/1006 -276/1006 -277/1006 -278/1006 -279/1006 -280/1006 -281/1006 -282/1006 -283/1006 -284/1006 -285/1006 -286/1006 -287/1006 -288/1006 -289/1006 -290/1006 -291/1006 -292/1006 -293/1006 -294/1006 -295/1006 -296/1006 -297/1006 -298/1006 -299/1006 -300/1006 -301/1006 -302/1006 -303/1006 -304/1006 -305/1006 -306/1006 -307/1006 -308/1006 -309/1006 -310/1006 -311/1006 -312/1006 -313/1006 -314/1006 -315/1006 -316/1006 -317/1006 -318/1006 -319/1006 -320/1006 -321/1006 -322/1006 -323/1006 -324/1006 -325/1006 -326/1006 -327/1006 -328/1006 -329/1006 -330/1006 -331/1006 -332/1006 -333/1006 -334/1006 -335/1006 -336/1006 -337/1006 -338/1006 -339/1006 -340/1006 -341/1006 -342/1006 -343/1006 -344/1006 -345/1006 -346/1006 -347/1006 -348/1006 -349/1006 -350/1006 -351/1006 -352/1006 -353/1006 -354/1006 -355/1006 -356/1006 -357/1006 -358/1006 -359/1006 -360/1006 -361/1006 -362/1006 -363/1006 -364/1006 -365/1006 -366/1006 -367/1006 -368/1006 -369/1006 -370/1006 -371/1006 -372/1006 -373/1006 -374/1006 -375/1006 -376/1006 -377/1006 -378/1006 -379/1006 -380/1006 -381/1006 -382/1006 -383/1006 -384/1006 -385/1006 -386/1006 -387/1006 -388/1006 -389/1006 -390/1006 -391/1006 -392/1006 -393/1006 -394/1006 -395/1006 -396/1006 -397/1006 -398/1006 -399/1006 -400/1006 -401/1006 -402/1006 -403/1006 -404/1006 -405/1006 -406/1006 -407/1006 -408/1006 -409/1006 -410/1006 -411/1006 -412/1006 -413/1006 -414/1006 -415/1006 -416/1006 -417/1006 -418/1006 -419/1006 -420/1006 -421/1006 -422/1006 -423/1006 -424/1006 -425/1006 -426/1006 -427/1006 -428/1006 -429/1006 -430/1006 -431/1006 -432/1006 -433/1006 -434/1006 -435/1006 -436/1006 -437/1006 -438/1006 -439/1006 -440/1006 -441/1006 -442/1006 -443/1006 -444/1006 -445/1006 -446/1006 -447/1006 -448/1006 -449/1006 -450/1006 -451/1006 -452/1006 -453/1006 -454/1006 -455/1006 -456/1006 -457/1006 -458/1006 -459/1006 -460/1006 -461/1006 -462/1006 -463/1006 -464/1006 -465/1006 -466/1006 -467/1006 -468/1006 -469/1006 -470/1006 -471/1006 -472/1006 -473/1006 -474/1006 -475/1006 -476/1006 -477/1006 -478/1006 -479/1006 -480/1006 -481/1006 -482/1006 -483/1006 -484/1006 -485/1006 -486/1006 -487/1006 -488/1006 -489/1006 -490/1006 -491/1006 -492/1006 -493/1006 -494/1006 -495/1006 -496/1006 -497/1006 -498/1006 -499/1006 -500/1006 -501/1006 -502/1006 -503/1006 -504/1006 -505/1006 -506/1006 -507/1006 -508/1006 -509/1006 -510/1006 -511/1006 -512/1006 -513/1006 -514/1006 -515/1006 -516/1006 -517/1006 -518/1006 -519/1006 -520/1006 -521/1006 -522/1006 -523/1006 -524/1006 -525/1006 -526/1006 -527/1006 -528/1006 -529/1006 -530/1006 -531/1006 -532/1006 -533/1006 -534/1006 -535/1006 -536/1006 -537/1006 -538/1006 -539/1006 -540/1006 -541/1006 -542/1006 -543/1006 -544/1006 -545/1006 -546/1006 -547/1006 -548/1006 -549/1006 -550/1006 -551/1006 -552/1006 -553/1006 -554/1006 -555/1006 -556/1006 -557/1006 -558/1006 -559/1006 -560/1006 -561/1006 -562/1006 -563/1006 -564/1006 -565/1006 -566/1006 -567/1006 -568/1006 -569/1006 -570/1006 -571/1006 -572/1006 -573/1006 -574/1006 -575/1006 -576/1006 -577/1006 -578/1006 -579/1006 -580/1006 -581/1006 -582/1006 -583/1006 -584/1006 -585/1006 -586/1006 -587/1006 -588/1006 -589/1006 -590/1006 -591/1006 -592/1006 -593/1006 -594/1006 -595/1006 -596/1006 -597/1006 -598/1006 -599/1006 -600/1006 -601/1006 -602/1006 -603/1006 -604/1006 -605/1006 -606/1006 -607/1006 -608/1006 -609/1006 -610/1006 -611/1006 -612/1006 -613/1006 -614/1006 -615/1006 -616/1006 -617/1006 -618/1006 -619/1006 -620/1006 -621/1006 -622/1006 -623/1006 -624/1006 -625/1006 -626/1006 -627/1006 -628/1006 -629/1006 -630/1006 -631/1006 -632/1006 -633/1006 -634/1006 -635/1006 -636/1006 -637/1006 -638/1006 -639/1006 -640/1006 -641/1006 -642/1006 -643/1006 -644/1006 -645/1006 -646/1006 -647/1006 -648/1006 -649/1006 -650/1006 -651/1006 -652/1006 -653/1006 -654/1006 -655/1006 -656/1006 -657/1006 -658/1006 -659/1006 -660/1006 -661/1006 -662/1006 -663/1006 -664/1006 -665/1006 -666/1006 -667/1006 -668/1006 -669/1006 -670/1006 -671/1006 -672/1006 -673/1006 -674/1006 -675/1006 -676/1006 -677/1006 -678/1006 -679/1006 -680/1006 -681/1006 -682/1006 -683/1006 -684/1006 -685/1006 -686/1006 -687/1006 -688/1006 -689/1006 -690/1006 -691/1006 -692/1006 -693/1006 -694/1006 -695/1006 -696/1006 -697/1006 -698/1006 -699/1006 -700/1006 -701/1006 -702/1006 -703/1006 -704/1006 -705/1006 -706/1006 -707/1006 -708/1006 -709/1006 -710/1006 -711/1006 -712/1006 -713/1006 -714/1006 -715/1006 -716/1006 -717/1006 -718/1006 -719/1006 -720/1006 -721/1006 -722/1006 -723/1006 -724/1006 -725/1006 -726/1006 -727/1006 -728/1006 -729/1006 -730/1006 -731/1006 -732/1006 -733/1006 -734/1006 -735/1006 -736/1006 -737/1006 -738/1006 -739/1006 -740/1006 -741/1006 -742/1006 -743/1006 -744/1006 -745/1006 -746/1006 -747/1006 -748/1006 -749/1006 -750/1006 -751/1006 -752/1006 -753/1006 -754/1006 -755/1006 -756/1006 -757/1006 -758/1006 -759/1006 -760/1006 -761/1006 -762/1006 -763/1006 -764/1006 -765/1006 -766/1006 -767/1006 -768/1006 -769/1006 -770/1006 -771/1006 -772/1006 -773/1006 -774/1006 -775/1006 -776/1006 -777/1006 -778/1006 -779/1006 -780/1006 -781/1006 -782/1006 -783/1006 -784/1006 -785/1006 -786/1006 -787/1006 -788/1006 -789/1006 -790/1006 -791/1006 -792/1006 -793/1006 -794/1006 -795/1006 -796/1006 -797/1006 -798/1006 -799/1006 -800/1006 -801/1006 -802/1006 -803/1006 -804/1006 -805/1006 -806/1006 -807/1006 -808/1006 -809/1006 -810/1006 -811/1006 -812/1006 -813/1006 -814/1006 -815/1006 -816/1006 -817/1006 -818/1006 -819/1006 -820/1006 -821/1006 -822/1006 -823/1006 -824/1006 -825/1006 -826/1006 -827/1006 -828/1006 -829/1006 -830/1006 -831/1006 -832/1006 -833/1006 -834/1006 -835/1006 -836/1006 -837/1006 -838/1006 -839/1006 -840/1006 -841/1006 -842/1006 -843/1006 -844/1006 -845/1006 -846/1006 -847/1006 -848/1006 -849/1006 -850/1006 -851/1006 -852/1006 -853/1006 -854/1006 -855/1006 -856/1006 -857/1006 -858/1006 -859/1006 -860/1006 -861/1006 -862/1006 -863/1006 -864/1006 -865/1006 -866/1006 -867/1006 -868/1006 -869/1006 -870/1006 -871/1006 -872/1006 -873/1006 -874/1006 -875/1006 -876/1006 -877/1006 -878/1006 -879/1006 -880/1006 -881/1006 -882/1006 -883/1006 -884/1006 -885/1006 -886/1006 -887/1006 -888/1006 -889/1006 -890/1006 -891/1006 -892/1006 -893/1006 -894/1006 -895/1006 -896/1006 -897/1006 -898/1006 -899/1006 -900/1006 -901/1006 -902/1006 -903/1006 -904/1006 -905/1006 -906/1006 -907/1006 -908/1006 -909/1006 -910/1006 -911/1006 -912/1006 -913/1006 -914/1006 -915/1006 -916/1006 -917/1006 -918/1006 -919/1006 -920/1006 -921/1006 -922/1006 -923/1006 -924/1006 -925/1006 -926/1006 -927/1006 -928/1006 -929/1006 -930/1006 -931/1006 -932/1006 -933/1006 -934/1006 -935/1006 -936/1006 -937/1006 -938/1006 -939/1006 -940/1006 -941/1006 -942/1006 -943/1006 -944/1006 -945/1006 -946/1006 -947/1006 -948/1006 -949/1006 -950/1006 -951/1006 -952/1006 -953/1006 -954/1006 -955/1006 -956/1006 -957/1006 -958/1006 -959/1006 -960/1006 -961/1006 -962/1006 -963/1006 -964/1006 -965/1006 -966/1006 -967/1006 -968/1006 -969/1006 -970/1006 -971/1006 -972/1006 -973/1006 -974/1006 -975/1006 -976/1006 -977/1006 -978/1006 -979/1006 -980/1006 -981/1006 -982/1006 -983/1006 -984/1006 -985/1006 -986/1006 -987/1006 -988/1006 -989/1006 -990/1006 -991/1006 -992/1006 -993/1006 -994/1006 -995/1006 -996/1006 -997/1006 -998/1006 -999/1006 -1000/1006 -1001/1006 -1002/1006 -1003/1006 -1004/1006 -1005/1006 -1006/1006 # retrieving the top 10% divergent subjects having two time points top.selected.subjects <- subset(data.frame(reducedDim(tse), colData(tse)), subject %in% selected.subjects) %>% @@ -1495,10 +454,9 @@
Serial data ordination and traj labs(title = "Top 10% divergent trajectories from time point one to two")+ scale_color_gradient2(low="white", high="red")+ theme(plot.title = element_text(hjust = 0.5))
Plotting an example of the trajectory with the maximum total divergence:
-+-# Get subject with the maximum total divergence selected.subject <- data.frame(reducedDim(tse), colData(tse)) %>% group_by(subject) %>% @@ -1511,7 +469,6 @@
Serial data ordination and traj arrow=arrow(length = unit(0.1, "inches")))+ labs(title = "Longest trajectory by divergence")+ theme(plot.title = element_text(hjust = 0.5))
More examples and materials are available at Orchestrating Microbiome Analysis (Lahti, Shetty, and Ernst 2021).
@@ -1519,7 +476,7 @@Serial data ordination and traj
Session info
-++#> [1] RColorBrewer_1.1-3 jsonlite_1.8.7 +#> [3] magrittr_2.0.3 ggbeeswarm_0.7.2 +#> [5] farver_2.1.1 rmarkdown_2.25 +#> [7] fs_1.6.3 zlibbioc_1.47.0 +#> [9] ragg_1.2.5 vctrs_0.6.3 +#> [11] memoise_2.0.1 DelayedMatrixStats_1.23.4 +#> [13] RCurl_1.98-1.12 ggtree_3.9.1 +#> [15] htmltools_0.5.6 S4Arrays_1.1.6 +#> [17] BiocNeighbors_1.19.0 gridGraphics_0.5-1 +#> [19] SparseArray_1.1.12 sass_0.4.7 +#> [21] bslib_0.5.1 desc_1.4.2 +#> [23] plyr_1.8.9 DECIPHER_2.29.2 +#> [25] cachem_1.0.8 igraph_1.5.1 +#> [27] lifecycle_1.0.3 pkgconfig_2.0.3 +#> [29] rsvd_1.0.5 Matrix_1.6-1.1 +#> [31] R6_2.5.1 fastmap_1.1.1 +#> [33] GenomeInfoDbData_1.2.10 aplot_0.2.1 +#> [35] digest_0.6.33 ggnewscale_0.4.9 +#> [37] colorspace_2.1-0 rprojroot_2.0.3 +#> [39] irlba_2.3.5.1 textshaping_0.3.6 +#> [41] RSQLite_2.3.1 vegan_2.6-4 +#> [43] beachmat_2.17.16 labeling_0.4.3 +#> [45] fansi_1.0.4 polyclip_1.10-6 +#> [47] abind_1.4-5 mgcv_1.9-0 +#> [49] compiler_4.3.1 bit64_4.0.5 +#> [51] withr_2.5.1 BiocParallel_1.35.4 +#> [53] viridis_0.6.4 DBI_1.1.3 +#> [55] ggforce_0.4.1 MASS_7.3-60 +#> [57] DelayedArray_0.27.10 bluster_1.11.4 +#> [59] permute_0.9-7 tools_4.3.1 +#> [61] vipor_0.4.5 beeswarm_0.4.0 +#> [63] ape_5.7-1 glue_1.6.2 +#> [65] nlme_3.1-163 grid_4.3.1 +#> [67] cluster_2.1.4 reshape2_1.4.4 +#> [69] generics_0.1.3 gtable_0.3.4 +#> [71] tidyr_1.3.0 BiocSingular_1.17.1 +#> [73] tidygraph_1.2.3 ScaledMatrix_1.9.1 +#> [75] utf8_1.2.3 ggrepel_0.9.3 +#> [77] pillar_1.9.0 stringr_1.5.0 +#> [79] yulab.utils_0.1.0 splines_4.3.1 +#> [81] dplyr_1.1.3 tweenr_2.0.2 +#> [83] treeio_1.25.4 lattice_0.21-8 +#> [85] bit_4.0.5 tidyselect_1.2.0 +#> [87] DirichletMultinomial_1.43.0 knitr_1.44 +#> [89] gridExtra_2.3 bookdown_0.35 +#> [91] xfun_0.40 graphlayouts_1.0.1 +#> [93] stringi_1.7.12 ggfun_0.1.3 +#> [95] lazyeval_0.2.2 yaml_2.3.7 +#> [97] evaluate_0.22 codetools_0.2-19 +#> [99] tibble_3.2.1 BiocManager_1.30.22 +#> [101] ggplotify_0.1.2 cli_3.6.1 +#> [103] systemfonts_1.0.4 munsell_0.5.0 +#> [105] jquerylib_0.1.4 Rcpp_1.0.11 +#> [107] parallel_4.3.1 pkgdown_2.0.7 +#> [109] blob_1.2.4 sparseMatrixStats_1.13.4 +#> [111] bitops_1.0-7 decontam_1.21.0 +#> [113] viridisLite_0.4.2 tidytree_0.4.5 +#> [115] scales_1.2.1 purrr_1.0.2 +#> [117] crayon_1.5.2 rlang_1.1.1sessionInfo() #> R version 4.3.1 (2023-06-16) #> Platform: x86_64-pc-linux-gnu (64-bit) @@ -1545,90 +502,79 @@
Session info#> [8] base #> #> other attached packages: -#> [1] dplyr_1.1.2 miaTime_0.1.21 -#> [3] scater_1.29.4 scuttle_1.11.2 -#> [5] patchwork_1.1.3 miaViz_1.9.2 -#> [7] ggraph_2.1.0 ggplot2_3.4.3 -#> [9] mia_1.9.12 MultiAssayExperiment_1.27.5 -#> [11] TreeSummarizedExperiment_2.1.4 Biostrings_2.69.2 -#> [13] XVector_0.41.1 SingleCellExperiment_1.23.0 -#> [15] SummarizedExperiment_1.31.1 Biobase_2.61.0 -#> [17] GenomicRanges_1.53.1 GenomeInfoDb_1.37.3 -#> [19] IRanges_2.35.2 S4Vectors_0.39.1 -#> [21] BiocGenerics_0.47.0 MatrixGenerics_1.13.1 -#> [23] matrixStats_1.0.0 BiocStyle_2.29.1 +#> [1] miaTime_0.1.21 scater_1.29.4 +#> [3] scuttle_1.11.2 patchwork_1.1.3 +#> [5] miaViz_1.9.3 ggraph_2.1.0 +#> [7] ggplot2_3.4.3 mia_1.9.18 +#> [9] MultiAssayExperiment_1.27.5 TreeSummarizedExperiment_2.1.4 +#> [11] Biostrings_2.69.2 XVector_0.41.1 +#> [13] SingleCellExperiment_1.23.0 SummarizedExperiment_1.31.1 +#> [15] Biobase_2.61.0 GenomicRanges_1.53.1 +#> [17] GenomeInfoDb_1.37.5 IRanges_2.35.2 +#> [19] S4Vectors_0.39.2 BiocGenerics_0.47.0 +#> [21] MatrixGenerics_1.13.1 matrixStats_1.0.0 +#> [23] BiocStyle_2.29.2 #> #> loaded via a namespace (and not attached): -#> [1] splines_4.3.1 later_1.3.1 -#> [3] bitops_1.0-7 ggplotify_0.1.2 -#> [5] tibble_3.2.1 polyclip_1.10-4 -#> [7] DirichletMultinomial_1.43.0 lifecycle_1.0.3 -#> [9] rprojroot_2.0.3 processx_3.8.2 -#> [11] lattice_0.21-8 MASS_7.3-60 -#> [13] magrittr_2.0.3 sass_0.4.7 -#> [15] rmarkdown_2.24 remotes_2.4.2.1 -#> [17] jquerylib_0.1.4 yaml_2.3.7 -#> [19] httpuv_1.6.11 sessioninfo_1.2.2 -#> [21] pkgbuild_1.4.2 DBI_1.1.3 -#> [23] RColorBrewer_1.1-3 abind_1.4-5 -#> [25] pkgload_1.3.2.1 zlibbioc_1.47.0 -#> [27] purrr_1.0.2 RCurl_1.98-1.12 -#> [29] yulab.utils_0.0.8 tweenr_2.0.2 -#> [31] GenomeInfoDbData_1.2.10 ggrepel_0.9.3 -#> [33] irlba_2.3.5.1 tidytree_0.4.5 -#> [35] vegan_2.6-4 pkgdown_2.0.7 -#> [37] permute_0.9-7 DelayedMatrixStats_1.23.4 -#> [39] codetools_0.2-19 DelayedArray_0.27.10 -#> [41] ggforce_0.4.1 tidyselect_1.2.0 -#> [43] aplot_0.2.0 farver_2.1.1 -#> [45] ScaledMatrix_1.9.1 viridis_0.6.4 -#> [47] jsonlite_1.8.7 BiocNeighbors_1.19.0 -#> [49] decontam_1.21.0 ellipsis_0.3.2 -#> [51] tidygraph_1.2.3 systemfonts_1.0.4 -#> [53] tools_4.3.1 ggnewscale_0.4.9 -#> [55] treeio_1.25.4 ragg_1.2.5 -#> [57] Rcpp_1.0.11 glue_1.6.2 -#> [59] gridExtra_2.3 SparseArray_1.1.11 -#> [61] xfun_0.40 mgcv_1.9-0 -#> [63] usethis_2.2.2 withr_2.5.0 -#> [65] BiocManager_1.30.22 fastmap_1.1.1 -#> [67] bluster_1.11.4 fansi_1.0.4 -#> [69] callr_3.7.3 digest_0.6.33 -#> [71] rsvd_1.0.5 R6_2.5.1 -#> [73] mime_0.12 gridGraphics_0.5-1 -#> [75] textshaping_0.3.6 colorspace_2.1-0 -#> [77] RSQLite_2.3.1 utf8_1.2.3 -#> [79] tidyr_1.3.0 generics_0.1.3 -#> [81] DECIPHER_2.29.0 prettyunits_1.1.1 -#> [83] graphlayouts_1.0.0 htmlwidgets_1.6.2 -#> [85] S4Arrays_1.1.5 pkgconfig_2.0.3 -#> [87] gtable_0.3.4 blob_1.2.4 -#> [89] htmltools_0.5.6 profvis_0.3.8 -#> [91] bookdown_0.35 scales_1.2.1 -#> [93] ggfun_0.1.2 knitr_1.43 -#> [95] reshape2_1.4.4 nlme_3.1-163 -#> [97] cachem_1.0.8 stringr_1.5.0 -#> [99] parallel_4.3.1 miniUI_0.1.1.1 -#> [101] vipor_0.4.5 desc_1.4.2 -#> [103] pillar_1.9.0 grid_4.3.1 -#> [105] vctrs_0.6.3 urlchecker_1.0.1 -#> [107] promises_1.2.1 BiocSingular_1.17.1 -#> [109] beachmat_2.17.15 xtable_1.8-4 -#> [111] cluster_2.1.4 beeswarm_0.4.0 -#> [113] evaluate_0.21 cli_3.6.1 -#> [115] compiler_4.3.1 rlang_1.1.1 -#> [117] crayon_1.5.2 labeling_0.4.3 -#> [119] ps_1.7.5 plyr_1.8.8 -#> [121] fs_1.6.3 ggbeeswarm_0.7.2 -#> [123] stringi_1.7.12 viridisLite_0.4.2 -#> [125] BiocParallel_1.35.4 munsell_0.5.0 -#> [127] lazyeval_0.2.2 devtools_2.4.5 -#> [129] Matrix_1.6-1 sparseMatrixStats_1.13.4 -#> [131] bit64_4.0.5 shiny_1.7.5 -#> [133] highr_0.10 igraph_1.5.1 -#> [135] memoise_2.0.1 bslib_0.5.1 -#> [137] ggtree_3.9.1 bit_4.0.5 -#> [139] ape_5.7-1
@@ -58,6 +58,10 @@References diff --git a/articles/miaViz_files/figure-html/MDS-1.png b/articles/miaViz_files/figure-html/MDS-1.png deleted file mode 100644 index d67eb1cb..00000000 Binary files a/articles/miaViz_files/figure-html/MDS-1.png and /dev/null differ diff --git a/articles/miaViz_files/figure-html/unnamed-chunk-15-1.png b/articles/miaViz_files/figure-html/unnamed-chunk-15-1.png index 1201978e..b0ff6f7e 100644 Binary files a/articles/miaViz_files/figure-html/unnamed-chunk-15-1.png and b/articles/miaViz_files/figure-html/unnamed-chunk-15-1.png differ diff --git a/articles/miaViz_files/figure-html/unnamed-chunk-17-1.png b/articles/miaViz_files/figure-html/unnamed-chunk-17-1.png index be1ef8be..8ca33cd8 100644 Binary files a/articles/miaViz_files/figure-html/unnamed-chunk-17-1.png and b/articles/miaViz_files/figure-html/unnamed-chunk-17-1.png differ diff --git a/articles/miaViz_files/figure-html/unnamed-chunk-26-1.png b/articles/miaViz_files/figure-html/unnamed-chunk-26-1.png deleted file mode 100644 index 933c7422..00000000 Binary files a/articles/miaViz_files/figure-html/unnamed-chunk-26-1.png and /dev/null differ diff --git a/articles/miaViz_files/figure-html/unnamed-chunk-27-1.png b/articles/miaViz_files/figure-html/unnamed-chunk-27-1.png deleted file mode 100644 index 5893ff6f..00000000 Binary files a/articles/miaViz_files/figure-html/unnamed-chunk-27-1.png and /dev/null differ diff --git a/articles/miaViz_files/figure-html/unnamed-chunk-28-1.png b/articles/miaViz_files/figure-html/unnamed-chunk-28-1.png deleted file mode 100644 index 0cc80604..00000000 Binary files a/articles/miaViz_files/figure-html/unnamed-chunk-28-1.png and /dev/null differ diff --git a/authors.html b/authors.html index 59bfed0c..a09e95ae 100644 --- a/authors.html +++ b/authors.html @@ -17,7 +17,7 @@
Authors
Basil Courbayre. Contributor.
++ + diff --git a/pkgdown.yml b/pkgdown.yml index 25dcc606..6958a0c0 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,5 +3,5 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: miaViz: miaViz.html -last_built: 2023-08-30T13:32Z +last_built: 2023-10-02T15:32Z diff --git a/reference/Rplot008.png b/reference/Rplot008.png index e07c8bb8..6d6b3b42 100644 Binary files a/reference/Rplot008.png and b/reference/Rplot008.png differ diff --git a/reference/index.html b/reference/index.html index dc893eaa..6f9c0243 100644 --- a/reference/index.html +++ b/reference/index.html @@ -17,7 +17,7 @@@@ -69,13 +73,13 @@diff --git a/index.html b/index.html index 8d8d48b6..6bc0310a 100644 --- a/index.html +++ b/index.html @@ -36,7 +36,7 @@Citation
Borman T, Ernst F, Lahti L (2023). miaViz: Microbiome Analysis Plotting and Visualization. -R package version 1.9.2. +R package version 1.9.3.
@Manual{, title = {miaViz: Microbiome Analysis Plotting and Visualization}, author = {Tuomas Borman and Felix G.M. Ernst and Leo Lahti}, year = {2023}, - note = {R package version 1.9.2}, + note = {R package version 1.9.3}, }All functions
plotAbundanceDensity()
+ Plot abundance density
+ + +Plot RDA or CCA object
diff --git a/reference/mia-datasets.html b/reference/mia-datasets.html index 5c7bfe20..688bb058 100644 --- a/reference/mia-datasets.html +++ b/reference/mia-datasets.html @@ -18,7 +18,7 @@ diff --git a/reference/mia-plot-args.html b/reference/mia-plot-args.html index 8bfbb4d7..287702ab 100644 --- a/reference/mia-plot-args.html +++ b/reference/mia-plot-args.html @@ -18,7 +18,7 @@ diff --git a/reference/miaViz-package.html b/reference/miaViz-package.html index e44d3009..e95b16c0 100644 --- a/reference/miaViz-package.html +++ b/reference/miaViz-package.html @@ -19,7 +19,7 @@ diff --git a/reference/plotAbundance.html b/reference/plotAbundance.html index 62162b28..b8ea18c5 100644 --- a/reference/plotAbundance.html +++ b/reference/plotAbundance.html @@ -20,7 +20,7 @@ diff --git a/reference/plotAbundanceDensity-1.png b/reference/plotAbundanceDensity-1.png index ac8bc9bb..8dbac73a 100644 Binary files a/reference/plotAbundanceDensity-1.png and b/reference/plotAbundanceDensity-1.png differ diff --git a/reference/plotAbundanceDensity-2.png b/reference/plotAbundanceDensity-2.png index 69a45223..e2123228 100644 Binary files a/reference/plotAbundanceDensity-2.png and b/reference/plotAbundanceDensity-2.png differ diff --git a/reference/plotAbundanceDensity-6.png b/reference/plotAbundanceDensity-6.png index 8df46390..5d4019ed 100644 Binary files a/reference/plotAbundanceDensity-6.png and b/reference/plotAbundanceDensity-6.png differ diff --git a/reference/plotAbundanceDensity-7.png b/reference/plotAbundanceDensity-7.png index 84526cf2..004c41de 100644 Binary files a/reference/plotAbundanceDensity-7.png and b/reference/plotAbundanceDensity-7.png differ diff --git a/reference/plotAbundanceDensity.html b/reference/plotAbundanceDensity.html index 70890023..82310311 100644 --- a/reference/plotAbundanceDensity.html +++ b/reference/plotAbundanceDensity.html @@ -17,7 +17,7 @@ diff --git a/reference/plotCCA-1.png b/reference/plotCCA-1.png new file mode 100644 index 00000000..e5fb495e Binary files /dev/null and b/reference/plotCCA-1.png differ diff --git a/reference/plotCCA-2.png b/reference/plotCCA-2.png new file mode 100644 index 00000000..32b02323 Binary files /dev/null and b/reference/plotCCA-2.png differ diff --git a/reference/plotCCA-3.png b/reference/plotCCA-3.png new file mode 100644 index 00000000..e9053257 Binary files /dev/null and b/reference/plotCCA-3.png differ diff --git a/reference/plotCCA-4.png b/reference/plotCCA-4.png new file mode 100644 index 00000000..1c05ea29 Binary files /dev/null and b/reference/plotCCA-4.png differ diff --git a/reference/plotCCA-5.png b/reference/plotCCA-5.png new file mode 100644 index 00000000..b31a7873 Binary files /dev/null and b/reference/plotCCA-5.png differ diff --git a/reference/plotCCA-6.png b/reference/plotCCA-6.png new file mode 100644 index 00000000..3464c38c Binary files /dev/null and b/reference/plotCCA-6.png differ diff --git a/reference/plotCCA.html b/reference/plotCCA.html new file mode 100644 index 00000000..78c260b8 --- /dev/null +++ b/reference/plotCCA.html @@ -0,0 +1,335 @@ + + Plot RDA or CCA object — plotCCA • miaViz + + +++ + + + + + + + diff --git a/reference/plotColTile.html b/reference/plotColTile.html index dc2b4540..decbaae7 100644 --- a/reference/plotColTile.html +++ b/reference/plotColTile.html @@ -19,7 +19,7 @@ diff --git a/reference/plotDMN-1.png b/reference/plotDMN-1.png index 9d194570..e1776dd6 100644 Binary files a/reference/plotDMN-1.png and b/reference/plotDMN-1.png differ diff --git a/reference/plotDMN.html b/reference/plotDMN.html index 01cca596..b0acc171 100644 --- a/reference/plotDMN.html +++ b/reference/plotDMN.html @@ -17,7 +17,7 @@ diff --git a/reference/plotGraph-1.png b/reference/plotGraph-1.png index ee7f6180..f5552e8e 100644 Binary files a/reference/plotGraph-1.png and b/reference/plotGraph-1.png differ diff --git a/reference/plotGraph-6.png b/reference/plotGraph-6.png index 39143a3b..c59adfca 100644 Binary files a/reference/plotGraph-6.png and b/reference/plotGraph-6.png differ diff --git a/reference/plotGraph-7.png b/reference/plotGraph-7.png index edd68fe8..11c06dd3 100644 Binary files a/reference/plotGraph-7.png and b/reference/plotGraph-7.png differ diff --git a/reference/plotGraph-8.png b/reference/plotGraph-8.png index 87fee6e5..1bf0c4d3 100644 Binary files a/reference/plotGraph-8.png and b/reference/plotGraph-8.png differ diff --git a/reference/plotGraph.html b/reference/plotGraph.html index 159c95fe..63f96293 100644 --- a/reference/plotGraph.html +++ b/reference/plotGraph.html @@ -19,7 +19,7 @@ diff --git a/reference/plotPrevalence.html b/reference/plotPrevalence.html index 9916b135..83ef3a65 100644 --- a/reference/plotPrevalence.html +++ b/reference/plotPrevalence.html @@ -18,7 +18,7 @@ @@ -227,7 +227,7 @@+ + + + ++ + +++ +++ +Plot RDA or CCA object
+ ++plotCCA.Rd
++ ++
plotRDA
andplotCCA
create an RDA/CCA plot starting from the +output ofCCA and RDA
functions, two common methods +for supervised ordination of microbiome data.++ ++plotCCA(object, ...) + +# S4 method for SingleCellExperiment +plotCCA(object, dimred, ...) + +# S4 method for matrix +plotCCA(object, ...) + +plotRDA(object, ...) + +# S4 method for SingleCellExperiment +plotRDA( + object, + dimred, + add.ellipse = TRUE, + ellipse.alpha = 0.2, + ellipse.linewidth = 0.1, + ellipse.linetype = 1, + vec.size = 0.5, + vec.color = vec.colour, + vec.colour = "black", + vec.linetype = 1, + arrow.size = 0.25, + label.color = label.colour, + label.colour = "black", + label.size = 4, + vec.text = TRUE, + repel.labels = TRUE, + sep.group = "‒", + repl.underscore = " ", + add.significance = TRUE, + add.expl.var = TRUE, + add.vectors = TRUE, + parse.labels = TRUE, + ... +) + +# S4 method for matrix +plotRDA(object, ...)
++Arguments
+
- object
+- + + +
a +
TreeSummarizedExperiment
+or a matrix of weights. The latter is returned as output fromcalculateRDA
.- ...
+- + + +
additional parameters for plotting, inherited from +
plotReducedDim
, +geom_label
and +geom_label_repel
.- dimred
+- + + +
A string or integer scalar indicating the reduced dimension to +plot. This is the output of
runRDA
and resides in +reducedDim(tse, dimred)
.- add.ellipse
+- + + +
One of
c(TRUE, FALSE, "fill", "colour", "color")
, +indicating whether ellipses should be present, absent, filled or colored. +(default:ellipse.fill = TRUE
)- ellipse.alpha
+- + + +
Number between 0 and 1 to adjust the opacity of ellipses. +(default:
ellipse.alpha = 0.2
)- ellipse.linewidth
+- + + +
Number specifying the size of ellipses. +(default:
ellipse.linewidth = 0.1
)- ellipse.linetype
+- + + +
Discrete number specifying the style of ellipses. +(default:
ellipse.linetype = 1
)- vec.size
+- + + +
Number specifying the size of vectors. +(default:
vec.size = 0.5
)- vec.color
+- + + +
Alias for
vec.colour
.- vec.colour
+- + + +
String specifying the colour of vectors. +(default:
vec.color = "black"
)- vec.linetype
+- + + +
Discrete number specifying the style of vector lines. +(default:
vec.linetype = 1
)- arrow.size
+- + + +
Number specifying the size of arrows. +(defaults:
arrow.size = 0.25
)- label.color
+- + + +
Alias for
label.colour
.- label.colour
+- + + +
String specifying the colour of text and labels. +(default:
label.color = "black"
)- label.size
+- + + +
Number specifying the size of text and labels. +(default:
label.size = 4
)- vec.text
+- + + +
TRUE or FALSE, should text instead of labels be used to label vectors. +(default:
vec.text = TRUE
)- repel.labels
+- + + +
TRUE or FALSE, should labels be repelled. +(default:
repel.labels = TRUE
)- sep.group
+- + + +
String specifying the separator used in the labels. +(default:
sep.group = "\U2012"
)- repl.underscore
+- + + +
String used to replace underscores in the labels. +(default:
repl.underscore = " "
)- add.significance
+- + + +
TRUE or FALSE, should explained variance and p-value +appear in the labels. (default:
add.significance = TRUE
)- add.expl.var
+- + + +
TRUE or FALSE, should explained variance appear on the +coordinate axes. (default:
add.expl.var = TRUE
)- add.vectors
+- + + +
TRUE or FALSE, should vectors appear in the plot. +(default:
add.vectors = TRUE
)- parse.labels
+- + +
TRUE or FALSE, should labels be parsed. +(default:
parse.labels = TRUE
)++Value
+ + +A
+ggplot2
object++ +Details
++
plotRDA
andplotCCA
create an RDA/CCA plot starting from the +output ofCCA and RDA
functions, two common methods +for supervised ordination of microbiome data. Either a +TreeSummarizedExperiment
+or a matrix object is supported as input. When the input is a +TreeSummarizedExperiment, this should contain the output of runRDA +in the reducedDim slot and the argumentdimred
needs to be defined. +When the input is a matrix, this should be returned as output from +calculateRDA. However, the first method is recommended because it provides +the option to adjust aesthetics to the colData variables through the +arguments inherited fromplotReducedDim
.++Examples
++# Load dataset +library(miaViz) +data("enterotype", package = "mia") +tse <- enterotype + +# Run RDA and store results into TreeSE +tse <- runRDA(tse, + formula = assay ~ ClinicalStatus + Gender + Age, + FUN = vegan::vegdist, + distance = "bray", + na.action = na.exclude) + +# Create RDA plot coloured by variable +plotRDA(tse, "RDA", + colour_by = "ClinicalStatus") +#> Warning: Removed 243 rows containing non-finite values (`stat_ellipse()`). +#> Too few points to calculate an ellipse +#> Too few points to calculate an ellipse +#> Warning: Removed 243 rows containing missing values (`geom_point()`). + + +# Create RDA plot with empty ellipses +plotRDA(tse, "RDA", + colour_by = "ClinicalStatus", + add.ellipse = "colour") +#> Warning: Removed 243 rows containing non-finite values (`stat_ellipse()`). +#> Too few points to calculate an ellipse +#> Too few points to calculate an ellipse +#> Warning: Removed 243 rows containing missing values (`geom_point()`). + + +# Create RDA plot with text encased in labels +plotRDA(tse, "RDA", + colour_by = "ClinicalStatus", + vec.text = FALSE) +#> Warning: Removed 243 rows containing non-finite values (`stat_ellipse()`). +#> Too few points to calculate an ellipse +#> Too few points to calculate an ellipse +#> Warning: Removed 243 rows containing missing values (`geom_point()`). + + +# Create RDA plot without repelling text +plotRDA(tse, "RDA", + colour_by = "ClinicalStatus", + repel.labels = FALSE) +#> Warning: Removed 243 rows containing non-finite values (`stat_ellipse()`). +#> Too few points to calculate an ellipse +#> Too few points to calculate an ellipse +#> Warning: Removed 243 rows containing missing values (`geom_point()`). + + +# Create RDA plot without vectors +plotRDA(tse, "RDA", + colour_by = "ClinicalStatus", + add.vectors = FALSE) +#> Warning: 'add.vectors' is FALSE, so other arguments for vectors and labels will be disregarded. +#> Warning: Removed 243 rows containing non-finite values (`stat_ellipse()`). +#> Too few points to calculate an ellipse +#> Too few points to calculate an ellipse +#> Warning: Removed 243 rows containing missing values (`geom_point()`). + + +# Calculate RDA as a separate object +rda_mat <- calculateRDA(tse, + formula = assay ~ ClinicalStatus + Gender + Age, + FUN = vegan::vegdist, + distance = "bray", + na.action = na.exclude) + +# Create RDA plot from RDA matrix +plotRDA(rda_mat) + +
Examples
# plotting N of prevalence exceeding taxa on the Phylum level plotPrevalence(GlobalPatterns, rank = "Phylum") -plotPrevalence(GlobalPatterns, rank = "Phylum") + scale_x_log10() +plotPrevalence(GlobalPatterns, rank = "Phylum") + scale_x_log10() # plotting prevalence per taxa for different detection thresholds as heatmap @@ -244,14 +244,14 @@Examples
# information plotPrevalentAbundance(GlobalPatterns, rank = "Family", colour_by = "Phylum") + - scale_x_log10() + scale_x_log10() # When using function plotPrevalentAbundace, it is possible to create facets # with 'facet_by'. plotPrevalentAbundance(GlobalPatterns, rank = "Family", colour_by = "Phylum", facet_by = "Kingdom") + - scale_x_log10() + scale_x_log10() diff --git a/reference/plotSeries.html b/reference/plotSeries.html index 19208f93..76ce661b 100644 --- a/reference/plotSeries.html +++ b/reference/plotSeries.html @@ -17,7 +17,7 @@ diff --git a/reference/plotTree.html b/reference/plotTree.html index be214914..70cb4cc1 100644 --- a/reference/plotTree.html +++ b/reference/plotTree.html @@ -20,7 +20,7 @@ diff --git a/reference/treeData.html b/reference/treeData.html index 3923e0cd..c9de8b0f 100644 --- a/reference/treeData.html +++ b/reference/treeData.html @@ -19,7 +19,7 @@ @@ -183,18 +183,18 @@Examples
#> #> # The associated data tibble abstraction: 38,431 × 4 #> # The 'node', 'label' and 'isTip' are from the phylo tree. -#> node label isTip test -#> <int> <chr> <lgl> <dbl> -#> 1 1 549322 TRUE 0.0822 -#> 2 2 522457 TRUE -1.60 -#> 3 3 951 TRUE 0.722 -#> 4 4 244423 TRUE -0.440 -#> 5 5 586076 TRUE -1.07 -#> 6 6 246140 TRUE -1.52 -#> 7 7 143239 TRUE 1.60 -#> 8 8 244960 TRUE 0.668 -#> 9 9 255340 TRUE -0.0879 -#> 10 10 144887 TRUE -0.0426 +#> node label isTip test +#> <int> <chr> <lgl> <dbl> +#> 1 1 549322 TRUE -0.871 +#> 2 2 522457 TRUE -1.17 +#> 3 3 951 TRUE 1.90 +#> 4 4 244423 TRUE -0.942 +#> 5 5 586076 TRUE -0.177 +#> 6 6 246140 TRUE -1.51 +#> 7 7 143239 TRUE -0.679 +#> 8 8 244960 TRUE 0.657 +#> 9 9 255340 TRUE -1.67 +#> 10 10 144887 TRUE -1.63 #> # ℹ 38,421 more rows diff --git a/sitemap.xml b/sitemap.xml index 0a295d43..95202576 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -36,6 +36,9 @@+ /reference/plotAbundanceDensity.html + /reference/plotCCA.html +/reference/plotColTile.html