Supplementary Material and Methods Sampling Our sampling was performed in three selected natural forests with no disturbance in areas of rather homogeneous vegetation, slope and aspect, without any visible heterogeneity gradient; however, other factors could vary in our study sites. All trees diameters were measured with a measurement tape and their exact location was recorded on a map (all together 183, 349 and 235 trees in Site 1,2 and 3, respectively). Understory herbs and shrubs were also recorded using a 1 * 1 m quadrat with the sampling point located in the centre of the quadrat. Soil cores upon sampling, were transferred immediately to lab and freeze-dried at -20 C to demobilize soil animals. Soil samples were crushed to fine powder and 2 mg of the powder was used for DNA extraction. Molecular methods PCR products were pooled and their relative quantity was estimated by running 2 μl DNA on 1% agarose gel for 15 min. DNA samples yielding no visible band or a strong band were reamplified using 35 and 25 cycles instead. We also used negative (for DNA extraction and PCR) and positive controls (Hydnoplicata whitei specimen MURU5860) throughout the experiment. Amplicons were purified by use of exonuclease and Shrimp alkaline phosphatase enzymes (Fermantas, Kaunas, Lithuania). Purified amplicons were subjected to normalisation of quantity by use of SequalPrep Normalization Plate Kit (Invitrogen, Carlsbad, CA, USA) following manufacturer’s instructions. Normalized amplicons were divided into two pools that were each subjected to 454 adaptor ligation, emulsion PCR and 454 pyrosequencing using the GS-FLX+ technology and Titanium chemistry as implemented in Beckman Coulter Genomics (Danvers, MA, USA). Data analysis Different clustering algorithms were evaluated by comparing the results with phylogenetic trees that were constructed for selected dominant fungal genera (Tomentella, Russula and Cortinarius). ITS sequences from each genus were aligned using Clustal. ML phylogenetic trees were constructed using Raxml. The comparison was made based on the number of clusters generated by each clustering method and those observed on the phylogenetic trees. Among XX clustering algorithms, CD-hit gave less OTUs, comparable with phylogenetic trees. OTUs on phylogenetic trees were determined manually based on support values and branch lengths. . Using a custom python script, neighbourhood effect (NIF) was calculated based on tree basal area measurements and coordinates in each study site. This resulted in univariate predictors representing NIF of all tree species and each tree species separately, that were included in variation partitioning analysis following forward selection. Variation partitioning was performed in using the varpart function of the package vegan (Oksanen et al. 2013) to disentangle the effects of vegetation, soil and spatial factors. This approach enables to assign variation in the community to pure spatial and environmental effect together with their shared component. To avoid redundancy and resulting multicollinearity in variation partitioning analysis, the importance of all environmental variables (Table S1) was evaluated using the forward selection method to select important predictors as using forward.sel function of the packfor package (Dray et al. 2009). This was done based on 999 permutation and p value of 0.05. For each set of variables forward selection was performed separately including soil variables (pH and concentrations of P, K, C, N, and C:N ratio), vegetation parameters (neighbourhood effect, first two PCA axes that were extracted based on plant community matrices in each site) , spatial vectors (i.e., vectors of principal coordinates of neighbour matrices (PCNM) according to Borcard & Legendre (2002)). References Borcard D, Legendre P (2002) All-scale spatial analysis of ecological data by means of principal coordinates of neighbour matrices. Ecological Modelling 153, 51–68. Dray S, Legendre P, Blanchet G (2009) packfor: Forward Selection with Permutation. Available at http://R-Forge.R-project.org/projects/sedar/. Oksanen J, Blanchet FG, Kindt R, Legendre P, Minchin PR, O’Hara R, et al. (2013). Package ‘vegan’. ************************************************************************* # Python script for calculating neighbourhood effect import csv XY = open(r'xy.txt') ### coordinates TBH = open('tree_measurments.txt', 'rb') ### fasta_dict = {} seq = '' n=0 fasta_dict = {} tree measurments seqs = '' for line in XY: AC = line.split()[0] fasta_dict[AC] = line seqs = '' N= [] M = [] for line in TBH: line=line.rstrip() M.append(line) import math for i in fasta_dict: B=0 for j in M: x=0 y=0 euc=0 x=float(fasta_dict[i].split()[1]) float(j.split()[0]) x=x/100 x=x**2 y=float(fasta_dict[i].split()[2])-float(j.split()[1]) y=y/100 y=y**2 euc=float(math.sqrt(x+y)) if euc<10 and euc>0: #B=B+((float(j.split()[2])/100)*(1/math.log(euc))) #B=B+((float(j.split()[2])/100)*math.log(1/euc)) B=B+((float(j.split()[2])/100)*1/euc) print i,B **************************************************************************** #R codes library(vegan) library(ecodist) options(digits=3) s=read.table("clipboard" ,header=T) # community tdbh=read.table("clipboard",header=T ) # neighborhood effect so=read.table("clipboard" ) #soil p=read.table("clipboard", header=T) #plant community g=read.table("clipboard" ) #coordinates s[s>1]=1 s.dis =vegdist(s, "bray") ph=decostand(s, "hell") p.dis =vegdist(ph, "bray") s.dis2=raup_crick(s,plot_names_in_col1=FALSE) s.dis3=(s.dis2*-1)/2 mean(s.dis2) sd(s.dis2) g.dis =vegdist(g, "euclidean") so.dis=vegdist(so, "euc") tdbh.dis=vegdist(tdbh, "euc") mantel(s.dis ~g.dis , nperm=999) lm(log(s.dis ) ~ log(g.dis+0.01) )$coefficients[2] breaks=c(0, 25, 50,100, 250,350,500,1100,2100,4100,9100,6400) plot(mgram(bsim , g.dis ,breaks=breaks)) mantel(s.dis2 mantel(s.dis2 mantel(s.dis2 ~g.dis ~p.dis ~so.dis , nperm=999) , nperm=999) , nperm=999) mantel(s.dis2 mantel(s.dis2 mantel(s.dis2 mantel(s.dis2 mantel(s.dis2 mantel(s.dis2 mantel(s.dis2 ~p.dis+g.dis , nperm=999) ~p.dis+so.dis , nperm=999) ~g.dis+p.dis , nperm=999) ~g.dis+so.dis , nperm=999) ~so.dis+p.dis , nperm=999) ~so.dis+g.dis , nperm=999) ~tdbh.dis , nperm=999) library(betapart) beta.d=beta.pair(s, index.family="sor") bsim=beta.d$beta.sim bsne=beta.d$beta.sne mantel(bsim mantel(bsne ~g.dis ~g.dis , nperm=999) , nperm=999) summary(lm(log(bsim +0.001 )~ log(g.dis+0.001) )) initial=lm(log(s.dis ) ~ log(g.dis+0.001) )$coefficients[1] z=lm(log(s.dis ) ~ log(g.dis+0.001) )$coefficients[2] **************************************************************************** #variation partitioning library(vegan) library(fields) library(packfor) library(labdsv) com<- read.table("com.txt", header=T) soil<- read.table("soil.txt", header=T) g<- read.table("xy.txt") distmat=vegdist(g, "euc") pcnmr=pcnm(distmat) pcnmv=pcnmr$vectors pcnmf=forward.sel(com,pcnmv,nperm=999, alpha = 0.05) selected.pcnmv=pcnmv[,pcnmf$order] soilv=forward.sel(com,soil,nperm=999, alpha = 0.05) selected.soil=soil[,soilv$order] pc.cr <- pca(p) veg.com <- pc.cr$loadings veg <- cbind(veg.com,tbdh) vegv=forward.sel(com,veg,nperm=999, alpha = 0.05) selected.veg=veg[,vegv$order] par(mfrow=c(1,2)) showvarparts(4,c("pcnm",”soil","veg","c","d","e","f") ) plot(varpart( com ,selected.pcnmv,selected.soil,selected.veg)) # to test significance of each fraction: rd=rda(com ,selected.pcnmv ) anova(rd, step=200, perm.max=200) RsquareAdj(rd) rd=rda(com ,selected.soil) anova(rd, step=200, perm.max=200) RsquareAdj(rd) rd=rda(com ,selected.veg) anova(rd, step=200, perm.max=200) RsquareAdj(rd) # partial Mantel correlograms library(mpmcorrelogram) par(mfrow=c(2,2)) result <- mpmcorrelogram(bsim,g.dis,breaks=breaks, simil=FALSE) result <- mpmcorrelogram(bsim,g.dis,p.dis,breaks=breaks, simil=FALSE) result <- mpmcorrelogram(bsim,g.dis,p.dis,breaks=breaks, simil=FALSE) result <- mpmcorrelogram(bsim,g.dis,tbdh.dis,breaks=breaks, simil=FALSE)