# phyloseq object to igraph for network analysis

**URL:** <https://igraph.discourse.group/t/phyloseq-object-to-igraph-for-network-analysis/857>\
**Category:** Usage\
**Tags:** R\
**Created:** [12 September 2021 07:31 UTC](https://igraph.discourse.group/t/phyloseq-object-to-igraph-for-network-analysis/857 "2021-09-12T07:31:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bioinfonext](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/bioinfonext/32/576_2.png) [@Bioinfonext](https://igraph.discourse.group/u/Bioinfonext)\
**Post date:** [12 September 2021 07:31 UTC](https://igraph.discourse.group/t/phyloseq-object-to-igraph-for-network-analysis/857/1 "2021-09-12T07:31:41Z")

</div>

Hi,

I am trying to do network analysis from amplicon sequencing data. My aim is to identify hub species in the network. I am using the below code but spiec.easi step is taking lots of time. Is there any other way to speed up this or can we use any other alternative?

I will be thankful for your time and help.

```auto

#For testing reduce the number of ASVs

ps1.stool.otu <- prune_taxa(taxa_sums(ps1.stool) > 100, ps1.stool)

# Add taxonomic classification to OTU ID
ps1.stool.otu.f <- microbiomeutilities::format_to_besthit(ps1.stool.otu)
## Warning: replacing previous import 'ggplot2::alpha' by 'microbiome::alpha' when
## loading 'microbiomeutilities'
head(tax_table(ps1.stool.otu))

otu.c <- t(otu_table(ps1.stool.otu.f)@.Data) #extract the otu table from phyloseq object

tax.c <- as.data.frame(tax_table(ps1.stool.otu.f)@.Data)#extract the taxonomy information

head(tax.c)

# In practice, use more repetitions
set.seed(1244)
net.c <- spiec.easi(otu.c, method='mb', icov.select.params=list(rep.num=50)) # reps have to increases for real data

```

Many thanks

---

<div class="post-metadata">

**Author:** ![Bioinfonext](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/bioinfonext/32/576_2.png) [@Bioinfonext](https://igraph.discourse.group/u/Bioinfonext)\
**Post date:** [24 September 2021 21:09 UTC](https://igraph.discourse.group/t/phyloseq-object-to-igraph-for-network-analysis/857/2 "2021-09-24T21:09:05Z")

</div>

> [@Bioinfonext](#):
>
> `spiec.easi`

Hi,  
Could anyone please suggest correlation based command instead of spiec.easi.
