Class VolumeServerProvider
- All Implemented Interfaces:
DensityMapProvider
This is usually the most economical source by a wide margin. For PDB entry 1cbs the coarsest slice is about 210 kB against roughly 2.1 MB for the two pre-computed CCP4 files, and for cryo-EM the difference is far larger still: about 480 kB against the 106 MB primary map of EMD-0262. A single response carries both the 2Fo-Fc and Fo-Fc data blocks for X-ray entries.
Caveats worth knowing. Responses are chunked, with no
Content-Length, no ETag and no
Last-Modified, so the usual server-provided validation metadata is
unavailable; the size recorded for a cached slice is the byte count observed
during our own download instead. Detail levels are not linear either —
for a small entry the response stops growing past detail 1, while for a large
EM map the step from detail 2 to 3 multiplies the size several-fold.
- Since:
- 7.3.0
- Author:
- Amr ALHOSSARY
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhich density server to talk to. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault path template for an EM entry's whole cell.static final StringDefault path template for an X-ray entry's whole unit cell.Fields inherited from class org.biojava.nbio.structure.io.density.AbstractDensityMapProvider
MIN_DENSITY_FILE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildUrl(DensityMapRequest request) Builds the URL for a request without fetching it.fetch(DensityMapRequest request) Fetches a map, using the cache if the request's fetch behaviour allows.intgetHost()voidsetBaseUrl(String baseUrl) voidsetDetail(int detail) Sets the detail level.voidsetEncoding(String encoding) 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_XRAY_CELL_TEMPLATE
Default path template for an X-ray entry's whole unit cell.- See Also:
-
DEFAULT_EM_CELL_TEMPLATE
Default path template for an EM entry's whole cell.- See Also:
-
-
Constructor Details
-
VolumeServerProvider
- Parameters:
cacheRoot- the BioJava cache directoryhost- which density server to use
-
-
Method Details
-
getHost
- Returns:
- which density server this instance uses
-
getBaseUrl
- Returns:
- the base URL in use
-
setBaseUrl
- Parameters:
baseUrl- the base URL; a trailing slash is added if missing
-
getDetail
public int getDetail()- Returns:
- the detail level requested from the server
-
setDetail
public void setDetail(int detail) Sets the detail level. Higher means a finer grid and a larger download; the relationship is neither linear nor the same for every entry.- Parameters:
detail- the level, normally 0 to 6
-
getEncoding
- Returns:
- the encoding requested, either
bciforcif
-
setEncoding
- Parameters:
encoding-bciffor BinaryCIF (default, and much smaller) orciffor text
-
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 for a request without fetching it.- Parameters:
request- the request; its kind must be concrete- Returns:
- the URL as a string, or
nullif the request cannot be served
-
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
-