|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbaobab.bio.permutation.SignedPermutationBPGraph
public class SignedPermutationBPGraph
The SignedPermutationBPGraph class represents a signed permutation pair and its breakpoint graph (the SignedPermutationBPGraph class does not deal with hurdles)
Constructor Summary | |
---|---|
SignedPermutationBPGraph(int[] permutationList)
Creates a new linear permutation (assumes the identity permutation as target) |
|
SignedPermutationBPGraph(int[] permutationList,
boolean isLinear)
Creates a new permutation (assumes the identity permutation as target) |
|
SignedPermutationBPGraph(int[] permutationList,
boolean isLinear,
double[] weights)
Creates a new permutation (assumes the identity permutation as target) |
|
SignedPermutationBPGraph(int[] permutationList,
double[] weights)
Creates a new linear permutation (assumes the identity permutation as target) |
|
SignedPermutationBPGraph(int[] originList,
int[] targetList)
Creates a new linear permutation |
|
SignedPermutationBPGraph(int[] originList,
int[] targetList,
boolean isLinear)
Creates a new permutation |
|
SignedPermutationBPGraph(int[] originList,
int[] targetList,
boolean isLinear,
double[] weightList)
Creates a new permutation |
|
SignedPermutationBPGraph(java.util.Vector<java.lang.String> origin,
java.util.Vector<java.lang.String> target,
boolean isLinear)
Creates a new permutation |
|
SignedPermutationBPGraph(java.util.Vector<java.lang.String> origin,
java.util.Vector<java.lang.String> target,
boolean isLinear,
java.util.Vector<java.lang.Double> weightList)
Creates a new permutation |
Method Summary | |
---|---|
static java.util.Vector<int[]> |
blocksToIntArrays(java.util.Collection blocks)
Transforms the collection of blocks to a collection of arrays of int (with length = 2) |
boolean |
canCollapse()
Tests whether this permutation can be collapsed |
java.lang.Object |
clone()
|
SignedPermutationBPGraph |
collapse(boolean monooriented)
Collapses this permutation (eliminating adjacencies) |
int |
compareTo(java.lang.Object object)
Compares this block to another block |
boolean |
containsUnorientedComponent()
Tests whether this permutation contains an unoriented component (hurdle) |
boolean |
equals(SignedPermutationBPGraph perm)
|
double |
getAverageWeightOfInterval(int startPos,
int endPos)
Gets the average weight of an interval of the permutation |
java.util.TreeSet<BPGraphPoint> |
getBreakpoints()
Gets the breakpoint list of this block |
BPGraphCycle |
getCycle(int number)
Gets the list of cycles of this group of cycles |
java.util.SortedSet<BPGraphCycle> |
getCycles()
Gets the list of cycles of this group of cycles |
java.lang.String |
getData()
|
BPGraphPoint |
getFirstPoint()
Gets the first point of the permutation |
PermutationBPGraphFormatter |
getFormatter()
Gets this breakpoint graph formatter |
java.lang.String[] |
getIntToNamesMap()
|
BPGraphPoint |
getLastPoint()
Gets the last point of the permutation |
int |
getLastPointIndex()
Gets the position of the last point of the permutation |
int |
getLongestNameLength()
Gets the longest length of a value name in the breakpoint graph |
int[] |
getMappedPositions()
|
int |
getMappedValueAt(int pos)
Gets the value of the mapped element located at a specified position of the permutation |
int[] |
getMappedValues()
|
int[] |
getMappedValuesAroundPosition(int pos)
Gets the two values around a position of the permutation |
int |
getMiddleOfInterval(int startPos,
int endPos,
double[] dist)
Gets the middle position of an interval of the permutation |
int |
getMinimalReversalDistance()
Gets the minimal reversal distance of this permutation (considering only the number of cycles property) |
java.lang.String |
getNameAt(int pos)
Gets the name of the element located at a specified position of the permutation |
java.lang.String |
getNameOf(int value)
Gets the name of the element represented by the given value of the permutation |
java.util.Hashtable<java.lang.String,java.lang.Integer> |
getNamesToIntMap()
|
SignedPermutationBPGraph |
getNotCollapsed()
|
int |
getNumberOfBreakpoints()
Gets the number of breakpoints |
int |
getNumberOfCycles()
Gets the number of cycles of this group of cycles |
java.util.SortedSet |
getOrientedCycles()
Gets the list of oriented cycles of this group of cycles |
PermutationBPGraph |
getPermutationBPGraph()
Gets this permutation |
BPGraphPoint |
getPointAt(int pos)
Gets a point at a specific position of the permutation |
BPGraphPoint |
getPointBetweenMapped(int value1,
int value2)
Gets a point between two values of the permutation |
java.util.SortedSet<BPGraphPoint> |
getPoints()
Gets all points which belong to this group of cycles |
int |
getPositionOf(int value)
Gets the position where a specified element of the permutation is located |
int |
getPositionOf(java.lang.String name)
Gets the position of the element identified by the given name |
int |
getPositionOfMapped(int value)
Gets the position where a specified mapped element of the permutation is located |
int |
getReversalDistance()
Gets the reversal distance of this permutation |
SignedPermutationBPGraphReversalFilter |
getReversalFilter()
Gets the reversal filter of this permutation |
java.lang.String |
getSignedDescription(java.lang.String name,
boolean isReverted)
|
java.util.Hashtable<java.lang.String,java.lang.String[]> |
getSignedDescriptor()
|
double |
getTotalWeight()
Gets the total weight (the sum of the weights of all values) of this permutation |
java.util.SortedSet<BPGraphCycle> |
getUnorientedCycles()
Gets the list of non-oriented cycles of this group of cycles |
java.util.TreeSet<java.lang.String> |
getUnsignedDescription(java.lang.String name)
|
java.util.Hashtable<java.lang.String,java.util.TreeSet<java.lang.String>> |
getUnsignedDescriptor()
|
int |
getValueAt(int pos)
Gets the value of the element located at a specified position of the permutation |
double[] |
getWeightMap()
Gets the weights of the values of this permutation (map[i] is the weight of the value mapped to the integer i) |
double |
getWeightOf(java.lang.String name)
Gets the weight of the value identified by the given name |
double |
getWeightOfInterval(int startPos,
int endPos)
Gets the total weight of an interval of the permutation |
boolean |
isAdjacency()
Tests whether this permutation is sorted |
boolean |
isCycleBreakingReversal(int start,
int end)
Tests whether a reversal is safe (the permutation obtained after performing such a reversal has a smaller reversal distance than this permutation) |
boolean |
isLinear()
Tests whether the permutation is linear or circular |
boolean |
isOriented()
Tests whether this cycle group is oriented |
boolean |
isRevertedAt(int pos)
Gets the value of the element located at a specified position of the permutation |
boolean |
isSorted()
Tests whether this permutation is sorted |
int |
length()
Gets the length of the block (the number of values of the permutation between its start and end points) |
SignedPermutationBPGraph |
revert(BPGraphPoint start,
BPGraphPoint end)
Reverts the permutation between the specified points |
SignedPermutationBPGraph |
revert(BPGraphReversalBlock block)
Reverts the specified block of the permutation |
SignedPermutationBPGraph |
revert(int start,
int end)
Reverts the permutation between the specified positions |
SignedPermutationBPGraph |
revertToNewPermutation(BPGraphPoint start,
BPGraphPoint end)
Make a new permutation, by reverting the permutation between the specified positions |
SignedPermutationBPGraph |
revertToNewPermutation(int start,
int end)
Make a new permutation, by reverting the permutation between the specified positions |
void |
setDescriptor(java.util.Hashtable<java.lang.String,java.lang.String[]> signedDescriptor,
java.util.Hashtable<java.lang.String,java.util.TreeSet<java.lang.String>> sortedUnsignedDescriptor)
|
int |
size()
Gets the size (or the number of values) of the permutation |
int[] |
toIntArray()
Gets a representation of the block as an array of int, with size 2, representing its start and end positions |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface baobab.bio.permutation.PermutationBPGraph |
---|
getNumberOfCycles |
Constructor Detail |
---|
public SignedPermutationBPGraph(int[] permutationList)
permutationList
- the list of signed integers (from +/-1 to +/-n), as an array of intpublic SignedPermutationBPGraph(int[] permutationList, double[] weights)
permutationList
- the list of signed integers (from +/-1 to +/-n), as an array of intweights
- the weights of the values in permutationListpublic SignedPermutationBPGraph(int[] permutationList, boolean isLinear, double[] weights)
permutationList
- the list of signed integers (from +/-1 to +/-n), as an array of intisLinear
- indicates whether the permutation is linear or circularweights
- the weights of the values in permutationListpublic SignedPermutationBPGraph(int[] permutationList, boolean isLinear)
permutationList
- the list of signed integers (from +/-1 to +/-n), as an array of intisLinear
- indicates whether the permutation is linear or circularpublic SignedPermutationBPGraph(int[] originList, int[] targetList)
originList
- the origin list of signed integers (from +/-1 to +/-n), as an array of inttargetList
- the target list of signed integers (from +/-1 to +/-n), as an array of intpublic SignedPermutationBPGraph(int[] originList, int[] targetList, boolean isLinear)
originList
- the origin list of signed integers (from +/-1 to +/-n), as an array of inttargetList
- the target list of signed integers (from +/-1 to +/-n), as an array of intisLinear
- indicates whether the permutation is linear or circularpublic SignedPermutationBPGraph(int[] originList, int[] targetList, boolean isLinear, double[] weightList)
originList
- the origin list of signed integers (from +/-1 to +/-n), as an array of inttargetList
- the target list of signed integers (from +/-1 to +/-n), as an array of intisLinear
- indicates whether the permutation is linear or circularweightList
- the weights of the values in originListpublic SignedPermutationBPGraph(java.util.Vector<java.lang.String> origin, java.util.Vector<java.lang.String> target, boolean isLinear)
origin
- the origin list of signed markerstarget
- the target list of signed markersisLinear
- indicates whether the permutation is linear or circularpublic SignedPermutationBPGraph(java.util.Vector<java.lang.String> origin, java.util.Vector<java.lang.String> target, boolean isLinear, java.util.Vector<java.lang.Double> weightList)
origin
- the origin list of signed markers represented as Strings (when a value starts with "-" it is assumed to be in reversed orientation)target
- the target list of signed markers represented as Strings (when a value starts with "-" it is assumed to be in reversed orientation)isLinear
- indicates whether the permutation is linear or circularweightList
- the weights of the values in originMethod Detail |
---|
public double getTotalWeight()
public double[] getWeightMap()
public double getWeightOf(java.lang.String name)
name
- the name of the value
public double getAverageWeightOfInterval(int startPos, int endPos)
startPos
- the start of the intervalendPos
- the end of the interval
public double getWeightOfInterval(int startPos, int endPos)
startPos
- the start of the intervalendPos
- the end of the interval
public int getMiddleOfInterval(int startPos, int endPos, double[] dist)
startPos
- the start position of the intervalendPos
- the end position of the intervaldist
- an array of lenght 2 to store the total weight of two different intervals of the permutation
(dist[0] is the weight of the interval that starts in startPos and ends in the middle position,
dist[1] is the weight of the interval that starts in the middle position and ends in the endPos)
public int getLongestNameLength()
PermutationBPGraph
getLongestNameLength
in interface PermutationBPGraph
public boolean isLinear()
isLinear
in interface PermutationBPGraph
public BPGraphPoint getFirstPoint()
getFirstPoint
in interface PermutationBPGraph
public int getLastPointIndex()
getLastPointIndex
in interface PermutationBPGraph
public BPGraphPoint getLastPoint()
getLastPoint
in interface PermutationBPGraph
public PermutationBPGraph getPermutationBPGraph()
public int[] getMappedValues()
public int[] getMappedPositions()
public int getMinimalReversalDistance()
public int getReversalDistance()
public int size()
size
in interface PermutationBPGraph
public BPGraphPoint getPointAt(int pos)
getPointAt
in interface PermutationBPGraph
pos
- the given position
public BPGraphPoint getPointBetweenMapped(int value1, int value2)
value1
- the first valuevalue2
- the second value
public int[] getMappedValuesAroundPosition(int pos)
pos
- the given position
public int getMappedValueAt(int pos)
getMappedValueAt
in interface PermutationBPGraph
pos
- the specified position
public int getValueAt(int pos)
getValueAt
in interface PermutationBPGraph
pos
- the specified position
public int getPositionOf(java.lang.String name)
getPositionOf
in interface PermutationBPGraph
name
- the given name
public java.lang.String getNameAt(int pos)
getNameAt
in interface PermutationBPGraph
pos
- the specified position
public java.lang.String getNameOf(int value)
value
- the specified value
public java.lang.String[] getIntToNamesMap()
public java.util.Hashtable<java.lang.String,java.lang.Integer> getNamesToIntMap()
public boolean isRevertedAt(int pos)
isRevertedAt
in interface PermutationBPGraph
pos
- the specified position
public int getPositionOf(int value)
getPositionOf
in interface PermutationBPGraph
value
- the value of the specified element
public int getPositionOfMapped(int value)
getPositionOfMapped
in interface PermutationBPGraph
value
- the value of the specified mapped element
public SignedPermutationBPGraph revert(BPGraphReversalBlock block) throws PermutationException
block
- the block to be reverted
PermutationException
public SignedPermutationBPGraph revert(BPGraphPoint start, BPGraphPoint end) throws PermutationException
start
- the beginning of the reversion blockend
- the end of the reversion block
PermutationException
public SignedPermutationBPGraph revert(int start, int end)
start
- the beginning of the reversion blockend
- the end of the reversion block
public SignedPermutationBPGraph revertToNewPermutation(BPGraphPoint start, BPGraphPoint end) throws PermutationException
start
- the beginning of the reversion blockend
- the end of the reversion block
PermutationException
public SignedPermutationBPGraph revertToNewPermutation(int start, int end)
start
- the beginning of the reversion blockend
- the end of the reversion block
public boolean isAdjacency()
public boolean isSorted()
isSorted
in interface PermutationBPGraph
public boolean isCycleBreakingReversal(int start, int end)
start
- the start of the given reversalend
- the end of the given reversal
public boolean containsUnorientedComponent()
public SignedPermutationBPGraphReversalFilter getReversalFilter()
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(SignedPermutationBPGraph perm)
public PermutationBPGraphFormatter getFormatter()
PermutationBPGraph
getFormatter
in interface PermutationBPGraph
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getData()
public boolean canCollapse()
public SignedPermutationBPGraph collapse(boolean monooriented)
monooriented
- false = eliminate all adjacencies; true = eliminate the adjacencies at the same DNA strand
public void setDescriptor(java.util.Hashtable<java.lang.String,java.lang.String[]> signedDescriptor, java.util.Hashtable<java.lang.String,java.util.TreeSet<java.lang.String>> sortedUnsignedDescriptor)
public java.util.Hashtable<java.lang.String,java.util.TreeSet<java.lang.String>> getUnsignedDescriptor()
public java.util.Hashtable<java.lang.String,java.lang.String[]> getSignedDescriptor()
public java.util.TreeSet<java.lang.String> getUnsignedDescription(java.lang.String name)
public java.lang.String getSignedDescription(java.lang.String name, boolean isReverted)
public SignedPermutationBPGraph getNotCollapsed()
public java.util.TreeSet<BPGraphPoint> getBreakpoints()
public int getNumberOfBreakpoints()
public int getNumberOfCycles()
public java.util.SortedSet<BPGraphCycle> getCycles()
public java.util.SortedSet getOrientedCycles()
public boolean isOriented()
public java.util.SortedSet<BPGraphPoint> getPoints()
public BPGraphCycle getCycle(int number)
public java.util.SortedSet<BPGraphCycle> getUnorientedCycles()
public int length()
public int[] toIntArray()
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
object
- the other block
public static java.util.Vector<int[]> blocksToIntArrays(java.util.Collection blocks)
blocks
- a collection of blocks
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |