|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectSIGRS.Methods
public class Methods
SIGRS is a collection of routines used in searching for regions of contrasting composition (CCRs) in sequence files using a partial sum process. Significance of segments is evaluated using Karlin-Altschul statistics and specifically an extension by Karlin-Dembo allowing for nucleotides to have a Markov-dependence (see e.g. Karlin & Altschul (1993) and Karlin & Dembo (1992)
The routines are provided as is and no guarantee regarding stability etc. is given so use at your own risk!
See publication Larsson, P., Hinas, A., Ardell, D.H., Kirsebom, L.A., Virtanen, A. and Söderbom, F. De novo search for non-coding RNA genes in the AT-rich genome of Dictyostelium discoideum: performance of Markov-dependent genome feature scoring
Questions and comments can be directed to Pontus.Larsson@icm.uu.se
| Field Summary | |
|---|---|
static char[] |
nucleotideCharCode
|
static java.lang.String |
nucleotideCode
|
| Constructor Summary | |
|---|---|
Methods()
|
|
| Method Summary | |
|---|---|
static byte[][] |
addElement(byte[] n,
byte[][] arr)
Adds an element to the end of an array |
static byte[] |
addElement(byte n,
byte[] arr)
Adds an element to the end of an array |
static double[][] |
addElement(double[] n,
double[][] arr)
Adds an element to the end of an array |
static java.io.File[] |
addElement(java.io.File nO,
java.io.File[] arr)
Adds an element to the end of an array |
static int[] |
addElement(int n,
int[] arr)
Adds an element to the end of an array |
static java.lang.Object[] |
addElement(java.lang.Object nO,
java.lang.Object[] arr)
Adds an element to the end of an array |
static java.lang.String[] |
addElement(java.lang.String nO,
java.lang.String[] arr)
Adds an element to the end of an array |
static byte[] |
append(byte[] nE,
byte[] src)
Appends an array to the end of another array |
static char[] |
append(char[] nE,
char[] src)
Appends an array to the end of another array |
static double[][] |
append(double[][] nE,
double[][] src)
Appends an array to the end of another array |
static double[] |
append(double[] nE,
double[] src)
Appends an array to the end of another array |
static void |
append(java.io.File f1,
java.io.File f2)
Appends the contents of one file to the other |
static int[] |
append(int[] nE,
int[] src)
Appends an array to the end of another array |
static byte[] |
append(int start,
int stop,
byte[] nE,
byte[] src)
|
static char[] |
append(int start,
int stop,
char[] nE,
char[] src)
|
static java.lang.String[][] |
append(java.lang.String[][] nE,
java.lang.String[][] src)
Appends an array to the end of another array |
static java.lang.String[] |
append(java.lang.String[] nE,
java.lang.String[] src)
Appends an array to the end of another array |
static java.io.File |
concatenateFile(java.io.File src,
java.io.File concat)
|
static int[][] |
countDiNucleotides(byte[] seq)
Counts the number of each dinucleotide in a sequence Only A,C,G and T is counted. |
static int[][] |
countDiNucleotides(java.io.File seqFile)
Counts the number of each dinucleotide in a sequence Only A,C,G and T is counted. |
static int[] |
countMonoNucleotides(byte[] seq)
Counts the number of each nucleotide in a sequence Only A,C,G and T is counted. |
static int[] |
countMonoNucleotides(java.io.File seqFile)
Counts the number of each nucleotide in a sequence Only A,C,G and T is counted. |
static java.lang.String |
decode(byte[] byteSeq)
|
static byte[] |
encode(java.lang.String seq)
Encodes a nucleotide sequence into bytes where 1=A, 2=C, 3=G, 4=T, 5=X (Masked), any other nucleotide is encoded as 0=N |
static double[] |
getColumn(int c,
double[][] arr)
Returns the desired column from a matrix array |
static java.lang.String[] |
getColumn(int c,
java.lang.String[][] arr)
Returns the desired column from a matrix array |
static java.lang.String |
getFileContents(java.io.File f)
Reads the entire content of a file into a string |
static int |
indexOf(int obj,
int[] arr)
Finds the index of an element within an array |
static int |
indexOf(java.lang.String obj,
java.lang.String[] arr)
Finds the index of an element within an array |
static double |
logN(double x,
double N)
Calculates the logarithm in an arbitrary base |
static double |
max(double[] arr)
Finds the greatest element in the input array |
static double |
max(double[][] arr)
Finds the greatest element in the input array |
static double |
min(double[] arr)
Finds the minimum element in the input array |
static double |
min(double[][] arr)
Finds the minimum element in the input array |
static double[] |
newDoubleArray(int len,
double fill)
Creates a new array of specified length and with all elements set to a specified value |
static java.lang.String |
pad(java.lang.String str,
int padLength)
Pads a string with whitespaces to a specified length. |
static java.lang.String[][] |
parseBigFasta(java.io.File f)
|
static java.lang.String[][] |
parseFasta(java.io.File fastaFile)
Parses a file in FASTA format and returns an array with the identifiers and sequences. |
static int[] |
quickSort(int[] src)
Sorts an array in ascending order |
static byte[][] |
removeElementAt(int n,
byte[][] arr)
Removes an element from an array and shifts the remaining elements to the left |
static int[] |
reverse(int[] arr)
Reverse the order of the elements in an array |
static byte[] |
reverseComplement(byte[] seq)
Gets the reverse complement of a byte encoded sequence |
static char |
reverseComplement(char c)
|
static java.io.File |
reverseComplement(java.io.File seqFile,
java.io.File revFile)
|
static double[][] |
setColumn(double[][] src,
int index,
double[] col)
Set a column of a matrix |
static int |
skipIdLine(char[] cBuff,
int i,
int limit)
|
static int |
skipLineBreak(char[] cBuff,
int i,
int limit)
|
static int[] |
subarray(int start,
int[] src)
Extracts the last subsegment of an array |
static char[] |
subarray(int start,
int stop,
char[] src)
Extracts a subsegment of an array |
static double[] |
subarray(int start,
int stop,
double[] src)
Extracts a subsegment of an array |
static double[][] |
subarray(int start,
int stop,
double[][] arr)
Extracts a subsegment of an array |
static int[] |
subarray(int start,
int stop,
int[] src)
Extracts a subsegment of an array |
static java.lang.String[][] |
subarray(int start,
int stop,
java.lang.String[][] src)
|
static java.lang.String[][] |
subarray(int start,
java.lang.String[][] src)
Extracts a subsegment of an array |
static double |
sum(double[] arr)
Sums the element in an array |
static int |
sum(int[] arr)
Sums the element in an array |
static double[] |
vectorAdd(double[] arr,
double f)
Adds a scalar to an array |
static int[][] |
vectorAdd(int[][] v1,
int[][] v2)
Adds to arrays together |
static int[] |
vectorAdd(int[] v1,
int[] v2)
Adds to arrays together |
static double[][] |
vectorDivide(double[][] arr,
double f)
Divides an array by a scalar |
static double[] |
vectorDivide(double[] arr,
double f)
Divides an array by a scalar |
static double |
vectorInnerProduct(double[] v1,
double[] v2)
Calculates the inner product of two vectors |
static double[][] |
vectorMultiply(double[][] arr,
double f)
Multiplies a matrix by a scalar |
static double[] |
vectorMultiply(double[] arr,
double f)
Multiplies an array by a scalar |
static double[] |
vectorMultiply(double[] v1,
double[] v2)
Multiplies the values of two arrays |
static int[] |
vectorMultiply(int[] arr,
int f)
Multiplies an array by a scalar |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String nucleotideCode
public static char[] nucleotideCharCode
| Constructor Detail |
|---|
public Methods()
| Method Detail |
|---|
public static byte[] addElement(byte n,
byte[] arr)
n - The new element to addarr - The array to add the new element to
public static byte[][] addElement(byte[] n,
byte[][] arr)
n - The new element to addarr - The array to add the new element to
public static double[][] addElement(double[] n,
double[][] arr)
n - The new element to addarr - The array to add the new element to
public static int[] addElement(int n,
int[] arr)
n - The new element to addarr - The array to add the new element to
public static java.io.File[] addElement(java.io.File nO,
java.io.File[] arr)
n - The new element to addarr - The array to add the new element to
public static java.lang.Object[] addElement(java.lang.Object nO,
java.lang.Object[] arr)
n - The new element to addarr - The array to add the new element to
public static java.lang.String[] addElement(java.lang.String nO,
java.lang.String[] arr)
n - The new element to addarr - The array to add the new element to
public static byte[] append(byte[] nE,
byte[] src)
nE - The array to appendsrc - The new array gets appended to the end of this one
public static byte[] append(int start,
int stop,
byte[] nE,
byte[] src)
public static char[] append(char[] nE,
char[] src)
nE - The array to appendsrc - The new array gets appended to the end of this one
public static char[] append(int start,
int stop,
char[] nE,
char[] src)
public static double[] append(double[] nE,
double[] src)
nE - The array to appendsrc - The new array gets appended to the end of this one
public static double[][] append(double[][] nE,
double[][] src)
nE - The array to appendsrc - The new array gets appended to the end of this one
public static void append(java.io.File f1,
java.io.File f2)
throws java.lang.Exception
f1 - The file which contents will be appendedf2 - The file that will be appended
java.lang.Exception
public static int[] append(int[] nE,
int[] src)
nE - The array to appendsrc - The new array gets appended to the end of this one
public static java.lang.String[] append(java.lang.String[] nE,
java.lang.String[] src)
nE - The array to appendsrc - The new array gets appended to the end of this one
public static java.lang.String[][] append(java.lang.String[][] nE,
java.lang.String[][] src)
nE - The array to appendsrc - The new array gets appended to the end of this one
public static java.io.File concatenateFile(java.io.File src,
java.io.File concat)
throws java.lang.Exception
java.lang.Exceptionpublic static int[] countMonoNucleotides(byte[] seq)
public static int[] countMonoNucleotides(java.io.File seqFile)
throws java.lang.Exception
java.lang.Exceptionpublic static int[][] countDiNucleotides(byte[] seq)
public static int[][] countDiNucleotides(java.io.File seqFile)
throws java.lang.Exception
java.lang.Exception
public static int skipLineBreak(char[] cBuff,
int i,
int limit)
public static int skipIdLine(char[] cBuff,
int i,
int limit)
public static java.lang.String decode(byte[] byteSeq)
public static byte[] encode(java.lang.String seq)
seq - The input sequence
public static double[] getColumn(int c,
double[][] arr)
c - Index of the column to returnarr - The array
public static java.lang.String[] getColumn(int c,
java.lang.String[][] arr)
c - Index of the column to returnarr - The array
public static int indexOf(int obj,
int[] arr)
obj - The element to search forarr - The array to search within
public static int indexOf(java.lang.String obj,
java.lang.String[] arr)
obj - The element to search forarr - The array to search within
public static double logN(double x,
double N)
x - Value to take logarithm ofN - Base of logarithm
public static double max(double[] arr)
arr - The input array to search
public static double max(double[][] arr)
arr - The input array to search
public static double min(double[] arr)
arr - The input array to search
public static double min(double[][] arr)
arr - The input array to search
public static double[] newDoubleArray(int len,
double fill)
len - The length of the arrayfill - The value all elements will have
public static java.lang.String pad(java.lang.String str,
int padLength)
str - The string to be paddedpadLength - The desired length of the string
public static java.lang.String[][] parseFasta(java.io.File fastaFile)
throws java.lang.Exception
fastaFile - Sequence file in FASTA format
java.lang.Exception
public static java.lang.String[][] parseBigFasta(java.io.File f)
throws java.lang.Exception
java.lang.Exceptionpublic static int[] quickSort(int[] src)
src - The array to sort
public static final java.lang.String getFileContents(java.io.File f)
throws java.lang.Exception
f - The file to read
java.lang.Exception
public static byte[][] removeElementAt(int n,
byte[][] arr)
n - The index of the element to be removedarr - The array to remove the element from
public static int[] reverse(int[] arr)
arr - The array to reverse
public static byte[] reverseComplement(byte[] seq)
seq - The sequence to reverse complement
public static java.io.File reverseComplement(java.io.File seqFile,
java.io.File revFile)
throws java.lang.Exception
java.lang.Exceptionpublic static char reverseComplement(char c)
public static double[][] setColumn(double[][] src,
int index,
double[] col)
src - The matrix to set the column inindex - The index (zero based) of the column to setcol - The values of the column to set. Must have the same length as the number of rows in src
public static char[] subarray(int start,
int stop,
char[] src)
start - The start index (inclusive)stop - The stop index (exclusive)arr - The input array
public static double[] subarray(int start,
int stop,
double[] src)
start - The start index (inclusive)stop - The stop index (exclusive)arr - The input array
public static double[][] subarray(int start,
int stop,
double[][] arr)
start - The start index (inclusive)stop - The stop index (exclusive)arr - The input array
public static int[] subarray(int start,
int[] src)
start - The start index (inclusive)arr - The input array
public static int[] subarray(int start,
int stop,
int[] src)
start - The start index (inclusive)stop - The stop index (exclusive)arr - The input array
public static java.lang.String[][] subarray(int start,
java.lang.String[][] src)
start - The start index (inclusive)stop - The stop index (exclusive)arr - The input array
public static java.lang.String[][] subarray(int start,
int stop,
java.lang.String[][] src)
public static double sum(double[] arr)
arr - The array whose elements to sum
public static int sum(int[] arr)
arr - The array whose elements to sum
public static double[] vectorAdd(double[] arr,
double f)
arr - Array to add tof - The scalar to add to the input array
public static int[] vectorAdd(int[] v1,
int[] v2)
v1 - Vector 1v2 - Vector 2
public static int[][] vectorAdd(int[][] v1,
int[][] v2)
v1 - Vector 1v2 - Vector 2
public static double[] vectorDivide(double[] arr,
double f)
arr - Array to scalef - The scalar to scale the input array by
public static double[][] vectorDivide(double[][] arr,
double f)
arr - Array to scalef - The scalar to scale the input array by
public static double vectorInnerProduct(double[] v1,
double[] v2)
v1 - Vector 1v2 - Vector 2
public static double[] vectorMultiply(double[] arr,
double f)
arr - Array to scalef - The scalar to scale the input array by
public static double[] vectorMultiply(double[] v1,
double[] v2)
v1 - The first arrayv2 - The second array
public static double[][] vectorMultiply(double[][] arr,
double f)
arr - Matrix to scalef - The scalar to scale the input matrix by
public static int[] vectorMultiply(int[] arr,
int f)
arr - Array to scalef - The scalar to scale the input array by
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||