Class EmdbMapProvider
java.lang.Object
org.biojava.nbio.structure.io.density.AbstractDensityMapProvider
org.biojava.nbio.structure.io.density.EmdbMapProvider
- All Implemented Interfaces:
DensityMapProvider
Fetches the full-resolution primary map of an EMDB entry.
These are gzipped CCP4/MRC files, and they are big: the primary map of
EMD-0262 is about 106 MB, and gigabyte maps exist. For most display
purposes a slice from a density server is a far better trade — a few
hundred kilobytes for the same entry — which is why
DensityMapCache tries VolumeServerProvider first and only falls
back here. Use this source when the full sampling genuinely matters.
The size limit is checked against the size EMDB itself reports before any of the body is transferred, so exceeding it costs one small metadata request rather than a partial download.
Jmol recognises gzip from the file's magic bytes, so the cached
.map.gz can be handed to it without decompressing first.
- Since:
- 7.3.0
- Author:
- Amr ALHOSSARY
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault path template for an entry's primary map.static final StringDefault base URL of the EMDB archive.Fields inherited from class org.biojava.nbio.structure.io.density.AbstractDensityMapProvider
MIN_DENSITY_FILE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds the URL of an entry's primary map without fetching it.fetch(DensityMapRequest request) Fetches a map, using the cache if the request's fetch behaviour allows.static Stringstatic voidRestores the default server and template.static voidsetMapUrlTemplate(String template) static voidsetServerBaseUrl(String url) booleansupports(DensityMapKind kind) Whether this provider can serve a given kind of map at all.Methods inherited from class org.biojava.nbio.structure.io.density.AbstractDensityMapProvider
declaredSize, deleteWithSidecars, effectiveCacheRoot, effectiveFetchBehavior, effectiveMaxBytes, enforceSizeLimit, getCacheRoot, getFetchBehavior, getMaxDownloadBytes, isCacheUsable, isPlausibleMap, obtain, reportTooLarge, setCacheRoot, setFetchBehavior, setMaxDownloadBytes, urlId
-
Field Details
-
DEFAULT_SERVER_URL
Default base URL of the EMDB archive.- See Also:
-
DEFAULT_MAP_TEMPLATE
Default path template for an entry's primary map.- See Also:
-
-
Constructor Details
-
EmdbMapProvider
- Parameters:
cacheRoot- the BioJava cache directoryresolver- used to find the EMDB entry for a PDB entry and to read its contour level and size
-
-
Method Details
-
getServerBaseUrl
- Returns:
- the base URL of the EMDB archive
-
setServerBaseUrl
- Parameters:
url- the base URL; a trailing slash is added if missing
-
setMapUrlTemplate
- Parameters:
template- the path template for an entry's primary map
-
resetToDefaults
public static void resetToDefaults()Restores the default server and template. -
getSource
- Returns:
- which service this provider talks to
-
getFormat
- Returns:
- the format this provider delivers
-
supports
Description copied from interface:DensityMapProviderWhether this provider can serve a given kind of map at all. Used to skip requests that could not possibly succeed, such as asking an X-ray map service for a cryo-EM map.- Specified by:
supportsin interfaceDensityMapProvider- Overrides:
supportsin classAbstractDensityMapProvider- Parameters:
kind- the kind of map wanted- Returns:
trueif it is worth trying
-
buildUrl
Builds the URL of an entry's primary map without fetching it.- Parameters:
emdbId- the EMDB entry, in any accepted form- Returns:
- the URL as a string
-
fetch
Description copied from interface:DensityMapProviderFetches a map, using the cache if the request's fetch behaviour allows.- Parameters:
request- what is wanted. Its kind is always concrete, neverDensityMapKind.AUTO.- Returns:
- the map, or
nullif this service has nothing for the entry - Throws:
IOException- on transport failure; useHttpStatusExceptionso that a missing resource can be told apart from a broken connection
-