@@ -151,7 +151,7 @@ Requires an internet connection.
151151- `dir::AbstractString=pwd()`: the directory to which the PDB file is
152152 downloaded; defaults to the current working directory.
153153- `format::Type=PDB`: the format of the PDB file; options are PDBFormat,
154- PDBXMLFormat, MMCIFFormat and MMTFFormat .
154+ PDBXMLFormat and MMCIFFormat. MMTF files are no longer available to download .
155155- `obsolete::Bool=false`: if set `true`, the PDB file is downloaded in the
156156 auto-generated "obsolete" directory inside the specified `dir`.
157157- `overwrite::Bool=false`: if set `true`, overwrites the PDB file if it exists
@@ -161,7 +161,7 @@ Requires an internet connection.
161161"""
162162function downloadpdb (pdbid:: AbstractString ;
163163 dir:: AbstractString = pwd (),
164- format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat, MMTFFormat }} = PDBFormat,
164+ format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat}} = PDBFormat,
165165 obsolete:: Bool = false ,
166166 overwrite:: Bool = false ,
167167 ba_number:: Integer = 0 )
@@ -196,18 +196,24 @@ function downloadpdb(pdbid::AbstractString;
196196 # Download the compressed PDB file to the temporary location
197197 @info " Downloading file from PDB: $pdbid "
198198 if ba_number == 0
199- if format == MMTFFormat
200- Downloads. download (" http://mmtf.rcsb.org/v1.0/full/$pdbid .mmtf.gz" , archivefilepath)
201- else
202- Downloads. download (" http://files.rcsb.org/download/$pdbid .$(pdbextension[format]) .gz" , archivefilepath)
203- end
199+ Downloads. download (
200+ " http://files.rcsb.org/download/$pdbid .$(pdbextension[format]) .gz" ,
201+ archivefilepath,
202+ )
204203 else
205204 if format == PDBFormat
206- Downloads. download (" http://files.rcsb.org/download/$pdbid .$(pdbextension[format])$ba_number .gz" , archivefilepath)
205+ Downloads. download (
206+ " http://files.rcsb.org/download/$pdbid .$(pdbextension[format])$ba_number .gz" ,
207+ archivefilepath,
208+ )
207209 elseif format == MMCIFFormat
208- Downloads. download (" http://files.rcsb.org/download/$pdbid -assembly$ba_number .$(pdbextension[format]) .gz" , archivefilepath)
210+ Downloads. download (
211+ " http://files.rcsb.org/download/$pdbid -assembly$ba_number .$(pdbextension[format]) .gz" ,
212+ archivefilepath,
213+ )
209214 else
210- throw (ArgumentError (" Biological assemblies are available in the PDB and mmCIF formats only" ))
215+ throw (ArgumentError (" Biological assemblies are available in the " *
216+ " PDB and mmCIF formats only" ))
211217 end
212218 end
213219 # Verify if the compressed file is downloaded properly and extract it
@@ -221,7 +227,9 @@ function downloadpdb(pdbid::AbstractString;
221227 # Verify if the PDB file is downloaded and extracted without any error
222228 if ! isfile (pdbpath) || filesize (pdbpath) == 0
223229 if format == PDBFormat
224- throw (ErrorException (" Error downloading file: $pdbid ; some PDB entries are not available as PDB format files, consider downloading the mmCIF file or MMTF file instead" ))
230+ throw (ErrorException (" Error downloading file: $pdbid ; some PDB entries are " *
231+ " not available as PDB format files, consider downloading " *
232+ " the mmCIF file instead" ))
225233 else
226234 throw (ErrorException (" Error downloading file: $pdbid " ))
227235 end
@@ -276,12 +284,12 @@ Requires an internet connection.
276284- `dir::AbstractString=pwd()`: the directory to which the PDB files are
277285 downloaded; defaults to the current working directory.
278286- `format::Type=PDB`: the format of the PDB file; options are PDBFormat,
279- PDBXMLFormat, MMCIFFormat and MMTFFormat .
287+ PDBXMLFormat and MMCIFFormat. MMTF files are no longer available to download .
280288- `overwrite::Bool=false`: if set `true`, overwrites the PDB file if it exists
281289 in `dir`; by default skips downloading the PDB file if it exists.
282290"""
283291function downloadentirepdb (; dir:: AbstractString = pwd (),
284- format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat, MMTFFormat }} = PDBFormat,
292+ format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat}} = PDBFormat,
285293 overwrite:: Bool = false )
286294 pdblist = pdbentrylist ()
287295 @info " About to download $(length (pdblist)) PDB files, make sure you have enough disk space and time"
@@ -300,7 +308,7 @@ automatically updates the PDB files of the given `format` inside the local
300308Requires an internet connection.
301309"""
302310function updatelocalpdb (; dir:: AbstractString = pwd (),
303- format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat, MMTFFormat }} = PDBFormat)
311+ format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat}} = PDBFormat)
304312 addedlist, modifiedlist, obsoletelist = pdbrecentchanges ()
305313 # Download the newly added and modified pdb files
306314 downloadpdb (vcat (addedlist, modifiedlist), dir= dir, overwrite= true , format= format)
@@ -337,12 +345,12 @@ Requires an internet connection.
337345- `obsolete_dir::AbstractString=pwd()`: the directory where the PDB files are
338346 downloaded; defaults to the current working directory.
339347- `format::Type=PDB`: the format of the PDB file; options are PDBFormat,
340- PDBXMLFormat, MMCIFFormat and MMTFFormat .
348+ PDBXMLFormat and MMCIFFormat. MMTF files are no longer available to download .
341349- `overwrite::Bool=false`: if set `true`, overwrites the PDB file if it exists
342350 in `dir`; by default skips downloading the PDB file if it exists.
343351"""
344352function downloadallobsoletepdb (; obsolete_dir:: AbstractString = pwd (),
345- format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat, MMTFFormat }} = PDBFormat,
353+ format:: Type{<:Union{PDBFormat, PDBXMLFormat, MMCIFFormat}} = PDBFormat,
346354 overwrite:: Bool = false )
347355 obsoletelist = pdbobsoletelist ()
348356 downloadpdb (obsoletelist, dir= obsolete_dir, format= format, overwrite= overwrite)
0 commit comments