baobab.bio.permutation
Class PermutationBPGraphFormatter

java.lang.Object
  extended by baobab.bio.permutation.PermutationBPGraphFormatter

public class PermutationBPGraphFormatter
extends java.lang.Object

The PermutationBPGraphFormatter class gives a text representation of a breakpoint graph

Author:
Marilia D. V. Braga

Method Summary
 java.lang.String getCanonizedString()
          Generates a one-line string representation of a permutation
 java.lang.String getHighlightedString(boolean isCanonized, int start, int end)
           
 java.lang.String getHighlightedString(boolean isCanonized, int start, int middle, int end)
           
 java.lang.String getHighlightedString(int start, int end)
          Generates a two-lines string representation of a permutation
 java.lang.String getHighlightedString(int start, int middle, int end)
          Generates a two-lines string representation of a permutation
 java.lang.String getIndexedCycledString()
          Generates a four-lines string representation of a permutation (... represents an adjacency)
 java.lang.String getIndexedCycledString(boolean isCanonized)
           
 java.lang.String getIndexedHighlightedCycledString(boolean isCanonized, int start, int end)
           
 java.lang.String getIndexedHighlightedCycledString(boolean isCanonized, int start, int middle, int end)
           
 java.lang.String getIndexedHighlightedCycledString(int start, int end)
          Generates a five-lines string representation of a permutation (... represents an adjacency)
 java.lang.String getIndexedHighlightedCycledString(int start, int middle, int end)
          Generates a five-lines string representation of a permutation (... represents an adjacency)
 java.lang.String getIndexedHighlightedString(boolean isCanonized, int start, int end)
           
 java.lang.String getIndexedHighlightedString(boolean isCanonized, int start, int middle, int end)
           
 java.lang.String getIndexedHighlightedString(int start, int end)
          Generates a three-lines string representation of a permutation
 java.lang.String getIndexedHighlightedString(int start, int middle, int end)
          Generates a three-lines string representation of a permutation
 java.lang.String getIndexedString()
          Generates a two-lines string representation of a permutation
 java.lang.String getIndexedString(boolean isCanonized)
           
 PermutationBPGraph getPermutation()
           
 java.lang.String getSimpleMappedString()
          Generates a one-line string representation of a permutation with its (mapped) values
 java.lang.String getString()
          Generates a one-line string representation of a permutation
 java.lang.String reversalToCanonizedString(int start, int end)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPermutation

public PermutationBPGraph getPermutation()

reversalToCanonizedString

public java.lang.String reversalToCanonizedString(int start,
                                                  int end)

getCanonizedString

public java.lang.String getCanonizedString()
Generates a one-line string representation of a permutation

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, we have

 :: -04 -03 +12 -11 -08 +10 +09 +07 -06 -05 +02 -01  :: 5 cycles

Returns:
a string representation

getString

public java.lang.String getString()
Generates a one-line string representation of a permutation

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, we have

 :: -4  -3  +12 -11 -8  +10 +9  +7  -6  -5  +2  -1   :: 5 cycles

Returns:
a string representation

getIndexedString

public java.lang.String getIndexedString()
Generates a two-lines string representation of a permutation

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, we have

   01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13.             (position index)
 :: -04 -03 +12 -11 -08 +10 +09 +07 -06 -05 +02 -01  :: 5 cycles

Returns:
a string representation

getIndexedString

public java.lang.String getIndexedString(boolean isCanonized)

getHighlightedString

public java.lang.String getHighlightedString(int start,
                                             int end)
Generates a two-lines string representation of a permutation

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, highlighting positions from 9 to 11 makes:

          
 :: -04 -03 +12 -11 -08 +10 +09 +07 -06 -05 +02 -01  :: 5 cycles
                                    --------             (from [9] to [11])
                                     
   01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13.   (position index, only as reference)                                     

Parameters:
start - the beggining of the block to be highlighted
end - the end of the block to be highlighted
Returns:
a string representation

getHighlightedString

public java.lang.String getHighlightedString(boolean isCanonized,
                                             int start,
                                             int end)

getHighlightedString

public java.lang.String getHighlightedString(int start,
                                             int middle,
                                             int end)
Generates a two-lines string representation of a permutation

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, highlighting positions from 1 to 5, with middle at position 2 makes:

 :: -04 -03 +12 -11 -08 +10 +09 +07 -06 -05 +02 -01  :: 5 cycles
    ---|------------                                     (from [1] to [2] to [5])
 
   01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13.   (position index, only as reference)

Parameters:
start - the beggining of the block to be highlighted
middle - the middle of the block to be highlighted
end - the end of the block to be highlighted
Returns:
a string representation

getHighlightedString

public java.lang.String getHighlightedString(boolean isCanonized,
                                             int start,
                                             int middle,
                                             int end)

getIndexedHighlightedString

public java.lang.String getIndexedHighlightedString(int start,
                                                    int end)
Generates a three-lines string representation of a permutation

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, highlighting positions from 9 to 11 makes:

          
   01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13.                      (position index)
 :: -04 -03 +12 -11 -08 +10 +09 +07 -06 -05 +02 -01  :: 5 cycles
                                    --------             (from [9] to [11])

Parameters:
start - the beggining of the block to be highlighted
end - the end of the block to be highlighted
Returns:
a string representation

getIndexedHighlightedString

public java.lang.String getIndexedHighlightedString(boolean isCanonized,
                                                    int start,
                                                    int end)

getIndexedHighlightedCycledString

public java.lang.String getIndexedHighlightedCycledString(int start,
                                                          int end)
Generates a five-lines string representation of a permutation (... represents an adjacency)

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, highlighting positions from 9 to 11 makes:

          
   01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13.                       (position index)
   01> ... 01> <01 03> <02 <03 <02 02> ... 01> <01 <01                       (the cycle numbers, with black edge directions)
   :13 ... :12 :03 :07 :09 :05 :06 :08 ... :01 :11 :04                       (each cycle tour in an arbitrary direction)
 :: -04 -03 +12 -11 -08 +10 +09 +07 -06 -05 +02 -01  :: 5 cycles
                                    --------             (from [9] to [11])

Parameters:
start - the beggining of the block to be highlighted
end - the end of the block to be highlighted
Returns:
a string representation

getIndexedHighlightedCycledString

public java.lang.String getIndexedHighlightedCycledString(boolean isCanonized,
                                                          int start,
                                                          int end)

getIndexedHighlightedString

public java.lang.String getIndexedHighlightedString(int start,
                                                    int middle,
                                                    int end)
Generates a three-lines string representation of a permutation

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, highlighting positions from 1 to 5, with middle at position 2 makes:

   01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13.                            (position index)
 :: -04 -03 +12 -11 -08 +10 +09 +07 -06 -05 +02 -01  :: 5 cycles
    ---|------------                                     (from [1] to [2] to [5])

Parameters:
start - the beggining of the block to be highlighted
middle - the middle of the block to be highlighted
end - the end of the block to be highlighted
Returns:
a string representation

getIndexedHighlightedString

public java.lang.String getIndexedHighlightedString(boolean isCanonized,
                                                    int start,
                                                    int middle,
                                                    int end)

getIndexedHighlightedCycledString

public java.lang.String getIndexedHighlightedCycledString(int start,
                                                          int middle,
                                                          int end)
Generates a five-lines string representation of a permutation (... represents an adjacency)

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, highlighting positions from 1 to 5, with middle at position 2 makes:

          
   01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13.                             (position index)
   01> ... 01> <01 03> <02 <03 <02 02> ... 01> <01 <01                             (the cycle numbers, with black edge directions)
   :13 ... :12 :03 :07 :09 :05 :06 :08 ... :01 :11 :04                             (each cycle tour in an arbitrary direction)
 :: -04 -03 +12 -11 -08 +10 +09 +07 -06 -05 +02 -01  :: 5 cycles
    ---|------------                                     (from [1] to [2] to [5])

Parameters:
start - the beggining of the block to be highlighted
middle - the middle of the block to be highlighted
end - the end of the block to be highlighted
Returns:
a string representation

getIndexedHighlightedCycledString

public java.lang.String getIndexedHighlightedCycledString(boolean isCanonized,
                                                          int start,
                                                          int middle,
                                                          int end)

getIndexedCycledString

public java.lang.String getIndexedCycledString()
Generates a four-lines string representation of a permutation (... represents an adjacency)

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, we have

   01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13.               (index)
   01> ... 01> <01 03> <02 <03 <02 02> ... 01> <01 <01               (the cycle numbers, with black edge directions)
   :13 ... :12 :03 :07 :09 :05 :06 :08 ... :01 :11 :04               (each cycle tour in an arbitrary direction)
 :: -04 -03 +12 -11 -08 +10 +09 +07 -06 -05 +02 -01  :: 5 cycles

Returns:
a string representation

getIndexedCycledString

public java.lang.String getIndexedCycledString(boolean isCanonized)

getSimpleMappedString

public java.lang.String getSimpleMappedString()
Generates a one-line string representation of a permutation with its (mapped) values

Example: for the permutation -4,-3,12,-11,-8,9,7,-6,-5,2,-1, we have

 -4.-3.12.-11.-8.10.9.7.-6.-5.2.-1

Returns:
a string representation