public final class VDJCLibraryRegistry extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
VDJCLibraryRegistry.AliasResolver
Interface implemented by
VDJCLibraryRegistry.LibraryResolver if it can also resolve library name aliases |
static class |
VDJCLibraryRegistry.ClasspathLibraryResolver
Load library data from {libraryName}.json files in specified folder.
|
static class |
VDJCLibraryRegistry.FolderLibraryResolver
Load library data from {libraryName}.json files in specified folder.
|
static interface |
VDJCLibraryRegistry.LibraryNameListProvider
Interface implemented by
VDJCLibraryRegistry.LibraryResolver if it can provide list of all base library names it can resolve |
static interface |
VDJCLibraryRegistry.LibraryResolver
Tries to resolve library name to array of VDJCLibraryData[] objects
E.g.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_LIBRARY_NAME
Name or alias-name of default V, D, J, C gene library.
|
| Constructor and Description |
|---|
VDJCLibraryRegistry()
Creates new VDJCLibraryRegistry with default sequence resolver
|
VDJCLibraryRegistry(SequenceResolver sequenceResolver)
Creates new VDJCLibraryRegistry with specific sequence resolver.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClasspathResolver(String searchPath)
Adds classpath resolver to search for libraries with {libraryName}.json names in the specified folder
|
void |
addClasspathResolver(String searchPath,
ClassLoader classLoader)
Adds classpath resolver to search for libraries with {libraryName}.json names in the specified folder
|
void |
addLibraryResolver(VDJCLibraryRegistry.LibraryResolver resolver)
Register library resolver to be used for automatic load of libraries by name and species
|
void |
addPathResolver(Path searchPath)
Adds path resolver to search for libraries with {libraryName}.json[.gz] file names in specified folder.
|
void |
addPathResolver(String searchPath)
Adds path resolver to search for libraries with {libraryName}.json[.gz] file names in specified folder.
|
void |
addPathResolverWithPartialSearch(Path searchPath)
Adds path resolver to search for libraries with {libraryName}[.*].json[.gz] file names in specified folder.
|
void |
addPathResolverWithPartialSearch(String searchPath)
Adds path resolver to search for libraries with {libraryName}[.*].json[.gz] file names in specified folder.
|
static VDJCLibraryRegistry |
createDefaultRegistry()
Creates new instance of basic default registry
|
static VDJCLibraryRegistry |
getDefault()
Returns default VDJCLibraryRegistry.
|
static VDJCLibrary |
getDefaultLibrary(long taxonId)
Retrieves default library (see description for
DEFAULT_LIBRARY_NAME) from default registry for the
specified species. |
static VDJCLibrary |
getDefaultLibrary(String species)
Retrieves default library (see description for
DEFAULT_LIBRARY_NAME) from default registry for the
specified species name. |
VDJCGene |
getGene(VDJCGeneId geneId)
Return gene by it's global id.
|
VDJCLibrary |
getLibrary(String libraryName,
long taxonId)
Returns library with specified name and specified species.
|
VDJCLibrary |
getLibrary(String libraryName,
String species)
Returns library with specified name and specified species.
|
VDJCLibrary |
getLibrary(VDJCLibraryId libraryId)
Returns library with specified name and specified species.
|
List<VDJCLibraryRegistry.LibraryResolver> |
getLibraryResolvers()
Return the list of library resolvers used by this registry
|
Collection<VDJCLibrary> |
getLoadedLibraries()
Returns collection of libraries that are currently loaded by this registry.
|
List<VDJCLibrary> |
getLoadedLibrariesByName(String libraryName)
Returns list of libraries that are currently loaded by this registry and has specified name.
|
List<VDJCLibrary> |
getLoadedLibrariesByNamePattern(Pattern libraryNamePattern)
Returns list of libraries that are currently loaded by this registry and has specified name pattern.
|
SequenceResolver |
getSequenceResolver()
Return sequence resolver used by this registry
|
List<String> |
getSpeciesNames(long taxonId)
Returns list of known species names for a given taxon id.
|
void |
loadAllLibraries()
Load all possible libraries using all available resolvers (resolvers having such feature)
|
void |
loadAllLibraries(String name)
Try resolve library using all available resolvers, and register all resolved libraries
|
void |
registerLibraries(Path file)
Register libraries from specific file
|
void |
registerLibraries(Path file,
String name)
Register libraries from specific file with specified name
|
void |
registerLibraries(String file)
Register libraries from specific file
|
void |
registerLibraries(String file,
String name)
Register libraries from specific file with specified name
|
VDJCLibrary |
registerLibrary(Path context,
String name,
VDJCLibraryData data)
Creates and registers single library from VDJCLibraryData
|
static void |
resetDefaultRegistry()
Resets default VDJLibrary registry
|
static void |
resetDefaultRegistry(SequenceResolver resolver)
Resets default VDJLibrary registry and sets specific sequence resolver
|
long |
resolveSpecies(String name)
Resolves species name to taxon id
|
Long |
tryResolveSpecies(String name)
Try resolves species name to taxon id.
|
public static final String DEFAULT_LIBRARY_NAME
public VDJCLibraryRegistry()
public VDJCLibraryRegistry(SequenceResolver sequenceResolver)
sequenceResolver - sequece resolver or null to use default resolverpublic SequenceResolver getSequenceResolver()
public Collection<VDJCLibrary> getLoadedLibraries()
public List<VDJCLibrary> getLoadedLibrariesByName(String libraryName)
public List<VDJCLibrary> getLoadedLibrariesByNamePattern(Pattern libraryNamePattern)
public long resolveSpecies(String name)
name - species nameIllegalArgumentException - if can't resolvepublic Long tryResolveSpecies(String name)
name - species namepublic List<String> getSpeciesNames(long taxonId)
taxonId - taxon idpublic void addLibraryResolver(VDJCLibraryRegistry.LibraryResolver resolver)
resolver - resolver to addpublic void addPathResolver(Path searchPath)
searchPath - path to search for {libraryName}.json[.gz] filespublic void addPathResolverWithPartialSearch(Path searchPath)
searchPath - path to search for {libraryName}[.*].json[.gz] filespublic void addPathResolverWithPartialSearch(String searchPath)
searchPath - path to search for {libraryName}[.*].json[.gz] filespublic void addPathResolver(String searchPath)
searchPath - path to search for {libraryName}.json files[.gz]public void addClasspathResolver(String searchPath)
searchPath - root address to search for {libraryName}.json files inn classpathpublic void addClasspathResolver(String searchPath, ClassLoader classLoader)
searchPath - root address to search for {libraryName}.json files inn classpathclassLoader - class loaderpublic VDJCGene getGene(VDJCGeneId geneId)
geneId - global gene idIllegalArgumentException - if gene or library not foundpublic VDJCLibrary getLibrary(String libraryName, String species)
libraryName - library namespecies - species nameRuntimeException - if no library foundIllegalArgumentException - if species can't be resolvedpublic VDJCLibrary getLibrary(String libraryName, long taxonId)
libraryName - library nametaxonId - taxon idRuntimeException - if no library foundpublic VDJCLibrary getLibrary(VDJCLibraryId libraryId)
libraryId - identifier of the libraryRuntimeException - if no library found or checksum check failedpublic void loadAllLibraries(String name)
name - library namepublic void loadAllLibraries()
public VDJCLibrary registerLibrary(Path context, String name, VDJCLibraryData data)
context - context to use for resolution of sequencesname - library namedata - library datapublic void registerLibraries(String file)
file - libraries json filepublic void registerLibraries(String file, String name)
file - libraries json filename - library namepublic void registerLibraries(Path file)
file - libraries json filepublic void registerLibraries(Path file, String name)
file - libraries json filename - library namepublic static void resetDefaultRegistry()
public static void resetDefaultRegistry(SequenceResolver resolver)
public static VDJCLibraryRegistry createDefaultRegistry()
public static VDJCLibraryRegistry getDefault()
public static VDJCLibrary getDefaultLibrary(String species)
DEFAULT_LIBRARY_NAME) from default registry for the
specified species name.
Equivalent of calling:
getDefault().getLibrary(DEFAULT_LIBRARY_NAME, species);species - species nameIllegalArgumentException - if species can't be resolvedpublic static VDJCLibrary getDefaultLibrary(long taxonId)
DEFAULT_LIBRARY_NAME) from default registry for the
specified species.
Equivalent of calling:
getDefault().getLibrary(DEFAULT_LIBRARY_NAME, taxonId);taxonId - taxon idpublic List<VDJCLibraryRegistry.LibraryResolver> getLibraryResolvers()
Copyright © 2017. All rights reserved.