Package org.biojava.nbio.alignment
Class Alignments
- java.lang.Object
-
- org.biojava.nbio.alignment.Alignments
-
public class Alignments extends Object
Static utility to easily run alignment routines. To exit cleanly after running any parallel method that mentions use of theConcurrencyTools
utility,ConcurrencyTools.shutdown()
orConcurrencyTools.shutdownAndAwaitTermination()
must be called.- Author:
- Mark Chapman
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Alignments.PairInProfileScorerType
List of implemented sequence pair in a profile scoring routines.static class
Alignments.PairwiseSequenceAlignerType
List of implemented pairwise sequence alignment routines.static class
Alignments.PairwiseSequenceScorerType
List of implemented pairwise sequence scoring routines.static class
Alignments.ProfileProfileAlignerType
List of implemented profile-profile alignment routines.static class
Alignments.RefinerType
List of implemented profile refinement routines.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S extends Sequence<C>,C extends Compound>
List<SequencePair<S,C>>getAllPairsAlignments(List<S> sequences, Alignments.PairwiseSequenceAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
static <S extends Sequence<C>,C extends Compound>
List<PairwiseSequenceScorer<S,C>>getAllPairsScorers(List<S> sequences, Alignments.PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
static <S extends Sequence<C>,C extends Compound>
double[]getAllPairsScores(List<S> sequences, Alignments.PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
static <S extends Sequence<C>,C extends Compound>
Profile<S,C>getMultipleSequenceAlignment(List<S> sequences, Object... settings)
static <S extends Sequence<C>,C extends Compound>
PairwiseSequenceAligner<S,C>getPairwiseAligner(S query, S target, Alignments.PairwiseSequenceAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
Factory method which constructs a pairwise sequence aligner.static <S extends Sequence<C>,C extends Compound>
SequencePair<S,C>getPairwiseAlignment(S query, S target, Alignments.PairwiseSequenceAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
Factory method which computes a sequence alignment for the givenSequence
pair.static <S extends Sequence<C>,C extends Compound>
Profile<S,C>getProgressiveAlignment(GuideTree<S,C> tree, Alignments.ProfileProfileAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
Factory method to run the profile-profile alignments of a progressive multiple sequence alignment concurrently.static <S extends Sequence<C>,C extends Compound>
double[]runPairwiseScorers(List<PairwiseSequenceScorer<S,C>> scorers)
Factory method to run a list of scorers concurrently.
-
-
-
Method Detail
-
getAllPairsAlignments
public static <S extends Sequence<C>,C extends Compound> List<SequencePair<S,C>> getAllPairsAlignments(List<S> sequences, Alignments.PairwiseSequenceAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
Factory method which computes a sequence alignment for allSequence
pairs in the givenList
. This method runs the alignments in parallel by submitting all of the alignments to the shared thread pool of theConcurrencyTools
utility.- Type Parameters:
S
- eachSequence
of an alignment pair is of type SC
- each element of anAlignedSequence
is aCompound
of type C- Parameters:
sequences
- theList
ofSequence
s to aligntype
- chosen type from list of pairwise sequence alignment routinesgapPenalty
- the gap penalties used during alignmentsubMatrix
- the set of substitution scores used during alignment- Returns:
- list of sequence alignment pairs
-
getMultipleSequenceAlignment
public static <S extends Sequence<C>,C extends Compound> Profile<S,C> getMultipleSequenceAlignment(List<S> sequences, Object... settings)
-
getPairwiseAlignment
public static <S extends Sequence<C>,C extends Compound> SequencePair<S,C> getPairwiseAlignment(S query, S target, Alignments.PairwiseSequenceAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
Factory method which computes a sequence alignment for the givenSequence
pair.- Type Parameters:
S
- eachSequence
of the pair is of type SC
- each element of anAlignedSequence
is aCompound
of type C- Parameters:
query
- the firstSequence
s to aligntarget
- the secondSequence
s to aligntype
- chosen type from list of pairwise sequence alignment routinesgapPenalty
- the gap penalties used during alignmentsubMatrix
- the set of substitution scores used during alignment- Returns:
- sequence alignment pair
-
getAllPairsScorers
public static <S extends Sequence<C>,C extends Compound> List<PairwiseSequenceScorer<S,C>> getAllPairsScorers(List<S> sequences, Alignments.PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
- Type Parameters:
S
- eachSequence
of a pair is of type SC
- each element of aSequence
is aCompound
of type C- Parameters:
sequences
- theList
ofSequence
s to aligntype
- chosen type from list of pairwise sequence scoring routinesgapPenalty
- the gap penalties used during alignmentsubMatrix
- the set of substitution scores used during alignment- Returns:
- list of sequence pair scorers
-
getAllPairsScores
public static <S extends Sequence<C>,C extends Compound> double[] getAllPairsScores(List<S> sequences, Alignments.PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
Factory method which computes a sequence pair score for allSequence
pairs in the givenList
. This method runs the scorings in parallel by submitting all of the scorings to the shared thread pool of theConcurrencyTools
utility.- Type Parameters:
S
- eachSequence
of a pair is of type SC
- each element of aSequence
is aCompound
of type C- Parameters:
sequences
- theList
ofSequence
s to aligntype
- chosen type from list of pairwise sequence scoring routinesgapPenalty
- the gap penalties used during alignmentsubMatrix
- the set of substitution scores used during alignment- Returns:
- list of sequence pair scores
-
getPairwiseAligner
public static <S extends Sequence<C>,C extends Compound> PairwiseSequenceAligner<S,C> getPairwiseAligner(S query, S target, Alignments.PairwiseSequenceAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
Factory method which constructs a pairwise sequence aligner.- Type Parameters:
S
- eachSequence
of an alignment pair is of type SC
- each element of anAlignedSequence
is aCompound
of type C- Parameters:
query
- the firstSequence
to aligntarget
- the secondSequence
to aligntype
- chosen type from list of pairwise sequence alignment routinesgapPenalty
- the gap penalties used during alignmentsubMatrix
- the set of substitution scores used during alignment- Returns:
- pairwise sequence aligner
-
getProgressiveAlignment
public static <S extends Sequence<C>,C extends Compound> Profile<S,C> getProgressiveAlignment(GuideTree<S,C> tree, Alignments.ProfileProfileAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
Factory method to run the profile-profile alignments of a progressive multiple sequence alignment concurrently. This method runs the alignments in parallel by submitting all of the alignment tasks to the shared thread pool of theConcurrencyTools
utility.- Type Parameters:
S
- eachSequence
of theProfile
pair is of type SC
- each element of anAlignedSequence
is aCompound
of type C- Parameters:
tree
- guide tree to follow aligning profiles from leaves to roottype
- chosen type from list of profile-profile alignment routinesgapPenalty
- the gap penalties used during alignmentsubMatrix
- the set of substitution scores used during alignment- Returns:
- multiple sequence alignment
-
runPairwiseScorers
public static <S extends Sequence<C>,C extends Compound> double[] runPairwiseScorers(List<PairwiseSequenceScorer<S,C>> scorers)
Factory method to run a list of scorers concurrently. This method runs the scorers in parallel by submitting all of the scoring tasks to the shared thread pool of theConcurrencyTools
utility.
-
-