I think I got it to work with making an alias database. The problem was downloading all the gi numbers for all bacteria. It is a 3 gb file. I wrote a biopython script (see below) that does it in 10,000 gi chunks. Then I used cat to put them all together. Then I use that gilist to make the alias database. It works. Also, the new blast does make the gilist in binary. I have not tried using that but that might be a good option.
Entrez.email = "email@here"
start=0 # last #double check as I think there is a cutoff at 9938 to 10966
stop= 318437911
skip=10000
for i in range(start,stop,skip):
last=i
if i%1000000==0:
print i
filename='downloadArch/python_archaea'+str(i)+'.gis'
try:
handle = Entrez.esearch(db="protein", retmax=10000, retstart=i,term="Archaea[organism]")
record = Entrez.read(handle)
except:
handle = Entrez.esearch(db="protein", retmax=10000, retstart=i,term="Archaea[organism]")
record = Entrez.read(handle)
print 'except',i
handle.close()
gis=pd.DataFrame(record['IdList'][:])
gis.to_csv(filename,sep=' ', index=False, header=False)
I think the answer is no as things stand now since there is no option for
blastdb_aliastoolto accept a list of accession numbers.Let us hope NCBI has plans for addressing these sort of associated needs with new releases of various software (blast, eutils etc) with the gi numbers going away soon.
Is there any way to solev this problem? I really need a Bacteria Subset Nr Database. Thanks.
Did you ever find an answer. I am trying to do the same thing and I am close. I was able to write a python script to download all the bacterial gi's and I made an alias database but when I search against it, it doesn't work. I am trying to figure out why now. Were you successful?
NCBI no longer uses
ginumbers.Latest version of blast+ (v.2.6.0) has the new aliastool that has these options (I have not tried them).