Class CasePreservingProteinSequenceCreator
java.lang.Object
org.biojava.nbio.core.sequence.io.ProteinSequenceCreator
org.biojava.nbio.core.sequence.io.CasePreservingProteinSequenceCreator
- All Implemented Interfaces:
SequenceCreatorInterface<AminoAcidCompound>
A sequence creator which preserves the case of its input string in
the user collection of the returned ProteinSequence.
The user collection will be the same length as the resulting ProteinSequence. Each object can be cast to a Boolean. If true, the corresponding position in the input file was uppercase.
Example
CasePreservingProteinSequenceCreator creator =
new CasePreservingProteinSequenceCreator(AminoAcidCompoundSet.getAminoAcidCompoundSet());
AbstractSequence<AminoAcidCompound> seq = creator.getSequence("aaAA",0);
System.out.println(seq.getSequenceAsString()); //"AAAA"
System.out.println(seq.getUserCollection()); //"[false, false, true, true]"
-
Constructor Summary
ConstructorsConstructorDescriptionCasePreservingProteinSequenceCreator(CompoundSet<AminoAcidCompound> compoundSet) -
Method Summary
Modifier and TypeMethodDescriptiongetSequence(String sequence, long index) getSequence(List<AminoAcidCompound> list) Assumes all compounds were uppercasegetSequence(ProxySequenceReader<AminoAcidCompound> proxyLoader, long index) static voidsetLowercaseToNull(ProteinSequence seq, Object[] out) Takes aProteinSequencewhich was created by aCasePreservingProteinSequenceCreator.
-
Constructor Details
-
CasePreservingProteinSequenceCreator
-
-
Method Details
-
getSequence
public AbstractSequence<AminoAcidCompound> getSequence(ProxySequenceReader<AminoAcidCompound> proxyLoader, long index) - Specified by:
getSequencein interfaceSequenceCreatorInterface<AminoAcidCompound>- Overrides:
getSequencein classProteinSequenceCreator- Parameters:
proxyLoader-index- not used in this implementation- Returns:
- See Also:
-
getSequence
public AbstractSequence<AminoAcidCompound> getSequence(String sequence, long index) throws CompoundNotFoundException - Specified by:
getSequencein interfaceSequenceCreatorInterface<AminoAcidCompound>- Overrides:
getSequencein classProteinSequenceCreator- Parameters:
sequence-index- not used in this implementation- Returns:
- Throws:
CompoundNotFoundException
-
getSequence
Assumes all compounds were uppercase- Specified by:
getSequencein interfaceSequenceCreatorInterface<AminoAcidCompound>- Overrides:
getSequencein classProteinSequenceCreator- Parameters:
list-- Returns:
- See Also:
-
setLowercaseToNull
Takes aProteinSequencewhich was created by aCasePreservingProteinSequenceCreator. Uses the case info stored in the user collection to modify the output array.Sets elements of the output array which correspond to lowercase letters to null.
- Parameters:
seq- Input sequence with case stored as the user collectionout-
-