Vegan beta diversity and permutation analysis
1
0
Entering edit mode
4.8 years ago
Bioinfonext ▴ 460

Hi,

I am trying to use vegan bioconductor package for beta diversity and permutation analysis for amplicon data but it is giving distance according to OTU instead of sample names, please help me with it.Is it also possible to give phyloseq object to vegan command instead of txt files?

#OTU count data file
> werra_sp <- read.table("convent.fert.root.count.txt",header=T,sep='\t',check.names=F,row.names=1)

#metadata data file
> werra_env <- read.table("werra.env.txt",header=T,sep='\t',check.names=F,row.names=1)
> str(werra_sp)
'data.frame':   1327 obs. of  18 variables:

 $ Root-19.S46.L001: int  44 0 52 16 13 0 0 32 7 0 ...

 $ Root-22.S56.L001: int  0 0 114 0 0 0 0 40 7 0 ...

 $ Root-24.S66.L001: int  43 0 484 24 0 6 0 17 0 0 ...

 $ Root-25.S76.L001: int  22 0 82 19 0 0 0 31 0 22 ...

 $ Root-26.S6.L001 : int  0 14 0 0 0 0 0 10 0 0 ...


> str(werra_env)

'data.frame':   18 obs. of  2 variables:

 $ Treatment: Factor w/ 1 level "convent.fert.": 1 1 1 1 1 1 1 1 1 1 ...

 $ Region   : Factor w/ 2 levels "Mymensingh","Rajshahi": 1 1 1 1 1 1 1 1 1 2

> dist_werra <- vegdist(werra_sp^0.25, method= 'bray')
> dis

> dist_werra
                                 270d52396ceaab2f1506f5a6c6100c10
d644684b08ae9b136307d9d2ce8975c0                       0.89217116

aed34f36d535976c247278bec289fd12                       0.36933629

731354d360c13253dfe2ad2d2b0cd971                       0.41469186

030329dbd6777daa2f0a75400b60b583                       0.59543568
vegan bioconductor R • 1.0k views
ADD COMMENT
0
Entering edit mode

It's spelled bioconductor, not biocunducter. Always prefer = TRUE and = FALSE instead of =T and =F. All it takes is one T=0 to break the script.

ADD REPLY
0
Entering edit mode
4.8 years ago
Bioinfonext ▴ 460

Thanks, It is resolved, I just need to transpose the count data.

ADD COMMENT

Login before adding your answer.

Traffic: 1462 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6