# Invalid syntax message when running export2graphlan

**URL:** <https://forum.biobakery.org/t/invalid-syntax-message-when-running-export2graphlan/992>\
**Category:** GraPhlAn\
**Created:** [September 9, 2020, 12:56pm UTC](https://forum.biobakery.org/t/invalid-syntax-message-when-running-export2graphlan/992 "2020-09-09T12:56:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elenu](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/elenu/32/421_2.png) [@elenu](https://forum.biobakery.org/u/elenu)\
**Post date:** [September 9, 2020, 12:56pm UTC](https://forum.biobakery.org/t/invalid-syntax-message-when-running-export2graphlan/992/1 "2020-09-09T12:56:42Z")

</div>

Hello,  
I am running GraPhlAn taking as a reference the turorial:

> **[biobakery/biobakery](https://github.com/biobakery/biobakery/wiki/metaphlan3)**
>
> bioBakery tools for meta'omic profiling. Contribute to biobakery/biobakery development by creating an account on GitHub.

I tried to run the step 1 (to create the GraPhlAn input files), but I got an error message:

```auto
File "/home/eyre/anaconda3/bin/export2graphlan.py", line 23
    def scale_color((h, s, v), factor=1.0):
                    ^
SyntaxError: invalid syntax

```

I installed export2graphlan again (`conda install export2graphlan`) but it has the same error message.

Is it possible that I should need to install it differently?

Thank you.

---

<div class="post-metadata">

**Author:** ![aaron\_walsh](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aaron_walsh/32/554_2.png) [@aaron\_walsh](https://forum.biobakery.org/u/aaron_walsh)\
**Post date:** [January 13, 2021, 3:10pm UTC](https://forum.biobakery.org/t/invalid-syntax-message-when-running-export2graphlan/992/2 "2021-01-13T15:10:08Z")

</div>

Hi,

Thanks for your interest in GraPhlAn and sorry for the late reply. Can you send me a copy of the command that you used? I will see if I can recreate the error. Thanks!

Regards,  
Aaron.

---

<div class="post-metadata">

**Author:** ![plicht](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@plicht](https://forum.biobakery.org/u/plicht)\
**Post date:** [February 8, 2021, 5:30pm UTC](https://forum.biobakery.org/t/invalid-syntax-message-when-running-export2graphlan/992/3 "2021-02-08T17:30:52Z")

</div>

Hi @aaron_walsh,

I got the same error. These are my commands:

> export2graphlan.py --skip\_rows 1 -i results\_rarefied/merged\_cases\_rarefied\_full.txt --tree merged\_cases\_rarefied\_full.tree.txt --annotation merged\_cases\_rarefied\_full.annot.txt --most\_abundant 100 --abundance\_threshold 1 --least\_biomarkers 10 --annotations 5,6 --external\_annotations 7 --min\_clade\_size 1

> File “/home/\*\*\*/anaconda3/envs/export2graphlan\_env/bin/export2graphlan.py”, line 23  
> def scale\_color((h, s, v), factor=1.0):  
> ^  
> SyntaxError: invalid syntax

Best,  
Philipp

---

<div class="post-metadata">

**Author:** ![aaron\_walsh](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aaron_walsh/32/554_2.png) [@aaron\_walsh](https://forum.biobakery.org/u/aaron_walsh)\
**Post date:** [February 12, 2021, 2:16pm UTC](https://forum.biobakery.org/t/invalid-syntax-message-when-running-export2graphlan/992/4 "2021-02-12T14:16:00Z")

</div>

Hi Philipp,

I have a feeling that dependancies might be missing from your export2graphlan conda environment. I would recommend creating a GraPhlAn conda environment in which you could install export2graphlan. Here are the commands to do this:

```markdown
$ conda create -n graphlan
$ source activate graphlan
$ conda install -c biobakery graphlan
$ conda install -c bioconda export2graphlan

```

To test if export2graphlan is working, try this:

```bash
$ wget https://raw.githubusercontent.com/biobakery/biobakery/master/demos/biobakery_demos/data/metaphlan3/output/merged_abundance_table.txt
$ tail -n +2 merged_abundance_table.txt | cut -f1,3- > merged_abundance_table_reformatted.txt
$ export2graphlan.py --skip_rows 1 -i merged_abundance_table_reformatted.txt --tree merged_abundance.tree.txt --annotation merged_abundance.annot.txt --most_abundant 100 --abundance_threshold 1 --least_biomarkers 10 --annotations 5,6 --external_annotations 7 --min_clade_size 1

```

export2graphlan should produce two outputs: merged\_abundance.tree.txt and merged\_abundance.annot.txt.

Hope this helps!

Regards,  
Aaron.

---

<div class="post-metadata">

**Author:** ![chodarq](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/chodarq/32/971_2.png) [@chodarq](https://forum.biobakery.org/u/chodarq)\
**Post date:** [August 9, 2021, 11:52pm UTC](https://forum.biobakery.org/t/invalid-syntax-message-when-running-export2graphlan/992/5 "2021-08-09T23:52:05Z")

</div>

Hi all.  
Sorry if I open this thread again, but I have the same problem.

I’m initially use a conda environment and then move to another computer and use the version 0.22 of export2graphlan available at [GitHub - SegataLab/export2graphlan: Conversion software tool for producing both annotation and tree files for GraPhlAn](https://github.com/SegataLab/export2graphlan/)

Pandas, BIOM and SciPy was succesfully installed prior to test export2graphlan.py with the example folders.

Anyone have some solution to this problem?  
Thanks
