# rescript get-ncbi-data ‘dict’ object has no attribute ‘add’

**URL:** https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560
**Category:** Library Support
**Created:** [September 15, 2020, 2:33pm UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560 "2020-09-15T14:33:09Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![the\_dummy](https://forum.qiime2.org/user_avatar/forum.qiime2.org/the_dummy/32/5626_2.png) [@the\_dummy](https://forum.qiime2.org/u/the_dummy)
#### Post date: [September 15, 2020, 2:33pm UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560/1 "2020-09-15T14:33:09Z")

</div>

Hello,

Thank you for such tool. It is very useful. I have walked over tutorial for 16S, yes it works, but then I tried to get ITS data with command below.

```
qiime rescript get-ncbi-data \
    --p-query '177353[BioProject]' \ 
    --o-sequences ncbi-its-seqs.qza \ 
    --o-taxonomy ncbi-its-taxa.qza \ 
    --verbose

```

This is the error I got.

> Traceback (most recent call last):  
> File "/home/bmlab/anaconda3/envs/qiime2-2020.8/lib/python3.6/site-packages/q2cli/commands.py", line 329, in **call**  
> results = action(\*\*arguments)  
> File "", line 2, in get\_ncbi\_data  
> File "/home/bmlab/anaconda3/envs/qiime2-2020.8/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound\_callable  
> output\_types, provenance)  
> File "/home/bmlab/anaconda3/envs/qiime2-2020.8/lib/python3.6/site-packages/qiime2/sdk/action.py", line 390, in _callable\_executor_  
> output\_views = self.\_callable(\*\*view\_args)  
> File "/home/bmlab/anaconda3/envs/qiime2-2020.8/lib/python3.6/site-packages/rescript/ncbi.py", line 82, in get\_ncbi\_data  
> taxids, ranks, rank\_propagation, entrez\_delay)  
> File "/home/bmlab/anaconda3/envs/qiime2-2020.8/lib/python3.6/site-packages/rescript/ncbi.py", line 255, in get\_taxonomies  
> missing\_taxids.add(taxid)  
> AttributeError: 'dict' object has no attribute 'add'  
> Plugin error from rescript:  
> 'dict' object has no attribute 'add'  
> See above for debug info.

Isn't the tool supposed to get data from any BioProject just as 16S? I want to build a database for ITS region. Could you point me to the reason of this failure?

Edit: Well... The command below is not working for me either.

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/5/55d0b9cdd82f194058fe8257c75b4dfb4c8ba8d3.png)

Edit2: I might be complicating things, but I think I need to share this one, too. Switching ' with " triggers a different error.

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/1/1eccd6dadbd712af9f3920c553ffd2ad1bb57d8c.png)

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [September 16, 2020, 11:20am UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560/2 "2020-09-16T11:20:45Z")

</div>



---

<div class="post-metadata">

### Author: ![SoilRotifer](https://forum.qiime2.org/user_avatar/forum.qiime2.org/soilrotifer/32/21071_2.png) [@SoilRotifer](https://forum.qiime2.org/u/SoilRotifer)
#### Post date: [September 16, 2020, 4:54pm UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560/3 "2020-09-16T16:54:14Z")

</div>

Hi @the_dummy,

I've tried running these commands, and initially I ran into the same errors too. However, I adjusted the `--p-entrez-delay` by doubling the default value, and it worked. This leads me to think that the issue in on the NCBI-end. 🤷‍♂️

The following worked (with and without the `--p-n-jobs` argument):

```auto
qiime rescript get-ncbi-data \
    --p-query '33175[BioProject] OR 33317[BioProject]' \
    --o-sequences ncbi-refseqs-unfiltered.qza. \ 
    --o-taxonomy ncbi-refseqs-taxonomy-unfiltered.qza \
    --p-entrez-delay 0.668 \
    --p-n-jobs 4

Saved FeatureData[Sequence] to: ncbi-refseqs-unfiltered.qza
Saved FeatureData[Taxonomy] to: ncbi-refseqs-taxonomy-unfiltered.qza

```

Give that a try and let us know if it works out.

-Cheers!  
-Mike

---

<div class="post-metadata">

### Author: ![SoilRotifer](https://forum.qiime2.org/user_avatar/forum.qiime2.org/soilrotifer/32/21071_2.png) [@SoilRotifer](https://forum.qiime2.org/u/SoilRotifer)
#### Post date: [September 16, 2020, 4:54pm UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560/4 "2020-09-16T16:54:19Z")

</div>



---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [September 16, 2020, 7:57pm UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560/5 "2020-09-16T19:57:52Z")

</div>

Hey @the_dummy,  
Just to follow on @SoilRotifer's comments to clarify — we see various server-side issues with NCBI so sometimes using get-ncbi-data can be a bit bumpy depending on:

1. the time of day
2. the size/content of your query
3. which way the wind is blowing (just kidding 😉)

Usually trying again later works (e.g., if you are trying to run the job during peak hours) and we have some pending changes to rescript to make these failures more graceful in the future.

Good luck!

---

<div class="post-metadata">

### Author: ![the\_dummy](https://forum.qiime2.org/user_avatar/forum.qiime2.org/the_dummy/32/5626_2.png) [@the\_dummy](https://forum.qiime2.org/u/the_dummy)
#### Post date: [September 17, 2020, 10:01am UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560/6 "2020-09-17T10:01:25Z")

</div>

> [@SoilRotifer](#):
>
> The following worked (with and without the `--p-n-jobs` argument)

There is no --p-n-jobs argument. I use the version stated below. Is there another version that has --p-n-jobs argument?

> QIIME 2 Plugin 'rescript' version 2020.11.0.dev0+6.g836422d (from package 'rescript' version 2020.11.0.dev0+6.g836422d)

> [@Nicholas\_Bokulich](#):
>
> (e.g., if you are trying to run the job during peak hours)

Time zone difference corresponds to 10 hours for USA and my country, so my active hours should be somewhat quiet and still it fails. The weird thing is, error message differs for each attempt. I can send error logs if it matters.

I will build database from this BioProject some other way and try rescript after updates. I will let you know how that goes if anyone is interested.

Thank you.

---

<div class="post-metadata">

### Author: ![SoilRotifer](https://forum.qiime2.org/user_avatar/forum.qiime2.org/soilrotifer/32/21071_2.png) [@SoilRotifer](https://forum.qiime2.org/u/SoilRotifer)
#### Post date: [September 17, 2020, 1:01pm UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560/7 "2020-09-17T13:01:41Z")

</div>

> [@the\_dummy](#):
>
> There is no --p-n-jobs argument. I use the version stated below. Is there another version that has --p-n-jobs argument?

Oops.. sorry @the_dummy, I was running in my test environment and not the live release. Have you tried altering the delay? Did that work?

-Mike

---

<div class="post-metadata">

### Author: ![the\_dummy](https://forum.qiime2.org/user_avatar/forum.qiime2.org/the_dummy/32/5626_2.png) [@the\_dummy](https://forum.qiime2.org/u/the_dummy)
#### Post date: [September 17, 2020, 1:15pm UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560/8 "2020-09-17T13:15:07Z")

</div>

Yes, I tried altering the delay with many different values between 0.1 and 300. Unfortunately, it did not work.

---

<div class="post-metadata">

### Author: ![the\_dummy](https://forum.qiime2.org/user_avatar/forum.qiime2.org/the_dummy/32/5626_2.png) [@the\_dummy](https://forum.qiime2.org/u/the_dummy)
#### Post date: [September 22, 2020, 6:29am UTC](https://forum.qiime2.org/t/rescript-get-ncbi-data-dict-object-has-no-attribute-add/16560/9 "2020-09-22T06:29:05Z")

</div>

Updates to [original tutorial page](https://forum.qiime2.org/t/using-rescript-to-compile-sequence-databases-and-taxonomy-classifiers-from-ncbi-genbank/15947) solved the problem. I tried using `--p-n-jobs 5` at the suggested time window and it worked.

Thank you all.
