Class CasePreservingProteinSequenceCreator
- java.lang.Object
-
- org.biojava.nbio.core.sequence.io.ProteinSequenceCreator
-
- org.biojava.nbio.core.sequence.io.CasePreservingProteinSequenceCreator
-
- All Implemented Interfaces:
SequenceCreatorInterface<AminoAcidCompound>
public class CasePreservingProteinSequenceCreator extends ProteinSequenceCreator
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
Constructors Constructor Description CasePreservingProteinSequenceCreator(CompoundSet<AminoAcidCompound> compoundSet)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractSequence<AminoAcidCompound>
getSequence(String sequence, long index)
AbstractSequence<AminoAcidCompound>
getSequence(List<AminoAcidCompound> list)
Assumes all compounds were uppercaseAbstractSequence<AminoAcidCompound>
getSequence(ProxySequenceReader<AminoAcidCompound> proxyLoader, long index)
static void
setLowercaseToNull(ProteinSequence seq, Object[] out)
Takes aProteinSequence
which was created by aCasePreservingProteinSequenceCreator
.
-
-
-
Constructor Detail
-
CasePreservingProteinSequenceCreator
public CasePreservingProteinSequenceCreator(CompoundSet<AminoAcidCompound> compoundSet)
-
-
Method Detail
-
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:
ProteinSequenceCreator.getSequence(org.biojava.nbio.core.sequence.template.ProxySequenceReader, long)
-
getSequence
public AbstractSequence<AminoAcidCompound> getSequence(String sequence, long index) throws CompoundNotFoundException
- Specified by:
getSequence
in interfaceSequenceCreatorInterface<AminoAcidCompound>
- Overrides:
getSequence
in classProteinSequenceCreator
index
- not used in this implementation- Returns:
- Throws:
CompoundNotFoundException
-
getSequence
public AbstractSequence<AminoAcidCompound> getSequence(List<AminoAcidCompound> list)
Assumes all compounds were uppercase- Specified by:
getSequence
in interfaceSequenceCreatorInterface<AminoAcidCompound>
- Overrides:
getSequence
in classProteinSequenceCreator
- Returns:
- See Also:
ProteinSequenceCreator.getSequence(java.util.List)
-
setLowercaseToNull
public static void setLowercaseToNull(ProteinSequence seq, Object[] out)
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
-
-
-