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
ConstructorDescriptionCasePreservingProteinSequenceCreator
(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 void
static void
setLowercaseToNull
(ProteinSequence seq, Object[] out) Takes aProteinSequence
which was created by aCasePreservingProteinSequenceCreator
.
-
Constructor Details
-
CasePreservingProteinSequenceCreator
-
-
Method Details
-
getSequence
public AbstractSequence<AminoAcidCompound> getSequence(ProxySequenceReader<AminoAcidCompound> proxyLoader, long index) - Specified by:
getSequence
in interfaceSequenceCreatorInterface<AminoAcidCompound>
- Overrides:
getSequence
in classProteinSequenceCreator
index
- not used in this implementation- Returns:
- See Also:
-
getSequence
- Specified by:
getSequence
in interfaceSequenceCreatorInterface<AminoAcidCompound>
- Overrides:
getSequence
in classProteinSequenceCreator
index
- not used in this implementation- Returns:
-
getSequence
Assumes all compounds were uppercase- Specified by:
getSequence
in interfaceSequenceCreatorInterface<AminoAcidCompound>
- Overrides:
getSequence
in classProteinSequenceCreator
- Returns:
- See Also:
-
main
-
setLowercaseToNull
Takes aProteinSequence
which 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
-
-