@@ -163,7 +163,7 @@ Requires an internet connection.
163163"""
164164function downloadpdb (pdbid:: AbstractString ;
165165 dir:: AbstractString = pwd (),
166- format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat}} = PDBFormat,
166+ format:: Type{<:Union{PDBFormat,PDBXMLFormat,MMCIFFormat,BCIFFormat }} = PDBFormat,
167167 obsolete:: Bool = false ,
168168 overwrite:: Bool = false ,
169169 ba_number:: Integer = 0 )
@@ -197,9 +197,14 @@ function downloadpdb(pdbid::AbstractString;
197197 try
198198 # Download the compressed PDB file to the temporary location
199199 @info " Downloading file from PDB: $pdbid "
200- if ba_number == 0
200+ if format == BCIFFormat
201201 Downloads. download (
202- " http://files.rcsb.org/download/$pdbid .$(pdbextension[format]) .gz" ,
202+ " https://models.rcsb.org/$pdbid .bcif" ,
203+ pdbpath,
204+ )
205+ elseif ba_number == 0
206+ Downloads. download (
207+ " http://files.rcsb.org/download/$pdbid .$(pdbextension[format])$ba_number .gz" ,
203208 archivefilepath,
204209 )
205210 else
@@ -219,7 +224,7 @@ function downloadpdb(pdbid::AbstractString;
219224 end
220225 end
221226 # Verify if the compressed file is downloaded properly and extract it
222- if isfile (archivefilepath) && filesize (archivefilepath) > 0
227+ if isfile (archivefilepath) && filesize (archivefilepath) > 0 && format != BCIFFormat
223228 stream = GzipDecompressorStream (open (archivefilepath))
224229 open (pdbpath, " w" ) do output
225230 write (output, stream)
@@ -238,7 +243,9 @@ function downloadpdb(pdbid::AbstractString;
238243 end
239244 finally
240245 # Remove the temporary compressd PDB file downloaded to clear up space
241- rm (archivefilepath, force= true )
246+ if format != BCIFFormat
247+ rm (archivefilepath, force= true )
248+ end
242249 end
243250 end
244251
@@ -291,7 +298,7 @@ Requires an internet connection.
291298 in `dir`; by default skips downloading the PDB file if it exists.
292299"""
293300function downloadentirepdb (; dir:: AbstractString = pwd (),
294- format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat}} = PDBFormat,
301+ format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat, BCIFFormat }} = PDBFormat,
295302 overwrite:: Bool = false )
296303 pdblist = pdbentrylist ()
297304 @info " About to download $(length (pdblist)) PDB files, make sure you have enough disk space and time"
@@ -310,7 +317,7 @@ automatically updates the PDB files of the given `format` inside the local
310317Requires an internet connection.
311318"""
312319function updatelocalpdb (; dir:: AbstractString = pwd (),
313- format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat}} = PDBFormat)
320+ format:: Type{<:Union{PDBFormat,PDBXMLFormat,MMCIFFormat,BCIFFormat }} = PDBFormat)
314321 addedlist, modifiedlist, obsoletelist = pdbrecentchanges ()
315322 # Download the newly added and modified pdb files
316323 downloadpdb (vcat (addedlist, modifiedlist), dir= dir, overwrite= true , format= format)
@@ -352,7 +359,7 @@ Requires an internet connection.
352359 in `dir`; by default skips downloading the PDB file if it exists.
353360"""
354361function downloadallobsoletepdb (; obsolete_dir:: AbstractString = pwd (),
355- format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat}} = PDBFormat,
362+ format:: Type{<:Union{PDBFormat,PDBXMLFormat,MMCIFFormat,BCIFFormat }} = PDBFormat,
356363 overwrite:: Bool = false )
357364 obsoletelist = pdbobsoletelist ()
358365 downloadpdb (obsoletelist, dir= obsolete_dir, format= format, overwrite= overwrite)
@@ -391,7 +398,7 @@ Requires an internet connection.
391398"""
392399function retrievepdb (pdbid:: AbstractString ;
393400 dir:: AbstractString = pwd (),
394- format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat}} = MMCIFFormat,
401+ format:: Type{<:Union{PDBFormat,PDBXMLFormat,MMCIFFormat,BCIFFormat }} = MMCIFFormat,
395402 obsolete:: Bool = false ,
396403 overwrite:: Bool = false ,
397404 ba_number:: Integer = 0 ,
0 commit comments