sourcetracker2 rarefacation

Hello all,
I'm using the QIIME plug-in for sourcetracker2 and I have followed the provided tutorial given previously. However, I was wondering how I'd rarefy my data within sourcetracker2? I've been running `

> qiime sourcetracker2 gibbs --i-feature-table pooltable.qza --m-sample-metadata-file ../metadata.tsv --p-source-sink-column sourcesink --p-loo --p-source-column-value source --p-sink-column-value sink --p-source-category-column purpose --output-dir sourcetracker

`
which produces the following error:

> **Plugin error from sourcetracker2:**
> 
> **You requested rarefaction of source samples at 1000, but there are 1 collapsed source samples that have less sequences than that. The shallowest of these is 570 sequences.**
> 
> **Debug info has been saved to /data/qiime2-q2cli-err-sglgzi15.log**

Is there a specific flag I can include to specify rarefaction depth? Thank you!

Hi @buserj

You can rarefy your feature table first, specifying the sampling depth (570), and then run SourceTracker again with the rarefied table.

Rarefy Feature Table

qiime feature-table rarefy \
  --i-table pooltable.qza \
  --p-sampling-depth <desired_depth> \
  --o-rarefied-table rarefied_table.qza

Run SourceTracker

qiime sourcetracker2 gibbs \
  --i-feature-table rarefied_table.qza \
  --m-sample-metadata-file ../metadata.tsv \
  --p-source-sink-column sourcesink \
  --p-loo \
  --p-source-column-value source \
  --p-sink-column-value sink \
  --p-source-category-column purpose \
  --output-dir sourcetracker

Hope that helps!

Yes that's great, thank you!

2 Likes