Skip to content

Instantly share code, notes, and snippets.

@gregcaporaso
Last active November 10, 2015 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregcaporaso/9bdfa2dc0885e272a118 to your computer and use it in GitHub Desktop.
Save gregcaporaso/9bdfa2dc0885e272a118 to your computer and use it in GitHub Desktop.
convert biom observation counts to per-sample rank abundances

You'll need to install master of biom-format to use this until the 2.1.6 release is posted (at which point that milestone will be closed, and you can skip this step if you're using biom-format >=2.1.6, < 2.2.0), which you can do as follows:

pip install https://github.com/biocore/biom-format/archive/master.zip

Then, run the following command, substituting your file names for in.biom and out.biom:

python -c "from biom import load_table; t = load_table('in.biom'); t.rankdata(); t.to_json('biom 2.1.5-dev', direct_io=open('out.biom','w'))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment