https://github.com/linsalrob/qiime_scripts
A few scripts that Rob has written to handle qiime files
https://github.com/linsalrob/qiime_scripts
Last synced: over 1 year ago
JSON representation
A few scripts that Rob has written to handle qiime files
- Host: GitHub
- URL: https://github.com/linsalrob/qiime_scripts
- Owner: linsalrob
- License: mit
- Created: 2015-10-02T07:47:25.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-02T09:56:12.000Z (almost 11 years ago)
- Last Synced: 2023-03-24T07:24:52.517Z (over 3 years ago)
- Language: Python
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qiime_scripts
A few scripts that Rob has written to handle qiime files. This is not something we do all the time, but occassionally someone asks us to munge the data into a particular format.
You are welcome to use the scripts and/or use them as inspiration. You're on your own if you do.
# number_taxonomy.py
Here is the question:
I need the attached otu_tablex.biom to look like the otu_tableQIME.biom, so the numbers in brackets after each classification need to be removed and the k_ / p_/ etc. needs to be added to the front of each classification.
i.e. from this:
```
"rows": [{"id": "OTUId", "metadata": {"taxonomy": ["None"]}},{"id": "OTU_1;size=18783;", "metadata": {"taxonomy": ["Bacteria(100.0),\"Proteobacteria\"(45.0),Alphaproteobacteria(33.1),Rhizobiales(33.1),Rhizobiaceae(33.1),Kaistia(33.1)"]}},{"id": "OTU_2;size=7463;", "metadata": {"taxonomy": ["Bacteria(100.0),\"Actinobacteria\"(66.7),Actinobacteria(52.0),Actinomycetales(48.6),Nocardioidaceae(41.2),Nocardioides(39.7)"]}}
```
to this:
```
"rows": [{"id": "denovo0", "metadata": {"taxonomy": ["k__Bacteria", "p__Bacteroidetes", "c__[Saprospirae]", "o__[Saprospirales]", "f__Chitinophagaceae", "g__Sediminibacterium", "s__"]}},{"id": "denovo1", "metadata": {"taxonomy": ["Unassigned"]}},{"id": "denovo2", "metadata": {"taxonomy": ["k__Bacteria", "p__Proteobacteria", "c__Betaproteobacteria", "o__Burkholderiales", "f__Comamonadaceae", "g__", "s__"]}}
```
This script uses our ncbi taxonomy module to create the list.