Class RenamingBioAssayMapper
- java.lang.Object
-
- ubic.gemma.core.loader.util.mapper.RenamingBioAssayMapper
-
- All Implemented Interfaces:
BioAssayMapper
,EntityMapper<BioAssay>
public class RenamingBioAssayMapper extends Object implements BioAssayMapper
A BioAssay-to-sample-name matcher that renames samples before matching them.- Author:
- poirigui
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ubic.gemma.core.loader.util.mapper.EntityMapper
EntityMapper.MappingStatistics, EntityMapper.StatefulEntityMapper<T extends Identifiable>
-
-
Constructor Summary
Constructors Constructor Description RenamingBioAssayMapper(BioAssayMapper delegate, String[] bioAssayNames, String[] sampleNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Collection<BioAssay> bioAssays, String sampleName)
Check if any of the candidates can be mapped to the identifier.boolean
containsAny(Collection<BioAssay> bioAssays, Collection<String> sampleNames)
Check if any of the candidates can be mapped to any of the identifiers.EntityMapper.StatefulEntityMapper<BioAssay>
forCandidates(Collection<BioAssay> candidates)
Create a stateful mapper for a set of candidates.String
getName()
Obtain the name of the mapping strategy.Set<BioAssay>
matchAll(Collection<BioAssay> bioAssays, String sampleName)
Match the identifier to all the candidates.Optional<BioAssay>
matchOne(Collection<BioAssay> bioAssays, String sampleName)
Map the identifier to a single candidate.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ubic.gemma.core.loader.util.mapper.BioAssayMapper
forCandidates
-
Methods inherited from interface ubic.gemma.core.loader.util.mapper.EntityMapper
getMappingStatistics, matchAll, matchOne
-
-
-
-
Constructor Detail
-
RenamingBioAssayMapper
public RenamingBioAssayMapper(BioAssayMapper delegate, String[] bioAssayNames, String[] sampleNames)
- Parameters:
delegate
- a matcher that performs the underlying comparison of BA IDsbioAssayNames
- the BioAssay identifiers to usesampleNames
- the corresponding sample identifiers to use
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:EntityMapper
Obtain the name of the mapping strategy.- Specified by:
getName
in interfaceEntityMapper<BioAssay>
-
contains
public boolean contains(Collection<BioAssay> bioAssays, String sampleName)
Description copied from interface:EntityMapper
Check if any of the candidates can be mapped to the identifier.- Specified by:
contains
in interfaceEntityMapper<BioAssay>
-
containsAny
public boolean containsAny(Collection<BioAssay> bioAssays, Collection<String> sampleNames)
Description copied from interface:EntityMapper
Check if any of the candidates can be mapped to any of the identifiers.- Specified by:
containsAny
in interfaceEntityMapper<BioAssay>
-
matchOne
public Optional<BioAssay> matchOne(Collection<BioAssay> bioAssays, String sampleName)
Description copied from interface:EntityMapper
Map the identifier to a single candidate.If more than one candidate matches the identifier,
Optional.empty()
is returned.- Specified by:
matchOne
in interfaceEntityMapper<BioAssay>
-
matchAll
public Set<BioAssay> matchAll(Collection<BioAssay> bioAssays, String sampleName)
Description copied from interface:EntityMapper
Match the identifier to all the candidates.- Specified by:
matchAll
in interfaceEntityMapper<BioAssay>
-
forCandidates
public EntityMapper.StatefulEntityMapper<BioAssay> forCandidates(Collection<BioAssay> candidates)
Description copied from interface:EntityMapper
Create a stateful mapper for a set of candidates.- Specified by:
forCandidates
in interfaceEntityMapper<BioAssay>
-
-