StuntsPT / NCBI_Mass_Downloader

A program to download large amounts of sequences from NCBI databases.
GNU General Public License v3.0
19 stars 7 forks source link

AttributeError: 'NoneType' object has no attribute 'group' #14

Closed shkao closed 8 years ago

shkao commented 8 years ago

Any idea how to fix the following "AttributeError..."? Thanks in advance.

➜  NCBI_Mass_Downloader git:(master) git describe --tags
v3.2
➜  NCBI_Mass_Downloader git:(master) python3 NCBI_downloader.py -q "Lacerta monticola[organism]" -d "nucleotide" -o testdata.fasta
Downloading record 1 to 195 of 195
Checking for sequences that did not download... Please wait.
Traceback (most recent call last):
  File "NCBI_downloader.py", line 46, in <module>
    main()
  File "NCBI_downloader.py", line 42, in main
    dler.run_everything()
  File "/Users/shkao/Desktop/NCBI_Mass_Downloader/back_end.py", line 252, in run_everything
    self.main_organizer(count, IDs, webenv, query_key, batch_size, self.run)
  File "/Users/shkao/Desktop/NCBI_Mass_Downloader/back_end.py", line 131, in main_organizer
    self.re_downloader(IDs, webenv, query_key, b_size)
  File "/Users/shkao/Desktop/NCBI_Mass_Downloader/back_end.py", line 142, in re_downloader
    ver_ids = self.error_finder(self.outfile)
  File "/Users/shkao/Desktop/NCBI_Mass_Downloader/back_end.py", line 171, in error_finder
    ID = re.search("gi\|.*?\|", lines).group(0)[3:-1]
AttributeError: 'NoneType' object has no attribute 'group'
StuntsPT commented 8 years ago

Sorry about the delay. Somehow I did not get an email notification about this issue. This is happening because NCBI has disabled GI access to the FASTA files. Somehow I thought NCBI Mass Sequence Downloader was already using Assesion numbers, but I guess It's still making some calls using GI's. I'll look into this ASAP, but it could take me a few days to complete it.

StuntsPT commented 8 years ago

Ok, please try the master branch. It should fix the problem. Thanks for reporting this. I will make a new release (4.0) tomorrow or Monday. Let me know if the issue persists, as I have only tested a limited number of cases (although there is no reason to think any of the remaining corner cases should cause trouble).

StuntsPT commented 8 years ago

Binaries released for the new "hackish" version. Once "idtype=acc" is working on NCBI I will update NCBI Mass Sequence Downloader again to use the correct API parameters.

shkao commented 8 years ago

Thanks a lot! ;-)

On 22 Oct 2016, at 01:39, Francisco Pina-Martins notifications@github.com wrote:

Ok, please try the master branch. It should fix the problem. Thanks for reporting this. I will make a new release (4.0) tomorrow or Monday. Let me know if the issue persists, as I have only tested a limited number of cases (although there is no reason to think any of the remaining corner cases should cause trouble).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/StuntsPT/NCBI_Mass_Downloader/issues/14#issuecomment-255489914, or mute the thread https://github.com/notifications/unsubscribe-auth/AEibJ1o25MFsPPoYzM8H-ErJlVCcX8mkks5q2U0zgaJpZM4KcOtf.