Package org.biojava3.core.sequence.io
Class CasePreservingProteinSequenceCreator
java.lang.Object
org.biojava3.core.sequence.io.ProteinSequenceCreator
org.biojava3.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 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 voidstatic 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 classProteinSequenceCreatorindex- not used in this implementation- Returns:
- See Also:
-
getSequence
- Specified by:
getSequencein interfaceSequenceCreatorInterface<AminoAcidCompound>- Overrides:
getSequencein classProteinSequenceCreatorindex- not used in this implementation- Returns:
-
getSequence
Assumes all compounds were uppercase- Specified by:
getSequencein interfaceSequenceCreatorInterface<AminoAcidCompound>- Overrides:
getSequencein classProteinSequenceCreator- Returns:
- See Also:
-
main
-
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-
-