public static class RichSequence.Tools extends Object
Modifier and Type | Method and Description |
---|---|
static RichSequence |
createRichSequence(Namespace ns,
String name,
String seqString,
Alphabet alpha)
Create a new RichSequence in the specified namespace.
|
static RichSequence |
createRichSequence(Namespace ns,
String name,
SymbolList syms)
Create a new RichSequence in the specified namespace.
|
static RichSequence |
createRichSequence(String name,
String seqString,
Alphabet alpha)
Create a new RichSequence in the default namespace.
|
static RichSequence |
createRichSequence(String namespace,
String name,
String seqString,
Alphabet alpha)
Create a new RichSequence in the specified namespace.
|
static RichSequence |
createRichSequence(String name,
SymbolList syms)
Create a new RichSequence in the default namespace.
|
static RichSequence |
enrich(Sequence s)
Boldly attempts to convert a
Sequence into a
RichSequence . |
static RichSequence |
subSequence(RichSequence s,
int from,
int to,
Namespace newNamespace,
String newName,
String newAccession,
String newIdentifier,
int newVersion,
Double seqVersion)
Creates a new sequence from a subregion of another sequence.
|
public static RichSequence createRichSequence(String name, String seqString, Alphabet alpha) throws BioException
name
- The name for the sequence. Will also be used for the
accession.seqString
- The sequence stringalpha
- The Alphabet
for the sequenceRichSequence
. All versions are 1 or 1.0BioException
- If the symbols in seqString
are not valid in
alpha
public static RichSequence createRichSequence(String namespace, String name, String seqString, Alphabet alpha) throws BioException
namespace
- the namespace to create the sequence in. A singleton
Namespace
will be created or retrieved as
appropriate.name
- The name for the sequence. Will also be used for the
accession.seqString
- The sequence stringalpha
- The Alphabet
for the sequenceRichSequence
. All versions are 1 or 1.0BioException
- If the symbols in seqString
are not valid in
alpha
public static RichSequence createRichSequence(Namespace ns, String name, String seqString, Alphabet alpha) throws BioException
ns
- The namespace to create the sequence in.name
- The name for the sequence. Will also be used for the
accession.seqString
- The sequence stringalpha
- The Alphabet
for the sequenceRichSequence
. All versions are 1 or 1.0BioException
- If the symbols in seqString
are not valid in
alpha
public static RichSequence createRichSequence(String name, SymbolList syms)
syms
- The symbols to add to the sequence.name
- The name for the sequence. Will also be used for the
accession.RichSequence
. All versions are 1 or 1.0public static RichSequence createRichSequence(Namespace ns, String name, SymbolList syms)
ns
- the namespace to create the sequence in.syms
- The symbols to add to the sequence.name
- The name for the sequence. Will also be used for the
accession.RichSequence
. All versions are 1 or 1.0public static RichSequence enrich(Sequence s) throws ChangeVetoException
Sequence
into a
RichSequence
. Sequence
s will be assigned to
the default namespace. The accession will be assumed to be the name
of the old sequence. The version of the sequence will be set to 0 and
the seqversion set to 0.0. Feature
s are converted to
RichFeature
s. The old Annotation
bundle is
converted to a RichAnnotation
s
- The Sequence
to enrichRichSequence
ChangeVetoException
- if s
is locked or the conversion fails.public static RichSequence subSequence(RichSequence s, int from, int to, Namespace newNamespace, String newName, String newAccession, String newIdentifier, int newVersion, Double seqVersion) throws IndexOutOfBoundsException
Creates a new sequence from a subregion of another sequence. The sequence is not a view. The sequence can be given a new Namespace, Accession, Name, Identifier etc. or you can copy over the old values. For unique identification in databases we recommend you change at least the name and identifier.
The new sequence will retain all features that are fully contained by the new subsequence, the note set (annotation), Taxon, and description, modified to reflect the subsequence as follows:
seq.setDescription("subsequence (" + from + ":" + to + ") of " + s.getDescription());No other properties are copied.
newVersion
- the new version numberseqVersion
- the new sequence versions
- the original RichSequence
.from
- the 1st subsequence coordinate (inclusive)to
- the last subsequence coordinate (inclusive)newNamespace
- the new Namespace
newName
- the new namenewAccession
- the new accession numbernewIdentifier
- the new identifierRichSequence
IndexOutOfBoundsException
- if from
or to
lie outside of
the bounds of s
.Copyright © 2014 BioJava. All rights reserved.