diff --git a/.github/workflows/maven-test.yml b/.github/workflows/maven-test.yml new file mode 100644 index 0000000..0364940 --- /dev/null +++ b/.github/workflows/maven-test.yml @@ -0,0 +1,30 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: Maven Package + +on: + push: + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Maven + run: mvn clean test + + diff --git a/.gitignore b/.gitignore index 27a8eb6..e068947 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,8 @@ build /test.txt.gz /tmp.txt /tmp2.txt -/.url-cache \ No newline at end of file +/.url-cache +/target/ +/.project +/.settings/ +/export.pdf diff --git a/.project b/.project deleted file mode 100644 index b7fc8f1..0000000 --- a/.project +++ /dev/null @@ -1,24 +0,0 @@ - - - atk - - - - - - org.scala-ide.sdt.core.scalabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.scala-ide.sdt.core.scalanature - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - diff --git a/README.md b/README.md index e027547..279c341 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -atk -=== +# atk Abeel ToolKit -- a set of quite useful java and scala classes, objects and traits. @@ -8,13 +7,29 @@ Some classes may have more specific license than the complete package, please re Individual tools may have specific licenses to accommodate library and/or package licenses +# Maven Dependency +You can use this from maven with the following dependency. -Eclipse setup -=== -Add scala library (2.12.3) -Add Java runtime (1.11) +``` + + be.abeel + atk + 1.2.0 + +``` +and with the following repository + +``` + + + artifactory.ewi.tudelft.nl + https://artifactory.ewi.tudelft.nl/artifactory/libs-release + + false + + + + +``` -Nightly builds -=== -https://abeellab.org/jenkins/atk \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index af49b67..0000000 --- a/build.gradle +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This build file was generated by the Gradle 'init' task. - * - * This generated file contains a sample Java Library project to get you started. - * For more details take a look at the Java Libraries chapter in the Gradle - * user guide available at https://docs.gradle.org/3.5/userguide/java_library_plugin.html - */ - -// Apply the java-library plugin to add support for Java Library -apply plugin: 'java-library' -apply plugin: 'java' -apply plugin: 'scala' -apply plugin: 'eclipse' - -// In this section you declare where to find the dependencies of your project -repositories { - // Use jcenter for resolving your dependencies. - // You can declare any Maven/Ivy/file repository here. - jcenter() - - flatDir { - dirs 'lib' - } - - - -} -sourceSets { - main { - java { - srcDir 'bsd/src' - srcDir 'gpl/src' - srcDir 'tools/src' - srcDir 'src' - } - scala { - srcDir 'bsd/src' - srcDir 'gpl/src' - srcDir 'tools/src' - srcDir 'src' - } - } - test{ - java{ - srcDir 'test/src' - } - scala{ - srcDir 'test/src' - } - } - } - -dependencies { - - - compile name: 'mail' - - compile group: 'commons-io', name: 'commons-io', version: '2.4' - compile group: 'org.apache.commons', name: 'commons-math3', version: '3.2' - compile group: 'jfree', name: 'jcommon', version: '1.0.16' - compile group: 'jfree', name: 'jfreechart', version: '1.0.13' - - - compile group: 'com.lowagie', name: 'itext', version: '2.1.5' - - // https://mvnrepository.com/artifact/org.scalatest/scalatest - //compile group: 'org.scalatest', name: 'scalatest_2.12.0-M4', version: '2.2.6' - // https://mvnrepository.com/artifact/junit/junit - testCompile group: 'junit', name: 'junit', version: '4.12' - - compile 'org.scala-lang:scala-library:2.12.3' - testImplementation 'junit:junit:4.12' - compile 'org.scalatest:scalatest_2.12:3.0.5' - -} - -task fatJar(type: Jar) { - if(!hasProperty('$BUILD_NUMBER')){ - ext{ - $BUILD_NUMBER='develop' - } - } - - baseName = project.name +'-'+$BUILD_NUMBER+ '-all' - from { configurations.compile.collect { - it.isDirectory() ? it : zipTree(it).matching{exclude{it.path.contains('META-INF')}} - } - } - with jar -} -task spec(dependsOn: ['testClasses'], type: JavaExec) { - main = 'org.scalatest.tools.Runner' - args = ['-R', 'build/classes/scala/test', '-o'] - classpath = sourceSets.test.runtimeClasspath -} - diff --git a/build.xml b/build.xml deleted file mode 100644 index 3e2cb58..0000000 --- a/build.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/gpl/src/README.md b/gpl/src/README.md deleted file mode 100644 index 2c72fde..0000000 --- a/gpl/src/README.md +++ /dev/null @@ -1 +0,0 @@ -Classes in this source folder are available under a GPL license \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 5c2d1cf..0000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 59b5f89..0000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew deleted file mode 100644 index 83f2acf..0000000 --- a/gradlew +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 24467a1..0000000 --- a/gradlew.bat +++ /dev/null @@ -1,100 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/javascript/base64.js b/javascript/base64.js deleted file mode 100644 index 012d681..0000000 --- a/javascript/base64.js +++ /dev/null @@ -1,69 +0,0 @@ - -// This code was written by Tyler Akins and has been placed in the -// public domain. It would be nice if you left this header intact. -// Base64 code from Tyler Akins -- http://rumkin.com - -var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - -function encode64(input) { - var output = ""; - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0; - - do { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; - - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - - output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + - keyStr.charAt(enc3) + keyStr.charAt(enc4); - } while (i < input.length); - - return output; -} - -function decode64(input) { - var output = ""; - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0; - - // remove all characters that are not A-Z, a-z, 0-9, +, /, or = - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - - do { - enc1 = keyStr.indexOf(input.charAt(i++)); - enc2 = keyStr.indexOf(input.charAt(i++)); - enc3 = keyStr.indexOf(input.charAt(i++)); - enc4 = keyStr.indexOf(input.charAt(i++)); - - chr1 = (enc1 << 2) | (enc2 >> 4); - chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); - chr3 = ((enc3 & 3) << 6) | enc4; - - output = output + String.fromCharCode(chr1); - - if (enc3 != 64) { - output = output + String.fromCharCode(chr2); - } - if (enc4 != 64) { - output = output + String.fromCharCode(chr3); - } - } while (i < input.length); - - return output; -} - - diff --git a/lib/mail.jar b/lib/mail.jar deleted file mode 100644 index d1a4971..0000000 Binary files a/lib/mail.jar and /dev/null differ diff --git a/no_src/SVGexport.java b/no_src/SVGexport.java deleted file mode 100644 index f04b025..0000000 --- a/no_src/SVGexport.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * %HEADER% - */ -package be.abeel.graphics; - -import java.awt.Rectangle; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Writer; - -import org.apache.batik.dom.GenericDOMImplementation; -import org.apache.batik.svggen.SVGGraphics2D; -import org.apache.batik.svggen.SVGGraphics2DIOException; -import org.w3c.dom.DOMImplementation; - -public class SVGexport { - - public static void exportSVG(Drawable d, String fileName, int x, int y) { - Writer out = null; - try { - out = new BufferedWriter(new FileWriter(new File(fileName))); - } catch (IOException e1) { - e1.printStackTrace(); - } - - // Get a DOMImplementation. - DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation(); - - // Create an instance of org.w3c.dom.Document. - String svgNS = "http://www.w3.org/2000/svg"; - org.w3c.dom.Document document = domImpl.createDocument(svgNS, "svg", null); - - // Create an instance of the SVG Generator. - SVGGraphics2D svgGenerator = new SVGGraphics2D(document); - - // Ask the test to render into the SVG Graphics2D implementation. - d.draw(svgGenerator, new Rectangle(x, y)); - - // Finally, stream out SVG to the standard output using - // UTF-8 encoding. - boolean useCSS = true; // we want to use CSS style attributes - - try { - svgGenerator.stream(out, useCSS); - } catch (SVGGraphics2DIOException e) { - e.printStackTrace(); - } - - } - -} diff --git a/no_src/Venn.scala b/no_src/Venn.scala deleted file mode 100644 index 2560096..0000000 --- a/no_src/Venn.scala +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This work is licensed under the Creative Commons - * Attribution-NonCommercial-NoDerivs 3.0 Unported License. - * To view a copy of this license, visit - * http://creativecommons.org/licenses/by-nc-nd/3.0/ - * or send a letter to Creative Commons, 444 Castro Street, - * Suite 900, Mountain View, California, 94041, USA. - * - * A copy of the license is included in LICENSE.txt - * See the License for the specific language governing permissions - * and limitations under the License. - * - * Copyright 2005-2013 Thomas Abeel - */ -package venn - -import scala.io.Source -import org.apache.batik.transcoder.image.PNGTranscoder -import org.apache.batik.transcoder.TranscoderInput -import java.io.ByteArrayInputStream -import org.apache.batik.transcoder.SVGAbstractTranscoder -import java.io.FileOutputStream -import org.apache.batik.transcoder.TranscoderOutput -import java.io.File -import java.io.PrintWriter -/** - * Helper object to make Venn diagrams - * - */ -object Venn { - - /** - * List is a list of pairs where the first piece is the label of the set and the second part is all the elements belonging to that set. - * - */ - def makeVenn(outFile: File, list: List[(String, List[String])], exportTxt: Boolean = false) { - - val membership = scala.collection.mutable.Map.empty[String, String] - val chars = ('A' to 'E').toList //List('A', 'B', 'C', 'D', 'E') - assume(list.length <= chars.length && list.length >= 2) - - val labels = list.map(_._1) - - val labelMap = chars.zip(labels).toMap - - for ((label, l) <- list) { - val letter = chars(labels.indexOf(label)) - l.map(e => { - membership.update(e, membership.getOrElse(e, "") + letter) - }) - - } - - val counts = membership.values.toList.groupBy(x => x).mapValues(_.size) - if (exportTxt) { - val export = membership.groupBy(f => f._2).toList - export.map(f => { - val fileLabel = (f._1.map(f => labelMap.getOrElse(f, "missing"))).toList.mkString("_") - val pw = new PrintWriter(outFile + ".set." +fileLabel+ ".txt") - pw.println(f._2.keySet.mkString("\n")) - pw.close - }) - - } - - val url=Venn.getClass().getResource("/venn/venn" + list.length + "a.svg") - var venn = Source.fromURL(url).mkString - - val keyCombinations = (1 to chars.size).flatMap(chars.combinations).toList - - for (key <- keyCombinations.map(_.mkString(""))) - venn = venn.replaceAll(">" + key + "<", ">" + counts.getOrElse(key, 0) + "<"); - - for ((key, label) <- labelMap) - venn = venn.replaceAll(">List" + key + "<", ">" + label + "<"); - - /* Convert to PNG */ - val streamBytes = venn.getBytes() - val t = new PNGTranscoder(); - val input = new TranscoderInput(new ByteArrayInputStream(streamBytes)); - - t.addTranscodingHint(SVGAbstractTranscoder.KEY_WIDTH, 800.0f); - // GraphicsFileExport.exportPNG(new ImageDrawable(img), CompareConfig.folder + "/venn." + genome + "." + infix + ".png", 800, 600) - - val ostream = new FileOutputStream(outFile) - val output = new TranscoderOutput(ostream); - - t.transcode(input, output); - - ostream.flush(); - - ostream.close(); - - } -} \ No newline at end of file diff --git a/php/Properties.php b/php/Properties.php deleted file mode 100644 index 0a55220..0000000 --- a/php/Properties.php +++ /dev/null @@ -1,1091 +0,0 @@ -load(file_get_contents('site.properties'); - * - * // Get associative array of all loaded properties: - * $config = $p->toArray(); - * - * // Get a single property's value: - * $email_from = $p->getProperty('email.from'); - * - * // Set a property: - * $p->setProperty('email.from', 'no-reply@server.com'); - * - * // Remove a property: - * $p->remove('email.from'); - * - * // Save properties method 1: - * $p->store('site.properties'); - * - * // Save properties method 2: - * file_put_contents('site.properties', $p->toString()); - * - * // Save properties method 3 (includes comments and blanks): - * file_put_contents('site.properties', $p->toString(true)); - * @endcode - * - * Copyright © 2005, Craig Manley. - * - */ - - - - -/** - * @ignore Require the section classes. - */ -//require_once(realpath(dirname(__FILE__) . '/Section/Blank.php')); -//require_once(realpath(dirname(__FILE__) . '/Section/Comment.php')); -//require_once(realpath(dirname(__FILE__) . '/Section/Property.php')); - - - - -/** - * @ignore Create "Standard PHP Library" compatible exception classes if the SPL extension isn't available. - * @ignore The SPL extension exists in PHP 5.0, but is only installed by default since PHP 5.1. - */ -//if (!extension_loaded('SPL')) { - if (!class_exists('LogicException')) { - eval('class LogicException extends Exception {};'); - } - if (!class_exists('InvalidArgumentException')) { - eval('class InvalidArgumentException extends LogicException {};'); - } -//} - - - - - - - -/** - * Near implementation of the java.util.Properties class. - * This is the class that you need to use for parsing and writing Java style property files. - * It makes use of exception classes from the "Standard PHP Library" extension (http://www.php.net/spl) - * that is installed per default since PHP 5.1, however it is not required to use this class. - */ -class Properties { - - protected $defaults = null; // Properties object to use for defaults. - private $sections = array(); // array of Properties_Section objects loaded from a properties file with the load method. - private $properties = array(); // associative array of key => Properties_Section_Property object references. - const WHITE_SPACE_CHARS = " \t\r\n\x0C"; // 0x0c == \f (form feed) - - /** - * Constructor. Creates an empty property list. - * - * @param defaults optional Properties object to use for defaults. - * @throw InvalidArgumentException - */ - //public function __construct(Properties $defaults = null) { // Type hints with null as default only work in PHP5.1 up. - public function __construct($defaults = null) { // This is for PHP 5.0 up. - if (isset($defaults)) { - if (!($defaults instanceof Properties)) { - throw new InvalidArgumentException('The $defaults parameter must be null or an instance of ' . __CLASS__ . '.'); - } - $this->defaults = $defaults; - } - } - - - /** - * Tests an unescaped key's syntax. Throws an exception on error. - * - * @param key - * @throw InvalidArgumentException if key syntax is invalid. - */ - protected static function _testKey($key) { - if (!(isset($key) && strlen($key))) { - throw new InvalidArgumentException('The $key parameter must be a string of 1 or more characters.'); - } - } - - - /** - * Sets a property. - * - * @param key - * @param value - * @throw InvalidArgumentException - */ - public function setProperty($key, $value) { - Properties_Section_Property::testKey($key); - Properties_Section_Property::testValue($key); - if (array_key_exists($key, $this->properties)) { - $this->properties[$key]->setValue($value); - } - else { - $p = new Properties_Section_Property($key, $value); - array_push($this->sections, $p); - $this->properties[$key] = $p; - } - } - - - /** - * Does what Perl's chomp() function does. - * - * @param string reference - * @return integer - */ - private static function _chomp(&$string) { - $result = 0; - if (is_array($string)) { - foreach($string as $i => $val) { - $result += self::_chomp($string[$i]); - } - } - else { - while (strlen($string)) { - $endchar = substr($string, -1); - if (($endchar === "\n") || ($endchar === "\r")) { - $string = substr($string, 0, -1); - $result++; - } - else { - break; - } - } - // // alternative: - // if (preg_match('/([\\r|\\n]+)$/', $string, $matches)) { - // $result = strlen($matches[1]); - // $string = substr($string, 0, -$result); - // } - } - return $result; - } - - - /** - * Determines if the given line ends with an unescaped continuation character (the '\'). - * If the result is true, then the continuation character is also stripped off the end of the line too. - * - * @param line string reference - * @return boolean - */ - private static function _continueLine(&$line) { - $count = 0; - $len = strlen($line); - for ($i = $len - 1; $i >= 0; $i--) { - if (substr($line, $i, 1) == '\\') { - $count++; - } - else { - break; - } - } - $result = (boolean) $count % 2; - if ($result) { - $line = substr($line, 0, $len - 1); - } - return $result; - } - - - /** - * Loads properties from a file handle or string. - * You can pass either an file handle open for reading, - * an array of lines, or a string buffer containing all the lines. - * When a file handle is passed, the caller is responsible for opening and closing it. - * - * @param source - an open file handle, string buffer, or array of lines. - * @throw InvalidArgumentException - */ - public function load($source) { - if (!isset($source)) { - throw new InvalidArgumentException('The $source parameter may not be null.'); - } - $lines = null; - if (is_array($source)) { - $lines = $source; - } - elseif (is_string($source)) { - $lines = preg_split('/(\\r\\n|\\n|\\r)/', $source); // DOS: \r\n UNIX: \n MAC: \r - } - elseif (get_resource_type($source) === 'file') { - $contents = ''; - while (!feof($source)) { - $contents .= fread($source, 8192); - } - $lines = preg_split('/(\\r\\n|\\n|\\r)/', $source); // DOS: \r\n UNIX: \n MAC: \r - } - else { - throw new InvalidArgumentException('The $source parameter of type "' . gettype($source) . '" is not supported.'); - } - - // Now process the lines - for ($i = 0; $i < count($lines); $i++) { - $line = ltrim($lines[$i], self::WHITE_SPACE_CHARS); - self::_chomp($line); - - // handle blanks - if (strlen($line) == 0) { - if ($i < count($lines) -1) { // don't store last blank. - $p = new Properties_Section_Blank(); - array_push($this->sections, $p); - } - } - - // handle comments - elseif (preg_match('/^(#|!)(\\s*)(.*)$/', $line, $matches)) { - $p = new Properties_Section_Comment($matches[3], $matches[1], $matches[2]); - array_push($this->sections, $p); - } - - // handle properties or multiline sections. - else { - // handle continuation lines - while (self::_continueLine($line) && (++$i < count($lines))) { - self::_chomp($lines[$i]); - $line .= ltrim($lines[$i], self::WHITE_SPACE_CHARS); - } - - // handle blanks (in case there were multiple lines with only a continuation character on them). - if (strlen($line) == 0) { - if ($i < count($lines) -1) { // don't store last blank. - $p = new Properties_Section_Blank(); - array_push($this->sections, $p); - } - } - - // handle comments (in case there were multiple lines with only a continuation character on them followed by a comment). - elseif (preg_match('/^(#|!)(\\s*)(.*)$/', $line, $matches)) { - $p = new Properties_Section_Comment($matches[3], $matches[1], $matches[2]); - array_push($this->sections, $p); - } - - // handle properties - else { - $p = new Properties_Section_Property($line); - $key = $p->getKey(); - if (array_key_exists($key, $this->properties)) { - // Property name already exists. - array_push($this->sections, new Properties_Section_Comment("WARNING: The following previously encountered property was commented out:\n$line")); - } - else { - $this->properties[$key] = $p; - array_push($this->sections, $p); - } - } - } - } - } - - - /** - * Writes the property list (key and element pairs) to the given file name or handle. - * If you want to retain the original structure of the file(s) you loaded as much as possible, - * then use toString(true) method instead. - * - * @param file file name or file handle opened in write or append mode. - * @param header optional header line which will be written as a comment. - * @return array - * @throw InvalidArgumentException - */ - public function store($file, $header = null) { - $data = ''; - // header comment (supports multiline headers too unlike the java method). - if (isset($header) && strlen($header)) { - $comment = new Properties_Section_Comment($header, false); - $data .= $comment->toString(); - } - // date comment, e.g. #Sat Nov 26 16:29:36 CET 2005 - $data .= '#' . date('r') . "\n"; - $data .= $this->toString(); - // write - if (get_resource_type($file) === 'file') { - fwrite($file, $data); - } - else { - file_put_contents($file, $data); - } - } - - - /** - * Gets a property value. - * Returns a string (possibly empty), or null if not found. - * - * @param key - * @param defaultValue optional default value to return if no match is found. - * @return string or null. - * @throw InvalidArgumentException - */ - public function getProperty($key, $defaultValue = null) { - self::_testKey($key); - if (array_key_exists($key, $this->properties)) { - return $this->properties[$key]->getValue(); - } - if (isset($this->defaults)) { - return $this->defaults->getProperty($key, $defaultValue); - } - return $defaultValue; - } - - - /** - * Returns an array of all property names. - * - * @return array - */ - public function propertyNames() { - return array_keys($this->properties); - } - - - /** - * Returns all the key -> value pairs as an associative array. - * - * @return array - */ - public function toArray() { - $result = array(); - foreach ($this->properties as $key => $section) { - $result[$key] = $section->getValue(); - } - return $result; - } - - - /** - * Returns a string representation of the properties, without all the blanks and comments. - * - * @param everything optional boolean, default false. If true then comments and blanks will be included. - * @return string - */ - public function toString($everything = false) { - $result = ''; - if ($everything) { - foreach ($this->sections as $section) { - $result .= $section->toString(); - } - } - else { - foreach (array_values($this->properties) as $section) { - $result .= $section->toString(); - } - } - return $result; - } - - - /** - * Determines if this object contains the exact same property name and value pairs as the given object. - * Part of the java.util.Hashtable API. - * - * @param other Properties object. - * @return boolean - */ - public function equals(Properties $other) { - $other_names = $other->propertyNames(); - $my_names = $this->propertyNames(); - if ((count($other_names) != count($my_names)) || count(array_diff($other_names, $my_names))) { - return false; - } - for ($i = 0; $i < count($my_names); $i++) { - if ($this->getProperty($my_names[$i]) !== $other->getProperty($my_names[$i])) { - return false; - } - } - return true; - } - - - /** - * Removes all properties. - * Part of the java.util.Hashtable API. - */ - public function clear() { - $this->properties = array(); - $this->sections = array(); - } - - - /** - * Deletes a property. - * Part of the java.util.Hashtable API. - * Returns the property's last known value as a string (possibly empty), or null if not found. - * - * @param key - * @return string or null - */ - public function remove($key) { - self::_testKey($key); - $result = null; - if (array_key_exists($key, $this->properties)) { - // Remove the section and any blank or comment lines directly before it. - $section_removed = false; - for ($i = 0; $i < count($this->sections); $i++) { - if (($this->sections[$i] instanceof Properties_Section_Property) && ($this->sections[$i]->getKey() == $key)) { - $splice_from = $splice_to = $i; - if ($i > 0) { - $previous_section_class = get_class($this->sections[$i - 1]); - if ($previous_section_class != 'Properties_Section_Property') { - for ($j = $i - 1; $j >= 0; $j--) { - if (get_class($this->sections[$j]) == $previous_section_class) { - $splice_from = $j; - } - else { - break; - } - } - } - } - array_splice($this->sections, $splice_from, 1 + $splice_to - $splice_from); - $section_removed = true; - break; - } - } - if (!$section_removed) { - throw new LogicException("Cannot find (and therefore remove) the section with key '$key'."); - } - // remove the property - unset($this->properties[$key]); - } - return $result; - } - -} -/****************************** End of class Properties ******************************/ - - - - - - - -/** - * Internal Section interface that you don't need to know about. - */ -interface Properties_ISection { - - /** - * The implementation of this method must return the string representation of the section. - * - * @return string - */ - public function toString(); - -} -/****************************** End of interface Properties_ISection ******************************/ - - - - - - - -/** - * Internal Blank section class that you don't need to know about. - * Lines that contain nothing or only whitespace are considered blanks. - */ -class Properties_Section_Blank implements Properties_ISection { - - /** - * Returns the string representation of the section. - * - * @return string - */ - public function toString() { - return "\n"; - } - -} -/****************************** End of class Properties_Section_Blank ******************************/ - - - - - - - -/** - * Internal Comment section class that you don't need to know about. - * - * A comment line is a line whose first non-whitespace character - * is an ASCII # or ! is ignored (thus, # (hash) or ! (bang) indicate comment lines). - */ -class Properties_Section_Comment implements Properties_ISection { - - private $comment_char = null; - private $padding = null; - private $value = null; - - /** - * Constructor. - * - * @param value string - * @param comment_char optional comment character, default '#' (allowed values are '#' or !'). - * @param padding optional comment padding string, default ' '. - * @throw InvalidArgumentException - */ - public function __construct($value, $comment_char = '#', $padding = ' ') { - $this->value = $value; - $this->_testCommentChar($comment_char); - $this->comment_char = $comment_char; - $this->_testPadding($padding); - $this->padding = $padding; - } - - - /** - * Tests the syntax of a comment character. - * - * @param $char - * @throw InvalidArgumentException - */ - protected static function _testCommentChar($char) { - if (!isset($char)) { - throw new InvalidArgumentException('Comment character may not be null.'); - } - if (($char != '#') && ($char != '!')) { - throw new InvalidArgumentException('String "' . $char . '" is not a valid comment character.'); - } - } - - - /** - * Tests the syntax of a padding string. - * - * @param string - * @throw InvalidArgumentException - */ - protected static function _testPadding($string) { - if (!isset($string)) { - throw new InvalidArgumentException("Padding may not be NULL!"); - } - if (!preg_match('/^( |\\t|#|!)*$/', $string)) { - throw new InvalidArgumentException('Padding string contains invalid characters.'); - } - } - - - /** - * Returns the string representation of the section. - * - * @return string - */ - public function toString() { - $lines = preg_split('/\\r?\\n\\r?/', $this->value); - return $this->comment_char . $this->padding . implode("\n" . $this->comment_char . $this->padding, $lines) . "\n"; - } - - - /** - * Sets the value. This is the complete comment, but without the initial comment character and padding. - * - * @param value string - */ - public function setValue($value) { - $this->value = $value; - } - - - /** - * Returns the value. This is the complete comment, but without the comment character and padding. - * - * @return string - */ - public function getValue() { - return $this->value; - } - -} -/****************************** End of class Properties_Section_Comment ******************************/ - - - - - - - - -/** - * Internal Property section class that you don't need to know about. - * - * Everything in a properties file besides comments and blank lines, are considered as (name-value) properties. - */ -class Properties_Section_Property implements Properties_ISection { - - private $key = null; - private $value = null; - private $seperator = null; - const SEPERATOR_REGEX_PATTERN = '[\\t \\x0c]*[=:\\t \\x0c][\\t \\x0c]*'; - - /** - * Overloaded constructor. - * - * Overload 1: - * @param line a raw property line. - * - * Overload 2: - * @param key - * @param value - * @param seperator optional seperator character (default '='). - * @throw InvalidArgumentException - */ - public function __construct() { - $key = null; - $value = null; - $seperator = null; - switch (func_num_args()) { - case 1: - $line = func_get_arg(0); - if (isset($line)) { - $line = ltrim($line, Properties::WHITE_SPACE_CHARS); - } - if (!(isset($line) && strlen($line))) { - throw new InvalidArgumentException('Empty line passed into overloaded constructor.'); - } - $parts = $this->_parseLine($line); - if (!$parts) { - throw new InvalidArgumentException('Invalid property line passed into overloaded constructor.'); - } - list($key, $seperator, $value) = $parts; - break; - case 2: - case 3: - $key = func_get_arg(0); - $value = func_get_arg(1); - if (func_num_args() == 3) { - $seperator = func_get_arg(2); - } - if (!isset($seperator)) { - $seperator = '='; - } - break; - default: - throw new InvalidArgumentException('Invalid arguments passed into overloaded constructor.'); - } - $this->_testKey($key); - $this->_testValue($value); - $this->_testSeperator($seperator); - $this->key = $key; - $this->seperator = $seperator; - $this->value = $value; - } - - - /** - * Splits a raw key-value line into it's constituent parts. - * Returns an array with the 3 elements: key, seperator, value - * - * @param line reference - * @return array - */ - private static function _parseLine(&$line) { - // Locate unescaped seperator. - // Seperators match this sequence and may not be prefixed with an escape character: /\s*(=|:)\s*/ - $result = false; - $key = $seperator = $value = null; - $offset = 0; - while (preg_match('/^((?U).+)(' . self::SEPERATOR_REGEX_PATTERN . ')(.*)$/s', substr($line, $offset), $matches, PREG_OFFSET_CAPTURE)) { // (?U) means ungreedy - $possible_key = $offset ? substr($line, 0, $offset) . $matches[1][0] : $matches[1][0]; - $count = 0; - $len = strlen($possible_key); - for ($i = $len - 1; $i >= 0; $i--) { - if (substr($possible_key, $i, 1) == '\\') { - $count++; - } - else { - break; - } - } - if ($count % 2 == 0) { // even number of direct prior escapes is ok - $key = $possible_key; - $seperator = $matches[2][0]; - $value = $matches[3][0]; - break; - } - $offset += $matches[2][1]; - } - if (!isset($key)) { - $key = $line; - $seperator = '='; - } - if (!isset($value)) { - $value = ''; - } - return array(self::unescape($key), $seperator, self::unescape($value)); - } - - - /** - * Tests an unescaped key's syntax. Throws an exception on error. - * - * @param key - * @throw InvalidArgumentException - */ - protected static function _testKey($key) { - if (!isset($key)) { - throw new InvalidArgumentException("Property key may not be NULL!"); - } - if (!strlen($key)) { - throw new InvalidArgumentException("Property key may not be empty!"); - } - } - - - /** - * Tests an unescaped value's syntax. Throws an exception on error. - * - * @param value - * @throw InvalidArgumentException - */ - protected static function _testValue($value) { - if (!isset($value)) { - throw new InvalidArgumentException("Property value may not be NULL!"); - } - } - - - /** - * Tests a seperator's syntax. Throws an exception on error. - * - * @param seperator - * @throw InvalidArgumentException - */ - protected static function _testSeperator($seperator) { - if (!isset($seperator)) { - throw new InvalidArgumentException("Seperator may not be NULL!"); - } - if (!strlen($seperator)) { - throw new InvalidArgumentException("Seperator may not be empty!"); - } - if (!preg_match('/^' . self::SEPERATOR_REGEX_PATTERN . '$/', $seperator)) { - throw new InvalidArgumentException("Bad syntax in seperator string!"); - } - } - - - /** - * Escapes a character. - * The characters LF (line feed), CR (carriage return), FF (form feed), : (colon), # (hash), ! (bang), - * = (equals), tab, and backslash are escaped C-style with a backslash character. - * Characters outside the range 0x20 to 0x7E are encoded in the \\uxxxx format. - * If $escape_space is true then the space character is escaped too. - * - * @param char character - * @param escape_space boolean - * @return string - */ - protected static function _escapeChar($char, $escape_space) { - static $escmap = null; - if (is_null($escmap)) { - $escmap = array("\r" => 'r', - "\n" => 'n', - chr(0x0c) => 'f', - "\t" => 't', - '\\' => '\\', - ':' => ':', - '#' => '#', - '!' => '!', - '=' => '='); - } - if (array_key_exists($char, $escmap)) { - return '\\' . $escmap[$char]; - } - elseif ($escape_space && ($char == ' ')) { - return '\\ '; - } - elseif ((ord($char) < 0x20) || (ord($char) > 0x7e)) { - return sprintf('\\u%04X', ord($char)); - } - return $char; - } - - - /** - * Escapes a string. - * The characters LF (line feed), CR (carriage return), FF (form feed), : (colon), # (hash), ! (bang), - * = (equals), tab, and backslash are escaped C-style with a backslash character. - * Characters outside the range 0x20 to 0x7E are encoded in the \\uxxxx format. - * If $escapeSpace is true then the ' ' characters are escaped too. - * - * @param s - * @param escape_space boolean - * @return string - */ - protected static function escape($s, $escape_space) { - $result = preg_replace('/([\\s=:#!\\\\]|[^\\x20-\\x7e])/e', 'self::_escapeChar("\\1", $escape_space)', $s); - // If the first character of a string is a space then always escape it, even if $escape_space is false. - if (!$escape_space && strlen($result)) { - if (substr($result,0,1) === ' ') { - $result = "\\$result"; - } - } - return $result; - } - - - /** - * Escapes a key. - * The characters space, LF (line feed), CR (carriage return), FF (form feed), : (colon), # (hash), ! (bang), - * = (equals), tab, and backslash are escaped C-style with a backslash character. - * Characters outside the range 0x20 to 0x7E are encoded in the \\uxxxx format. - * - * @param key - * @return string - */ - public static function escapeKey($key) { - return self::escape($key, true); - } - - - /** - * Escapes a value. - * The characters LF (line feed), CR (carriage return), FF (form feed), : (colon), # (hash), ! (bang), - * = (equals), tab, and backslash are escaped C-style with a backslash character. - * Characters outside the range 0x20 to 0x7E are encoded in the \\uxxxx format. - * If the value starts with a whitespace character, then that too is escaped. - * - * @param value - * @return string - */ - public static function escapeValue($value) { - return self::escape($value, false); - } - - - /** - * Unescapes an escaped character sequence. - * - * @param s string, or array of matches from preg_replace_callback(). - * @return string - */ - protected static function _unescapeChar($s) { - if (is_array($s)) { - $s = $s[0]; - } - if (substr($s,0,1) != '\\') { - return $s; // it wasn't escaped. - } - $s = substr($s,1); // drop \ character - if (strlen($s) > 1) { - if (!preg_match('/^u[\da-fA-F]{4}$/', $s)) { - throw new Exception("Malformed \\uxxxx encoding in '\\$s'."); - } - $ord = hexdec(substr($s,1)); - if ($ord < 128) { - return chr($ord); - } - else if ($ord < 2048) { - return (chr(192 + (($ord - ($ord % 64)) / 64))) . - (chr(128 + ($ord % 64))); - } - else { - return (chr(224 + (($ord - ($ord % 4096)) / 4096))) . - (chr(128 + ((($ord % 4096) - ($ord % 64)) / 64))) . - (chr(128 + ($ord % 64))); - } - } - static $unescmap = null; - if (is_null($unescmap)) { - $unescmap = array('r' => "\r", - 'n' => "\n", - 'f' => chr(0x0c), - 't' => "\t"); - } - if (array_key_exists($s, $unescmap)) { - return $unescmap[$s]; - } - return $s; - } - - - /** - * Unescapes a string. - * - * @param s - * @return string - */ - public static function unescape($s) { - return preg_replace_callback('/(\\\\u[\da-fA-F]{4}|\\\\(.))/', array(__CLASS__, '_unescapeChar'), $s); - } - - - /** - * Returns the string representation of the section. - * - * @param max_chars_per_line unsigned integer, maximum number of characters per line (default 120). - * @return string - */ - public function toString($max_chars_per_line = 120) { - if (isset($max_chars_per_line)) { - if ($max_chars_per_line < 1) { - $max_chars_per_line = null; - } - } - $key_and_sep = $this->escapeKey($this->key) . $this->seperator; - $value = $this->escapeValue($this->value); - if (!$max_chars_per_line || (strlen($key_and_sep) + strlen($value) <= $max_chars_per_line)) { - return "$key_and_sep$value\n"; - } - $lines = array(); - if (strlen($key_and_sep) > $max_chars_per_line / 2) { // key and seperator are quite long so leave them on their own line - array_push($lines, $key_and_sep); - } - elseif (preg_match('/^.{1,' . ($max_chars_per_line - strlen($key_and_sep)) . '}(? $max_chars_per_line) { - $line = ''; - for ($j = 0; $j < $len; $j += $max_chars_per_line) { - $line .= substr($parts[$i], $j, $max_chars_per_line); - if ($j + $max_chars_per_line < $len - 1) { - $line .= "\\\n\t"; - } - } - } - else { - $line = $parts[$i]; - } - if ($i+1 < count($parts)) { - if (strlen($line)) { - $line .= "\\\n\t"; - } - $line .= $parts[$i+1]; // the preg_split delimiter - } - array_push($lines, $line); - } - return implode("\\\n\t", $lines) . "\n"; - } - - - /** - * Sets the value. - * - * @param value - */ - public function setValue($value) { - if ((string)$value != $this->value) { - $this->testValue($value); - $this->value = (string) $value; - } - } - - - /** - * Returns the key. - * - * @return string - */ - public function getKey() { - return $this->key; - } - - - /** - * Returns the value. - * - * @return string - */ - public function getValue() { - return $this->value; - } - -} -/****************************** End of class Properties_Section_Property ******************************/ - -?> \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8a06ff2 --- /dev/null +++ b/pom.xml @@ -0,0 +1,279 @@ + + 4.0.0 + + be.abeel + atk + 1.2.0 + jar + + + + UTF-8 + 1.8 + 1.8 + . + ${env.ARTIFACTORY_PASS} + 3.6.3 + + + + + artifactory.ewi.tudelft.nl + https://artifactory.ewi.tudelft.nl/artifactory/libs-release + + + + + + + commons-io + commons-io + 2.4 + + + + org.apache.commons + commons-math3 + 3.2 + + + + + org.jfree + jcommon + 1.0.17 + + + + org.jfree + jfreechart + 1.0.14 + + + + javax.mail + javax.mail-api + 1.5.2 + + + + com.itextpdf + itextpdf + 5.5.13.4 + + + + org.scala-lang + scala3-library_3 + ${scala.version} + + + + org.scalatest + scalatest_3 + 3.2.18 + + + + junit + junit + 4.13.1 + test + + + + + + + + + artifactory.ewi.tudelft.nl + https://artifactory.ewi.tudelft.nl/artifactory/libs-release + + false + + + + central + https://repo1.maven.org/maven2 + + false + + + + + + + + central + https://repo1.maven.org/maven2 + + + artifactory.ewi.tudelft.nl + https://artifactory.ewi.tudelft.nl/artifactory/libs-release + + + + + + + + + + net.alchim31.maven + scala-maven-plugin + 4.8.1 + + incremental + ${scala.version} + + + + + compile + testCompile + + + + + + + org.scalatest + scalatest-maven-plugin + 2.2.0 + + + + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-source-plugin + 3.1.0 + + + attach-sources + + jar + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.2 + + none + + + + attach-javadocs + + jar + + + + + + + org.jfrog.buildinfo + artifactory-maven-plugin + 3.2.3 + + + build-info + + publish + + + + http://artifactory.ewi.tudelft.nl/artifactory + libs-release + wouter + ${passwd} + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.4.1 + + + + jar-with-dependencies + + + + true + true + + + + + + make-assembly + + package + + single + + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.jfrog.buildinfo + artifactory-maven-plugin + [1.0.0,) + + publish + + + + + + + + + + + + + + + + diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 6d68ee2..0000000 --- a/settings.gradle +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This settings file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be empty or even removed. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html - */ - -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - -rootProject.name = 'atk' diff --git a/src/atk/collection/DistinctBy.scala b/src/atk/collection/DistinctBy.scala deleted file mode 100644 index 447f5ee..0000000 --- a/src/atk/collection/DistinctBy.scala +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This work is licensed under the Creative Commons - * Attribution-NonCommercial-NoDerivs 3.0 Unported License. - * To view a copy of this license, visit - * http://creativecommons.org/licenses/by-nc-nd/3.0/ - * or send a letter to Creative Commons, 444 Castro Street, - * Suite 900, Mountain View, California, 94041, USA. - * - * A copy of the license is included in LICENSE.txt - * See the License for the specific language governing permissions - * and limitations under the License. - * - * Copyright 2014 Thomas Abeel - */ - -package atk.collection -/** - * Trait to add an additional distinctBy method to any Seq. - * - * This code is based on gist:1189097 - * https://gist.github.com/daithiocrualaoich/1189097 - * - */ -trait DistinctBy { - implicit def seq2Distinct[T, C[T] <: Seq[T]](tees: C[T]) = new { - import collection.generic.CanBuildFrom - import collection.mutable.{ HashSet => MutableHashSet } - - def distinctBy[S](hash: T => S)(implicit cbf: CanBuildFrom[C[T], T, C[T]]): C[T] = { - val builder = cbf() - val seen = MutableHashSet[S]() - - for (t <- tees) { - if (!seen(hash(t))) { - builder += t - seen += hash(t) - } - } - - builder.result - } - } -} \ No newline at end of file diff --git a/src/atk/io/HTMLPrintWriter.scala b/src/atk/io/HTMLPrintWriter.scala deleted file mode 100644 index a64b66a..0000000 --- a/src/atk/io/HTMLPrintWriter.scala +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This work is licensed under the Creative Commons - * Attribution-NonCommercial-NoDerivs 3.0 Unported License. - * To view a copy of this license, visit - * http://creativecommons.org/licenses/by-nc-nd/3.0/ - * or send a letter to Creative Commons, 444 Castro Street, - * Suite 900, Mountain View, California, 94041, USA. - * - * A copy of the license is included in LICENSE.txt - * See the License for the specific language governing permissions - * and limitations under the License. - * - * Copyright 2005-2013 Thomas Abeel - */ -package atk.io - -import java.io.PrintWriter -import atk.io.HTMLPrintWriter._ - -object HTMLPrintWriter { - def b(str: String) = tag(str, "b") - - def i(str: String) = tag(str, "i") - def a(link: String,label:String=null) = ""+(if(label==null)link else label)+"" - - def td(str: String) = tag(str, "td") - def th(str: String) = tag(str, "th") - - def tr(str: String) = tag(str, "tr") - def pre(str: String) = tag(str, "pre") - - def tag(str: String, tag: String) = { "<" + tag + ">" + str + "" } - def h1(str: String) = tag(str, "h1") - - def h2(str: String) = tag(str, "h2") - - def h3(str: String) = tag(str, "h3") - - def h4(str: String) = tag(str, "h4") -} - -class HTMLPrintWriter(str: String) extends PrintWriter(str: String) { - - def printTableOpen(option: String = "") = { - println("") - } - - def printTableClose = { println("
") } - - def ptag(str: String, tagX: String) = { println(tag(str, tagX)) } - - def printTableRow(row: String) = { - println("" + row.replaceAll("\t", "") + "") - } - def printTableHeading(row: String) = { - println("" + row.replaceAll("\t", "") + "") - } - - @Deprecated - def wrapBold(str: String) = "" + str + "" - - def ptr(row:String) = { println(tr(row)) } - -} \ No newline at end of file diff --git a/bsd/src/atk/compbio/tree/Tree.java b/src/main/java/atk/compbio/tree/Tree.java similarity index 100% rename from bsd/src/atk/compbio/tree/Tree.java rename to src/main/java/atk/compbio/tree/Tree.java diff --git a/bsd/src/atk/compbio/tree/TreeNode.java b/src/main/java/atk/compbio/tree/TreeNode.java similarity index 100% rename from bsd/src/atk/compbio/tree/TreeNode.java rename to src/main/java/atk/compbio/tree/TreeNode.java diff --git a/gpl/src/atk/compbio/tree/TreeParser.java b/src/main/java/atk/compbio/tree/TreeParser.java similarity index 100% rename from gpl/src/atk/compbio/tree/TreeParser.java rename to src/main/java/atk/compbio/tree/TreeParser.java diff --git a/gpl/src/atk/io/BetterTokenizer.java b/src/main/java/atk/io/BetterTokenizer.java similarity index 100% rename from gpl/src/atk/io/BetterTokenizer.java rename to src/main/java/atk/io/BetterTokenizer.java diff --git a/src/atk/io/DirectoryFilter.java b/src/main/java/atk/io/DirectoryFilter.java similarity index 100% rename from src/atk/io/DirectoryFilter.java rename to src/main/java/atk/io/DirectoryFilter.java diff --git a/src/atk/io/ExtensionFileFilter.java b/src/main/java/atk/io/ExtensionFileFilter.java similarity index 100% rename from src/atk/io/ExtensionFileFilter.java rename to src/main/java/atk/io/ExtensionFileFilter.java diff --git a/src/atk/io/IOTools.java b/src/main/java/atk/io/IOTools.java similarity index 100% rename from src/atk/io/IOTools.java rename to src/main/java/atk/io/IOTools.java diff --git a/src/atk/io/PatternFileFilter.java b/src/main/java/atk/io/PatternFileFilter.java similarity index 100% rename from src/atk/io/PatternFileFilter.java rename to src/main/java/atk/io/PatternFileFilter.java diff --git a/src/main/java/atk/license.txt b/src/main/java/atk/license.txt new file mode 100644 index 0000000..5a782ec --- /dev/null +++ b/src/main/java/atk/license.txt @@ -0,0 +1 @@ +Classes in this source folder are available under a GPL license diff --git a/src/atk/net/Email.java b/src/main/java/atk/net/Email.java similarity index 100% rename from src/atk/net/Email.java rename to src/main/java/atk/net/Email.java diff --git a/src/atk/util/ColorGradient.java b/src/main/java/atk/util/ColorGradient.java similarity index 100% rename from src/atk/util/ColorGradient.java rename to src/main/java/atk/util/ColorGradient.java diff --git a/src/atk/util/MD5Tools.java b/src/main/java/atk/util/MD5Tools.java similarity index 100% rename from src/atk/util/MD5Tools.java rename to src/main/java/atk/util/MD5Tools.java diff --git a/src/atk/util/NaturalOrderComparator.java b/src/main/java/atk/util/NaturalOrderComparator.java similarity index 100% rename from src/atk/util/NaturalOrderComparator.java rename to src/main/java/atk/util/NaturalOrderComparator.java diff --git a/src/atk/util/TimeInterval.java b/src/main/java/atk/util/TimeInterval.java similarity index 100% rename from src/atk/util/TimeInterval.java rename to src/main/java/atk/util/TimeInterval.java diff --git a/src/be/abeel/bioinformatics/FastaIterator.java b/src/main/java/be/abeel/bioinformatics/FastaIterator.java similarity index 100% rename from src/be/abeel/bioinformatics/FastaIterator.java rename to src/main/java/be/abeel/bioinformatics/FastaIterator.java diff --git a/src/be/abeel/bioinformatics/Record.java b/src/main/java/be/abeel/bioinformatics/Record.java similarity index 100% rename from src/be/abeel/bioinformatics/Record.java rename to src/main/java/be/abeel/bioinformatics/Record.java diff --git a/src/be/abeel/bioinformatics/SplitFasta.java b/src/main/java/be/abeel/bioinformatics/SplitFasta.java similarity index 100% rename from src/be/abeel/bioinformatics/SplitFasta.java rename to src/main/java/be/abeel/bioinformatics/SplitFasta.java diff --git a/src/be/abeel/bioinformatics/dnaproperties/ConversionMap.java b/src/main/java/be/abeel/bioinformatics/dnaproperties/ConversionMap.java similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/ConversionMap.java rename to src/main/java/be/abeel/bioinformatics/dnaproperties/ConversionMap.java diff --git a/src/be/abeel/bioinformatics/dnaproperties/ConversionMapDNAProperty.java b/src/main/java/be/abeel/bioinformatics/dnaproperties/ConversionMapDNAProperty.java similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/ConversionMapDNAProperty.java rename to src/main/java/be/abeel/bioinformatics/dnaproperties/ConversionMapDNAProperty.java diff --git a/src/be/abeel/bioinformatics/dnaproperties/DNAProperty.java b/src/main/java/be/abeel/bioinformatics/dnaproperties/DNAProperty.java similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/DNAProperty.java rename to src/main/java/be/abeel/bioinformatics/dnaproperties/DNAProperty.java diff --git a/src/be/abeel/bioinformatics/dnaproperties/RadicalCleavageIntensity.java b/src/main/java/be/abeel/bioinformatics/dnaproperties/RadicalCleavageIntensity.java similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/RadicalCleavageIntensity.java rename to src/main/java/be/abeel/bioinformatics/dnaproperties/RadicalCleavageIntensity.java diff --git a/src/be/abeel/concurrency/DaemonThread.java b/src/main/java/be/abeel/concurrency/DaemonThread.java similarity index 100% rename from src/be/abeel/concurrency/DaemonThread.java rename to src/main/java/be/abeel/concurrency/DaemonThread.java diff --git a/src/be/abeel/concurrency/DaemonThreadFactory.java b/src/main/java/be/abeel/concurrency/DaemonThreadFactory.java similarity index 100% rename from src/be/abeel/concurrency/DaemonThreadFactory.java rename to src/main/java/be/abeel/concurrency/DaemonThreadFactory.java diff --git a/src/be/abeel/graphics/Drawable.java b/src/main/java/be/abeel/graphics/Drawable.java similarity index 100% rename from src/be/abeel/graphics/Drawable.java rename to src/main/java/be/abeel/graphics/Drawable.java diff --git a/src/be/abeel/graphics/GraphicsFileExport.java b/src/main/java/be/abeel/graphics/GraphicsFileExport.java similarity index 100% rename from src/be/abeel/graphics/GraphicsFileExport.java rename to src/main/java/be/abeel/graphics/GraphicsFileExport.java diff --git a/src/be/abeel/graphics/Image4Jexport.java b/src/main/java/be/abeel/graphics/Image4Jexport.java similarity index 100% rename from src/be/abeel/graphics/Image4Jexport.java rename to src/main/java/be/abeel/graphics/Image4Jexport.java diff --git a/src/be/abeel/graphics/ImageDrawable.java b/src/main/java/be/abeel/graphics/ImageDrawable.java similarity index 100% rename from src/be/abeel/graphics/ImageDrawable.java rename to src/main/java/be/abeel/graphics/ImageDrawable.java diff --git a/src/be/abeel/graphics/ImageIOexport.java b/src/main/java/be/abeel/graphics/ImageIOexport.java similarity index 100% rename from src/be/abeel/graphics/ImageIOexport.java rename to src/main/java/be/abeel/graphics/ImageIOexport.java diff --git a/src/be/abeel/graphics/PDFexport.java b/src/main/java/be/abeel/graphics/PDFexport.java similarity index 100% rename from src/be/abeel/graphics/PDFexport.java rename to src/main/java/be/abeel/graphics/PDFexport.java diff --git a/src/be/abeel/gui/GridBagPanel.java b/src/main/java/be/abeel/gui/GridBagPanel.java similarity index 100% rename from src/be/abeel/gui/GridBagPanel.java rename to src/main/java/be/abeel/gui/GridBagPanel.java diff --git a/src/be/abeel/gui/JIntegerField.java b/src/main/java/be/abeel/gui/JIntegerField.java similarity index 100% rename from src/be/abeel/gui/JIntegerField.java rename to src/main/java/be/abeel/gui/JIntegerField.java diff --git a/src/be/abeel/gui/MemoryWidget.java b/src/main/java/be/abeel/gui/MemoryWidget.java similarity index 100% rename from src/be/abeel/gui/MemoryWidget.java rename to src/main/java/be/abeel/gui/MemoryWidget.java diff --git a/src/be/abeel/gui/MultiFileBean.java b/src/main/java/be/abeel/gui/MultiFileBean.java similarity index 100% rename from src/be/abeel/gui/MultiFileBean.java rename to src/main/java/be/abeel/gui/MultiFileBean.java diff --git a/src/be/abeel/gui/TitledComponent.java b/src/main/java/be/abeel/gui/TitledComponent.java similarity index 100% rename from src/be/abeel/gui/TitledComponent.java rename to src/main/java/be/abeel/gui/TitledComponent.java diff --git a/src/be/abeel/io/Base64.java b/src/main/java/be/abeel/io/Base64.java similarity index 100% rename from src/be/abeel/io/Base64.java rename to src/main/java/be/abeel/io/Base64.java diff --git a/src/be/abeel/io/ColumnIterator.java b/src/main/java/be/abeel/io/ColumnIterator.java similarity index 100% rename from src/be/abeel/io/ColumnIterator.java rename to src/main/java/be/abeel/io/ColumnIterator.java diff --git a/src/be/abeel/io/Copier.java b/src/main/java/be/abeel/io/Copier.java similarity index 100% rename from src/be/abeel/io/Copier.java rename to src/main/java/be/abeel/io/Copier.java diff --git a/src/be/abeel/io/ExtensionManager.java b/src/main/java/be/abeel/io/ExtensionManager.java similarity index 100% rename from src/be/abeel/io/ExtensionManager.java rename to src/main/java/be/abeel/io/ExtensionManager.java diff --git a/src/be/abeel/io/GZIPPrintWriter.java b/src/main/java/be/abeel/io/GZIPPrintWriter.java similarity index 100% rename from src/be/abeel/io/GZIPPrintWriter.java rename to src/main/java/be/abeel/io/GZIPPrintWriter.java diff --git a/src/be/abeel/io/LineIterator.java b/src/main/java/be/abeel/io/LineIterator.java similarity index 100% rename from src/be/abeel/io/LineIterator.java rename to src/main/java/be/abeel/io/LineIterator.java diff --git a/src/be/abeel/io/LineIteratorFactory.java b/src/main/java/be/abeel/io/LineIteratorFactory.java similarity index 100% rename from src/be/abeel/io/LineIteratorFactory.java rename to src/main/java/be/abeel/io/LineIteratorFactory.java diff --git a/src/be/abeel/io/NullStream.java b/src/main/java/be/abeel/io/NullStream.java similarity index 100% rename from src/be/abeel/io/NullStream.java rename to src/main/java/be/abeel/io/NullStream.java diff --git a/src/be/abeel/io/PatternFileFilter.java b/src/main/java/be/abeel/io/PatternFileFilter.java similarity index 100% rename from src/be/abeel/io/PatternFileFilter.java rename to src/main/java/be/abeel/io/PatternFileFilter.java diff --git a/src/be/abeel/io/Serial.java b/src/main/java/be/abeel/io/Serial.java similarity index 100% rename from src/be/abeel/io/Serial.java rename to src/main/java/be/abeel/io/Serial.java diff --git a/src/be/abeel/jfreechart/JFreeChartWrapper.java b/src/main/java/be/abeel/jfreechart/JFreeChartWrapper.java similarity index 100% rename from src/be/abeel/jfreechart/JFreeChartWrapper.java rename to src/main/java/be/abeel/jfreechart/JFreeChartWrapper.java diff --git a/src/be/abeel/net/ClientHttpRequest.java b/src/main/java/be/abeel/net/ClientHttpRequest.java similarity index 100% rename from src/be/abeel/net/ClientHttpRequest.java rename to src/main/java/be/abeel/net/ClientHttpRequest.java diff --git a/src/be/abeel/net/ClientHttpUpload.java b/src/main/java/be/abeel/net/ClientHttpUpload.java similarity index 100% rename from src/be/abeel/net/ClientHttpUpload.java rename to src/main/java/be/abeel/net/ClientHttpUpload.java diff --git a/src/be/abeel/net/URIFactory.java b/src/main/java/be/abeel/net/URIFactory.java similarity index 100% rename from src/be/abeel/net/URIFactory.java rename to src/main/java/be/abeel/net/URIFactory.java diff --git a/src/be/abeel/package.html b/src/main/java/be/abeel/package.html similarity index 100% rename from src/be/abeel/package.html rename to src/main/java/be/abeel/package.html diff --git a/src/be/abeel/util/CountMap.java b/src/main/java/be/abeel/util/CountMap.java similarity index 100% rename from src/be/abeel/util/CountMap.java rename to src/main/java/be/abeel/util/CountMap.java diff --git a/src/be/abeel/util/CountMap2D.java b/src/main/java/be/abeel/util/CountMap2D.java similarity index 100% rename from src/be/abeel/util/CountMap2D.java rename to src/main/java/be/abeel/util/CountMap2D.java diff --git a/src/be/abeel/util/CountMapTools.java b/src/main/java/be/abeel/util/CountMapTools.java similarity index 100% rename from src/be/abeel/util/CountMapTools.java rename to src/main/java/be/abeel/util/CountMapTools.java diff --git a/src/be/abeel/util/DefaultConcurrentHashMap.java b/src/main/java/be/abeel/util/DefaultConcurrentHashMap.java similarity index 100% rename from src/be/abeel/util/DefaultConcurrentHashMap.java rename to src/main/java/be/abeel/util/DefaultConcurrentHashMap.java diff --git a/src/be/abeel/util/DefaultHashMap.java b/src/main/java/be/abeel/util/DefaultHashMap.java similarity index 100% rename from src/be/abeel/util/DefaultHashMap.java rename to src/main/java/be/abeel/util/DefaultHashMap.java diff --git a/src/be/abeel/util/DefaultHashMap2D.java b/src/main/java/be/abeel/util/DefaultHashMap2D.java similarity index 100% rename from src/be/abeel/util/DefaultHashMap2D.java rename to src/main/java/be/abeel/util/DefaultHashMap2D.java diff --git a/src/be/abeel/util/DefaultTreeMap.java b/src/main/java/be/abeel/util/DefaultTreeMap.java similarity index 100% rename from src/be/abeel/util/DefaultTreeMap.java rename to src/main/java/be/abeel/util/DefaultTreeMap.java diff --git a/src/be/abeel/util/FrequencyMap.java b/src/main/java/be/abeel/util/FrequencyMap.java similarity index 100% rename from src/be/abeel/util/FrequencyMap.java rename to src/main/java/be/abeel/util/FrequencyMap.java diff --git a/src/be/abeel/util/FrequencyMapUtils.java b/src/main/java/be/abeel/util/FrequencyMapUtils.java similarity index 100% rename from src/be/abeel/util/FrequencyMapUtils.java rename to src/main/java/be/abeel/util/FrequencyMapUtils.java diff --git a/src/be/abeel/util/HashMap2D.java b/src/main/java/be/abeel/util/HashMap2D.java similarity index 100% rename from src/be/abeel/util/HashMap2D.java rename to src/main/java/be/abeel/util/HashMap2D.java diff --git a/src/be/abeel/util/LRUCache.java b/src/main/java/be/abeel/util/LRUCache.java similarity index 100% rename from src/be/abeel/util/LRUCache.java rename to src/main/java/be/abeel/util/LRUCache.java diff --git a/src/be/abeel/util/MTRandom.java b/src/main/java/be/abeel/util/MTRandom.java similarity index 100% rename from src/be/abeel/util/MTRandom.java rename to src/main/java/be/abeel/util/MTRandom.java diff --git a/src/be/abeel/util/NaturalOrderComparator.java b/src/main/java/be/abeel/util/NaturalOrderComparator.java similarity index 100% rename from src/be/abeel/util/NaturalOrderComparator.java rename to src/main/java/be/abeel/util/NaturalOrderComparator.java diff --git a/src/be/abeel/util/Pair.java b/src/main/java/be/abeel/util/Pair.java similarity index 100% rename from src/be/abeel/util/Pair.java rename to src/main/java/be/abeel/util/Pair.java diff --git a/src/be/abeel/util/SetTools.java b/src/main/java/be/abeel/util/SetTools.java similarity index 100% rename from src/be/abeel/util/SetTools.java rename to src/main/java/be/abeel/util/SetTools.java diff --git a/src/be/abeel/util/Triplet.java b/src/main/java/be/abeel/util/Triplet.java similarity index 100% rename from src/be/abeel/util/Triplet.java rename to src/main/java/be/abeel/util/Triplet.java diff --git a/gpl/src/edu/northwestern/at/utils/FileUtils.java b/src/main/java/edu/northwestern/at/utils/FileUtils.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/FileUtils.java rename to src/main/java/edu/northwestern/at/utils/FileUtils.java diff --git a/gpl/src/edu/northwestern/at/utils/Formatters.java b/src/main/java/edu/northwestern/at/utils/Formatters.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/Formatters.java rename to src/main/java/edu/northwestern/at/utils/Formatters.java diff --git a/gpl/src/edu/northwestern/at/utils/PrintfFormat.java b/src/main/java/edu/northwestern/at/utils/PrintfFormat.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/PrintfFormat.java rename to src/main/java/edu/northwestern/at/utils/PrintfFormat.java diff --git a/gpl/src/edu/northwestern/at/utils/Sorting.java b/src/main/java/edu/northwestern/at/utils/Sorting.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/Sorting.java rename to src/main/java/edu/northwestern/at/utils/Sorting.java diff --git a/gpl/src/edu/northwestern/at/utils/StringUtils.java b/src/main/java/edu/northwestern/at/utils/StringUtils.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/StringUtils.java rename to src/main/java/edu/northwestern/at/utils/StringUtils.java diff --git a/gpl/src/edu/northwestern/at/utils/math/ArithUtils.java b/src/main/java/edu/northwestern/at/utils/math/ArithUtils.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/ArithUtils.java rename to src/main/java/edu/northwestern/at/utils/math/ArithUtils.java diff --git a/gpl/src/edu/northwestern/at/utils/math/Complex.java b/src/main/java/edu/northwestern/at/utils/math/Complex.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/Complex.java rename to src/main/java/edu/northwestern/at/utils/math/Complex.java diff --git a/gpl/src/edu/northwestern/at/utils/math/Constants.java b/src/main/java/edu/northwestern/at/utils/math/Constants.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/Constants.java rename to src/main/java/edu/northwestern/at/utils/math/Constants.java diff --git a/gpl/src/edu/northwestern/at/utils/math/DyadicFunction.java b/src/main/java/edu/northwestern/at/utils/math/DyadicFunction.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/DyadicFunction.java rename to src/main/java/edu/northwestern/at/utils/math/DyadicFunction.java diff --git a/gpl/src/edu/northwestern/at/utils/math/Factorial.java b/src/main/java/edu/northwestern/at/utils/math/Factorial.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/Factorial.java rename to src/main/java/edu/northwestern/at/utils/math/Factorial.java diff --git a/gpl/src/edu/northwestern/at/utils/math/MonadicFunction.java b/src/main/java/edu/northwestern/at/utils/math/MonadicFunction.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/MonadicFunction.java rename to src/main/java/edu/northwestern/at/utils/math/MonadicFunction.java diff --git a/gpl/src/edu/northwestern/at/utils/math/NumberOps.java b/src/main/java/edu/northwestern/at/utils/math/NumberOps.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/NumberOps.java rename to src/main/java/edu/northwestern/at/utils/math/NumberOps.java diff --git a/gpl/src/edu/northwestern/at/utils/math/Polynomial.java b/src/main/java/edu/northwestern/at/utils/math/Polynomial.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/Polynomial.java rename to src/main/java/edu/northwestern/at/utils/math/Polynomial.java diff --git a/gpl/src/edu/northwestern/at/utils/math/SplitDouble.java b/src/main/java/edu/northwestern/at/utils/math/SplitDouble.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/SplitDouble.java rename to src/main/java/edu/northwestern/at/utils/math/SplitDouble.java diff --git a/gpl/src/edu/northwestern/at/utils/math/distributions/Beta.java b/src/main/java/edu/northwestern/at/utils/math/distributions/Beta.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/distributions/Beta.java rename to src/main/java/edu/northwestern/at/utils/math/distributions/Beta.java diff --git a/gpl/src/edu/northwestern/at/utils/math/distributions/ChiSquare.java b/src/main/java/edu/northwestern/at/utils/math/distributions/ChiSquare.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/distributions/ChiSquare.java rename to src/main/java/edu/northwestern/at/utils/math/distributions/ChiSquare.java diff --git a/gpl/src/edu/northwestern/at/utils/math/distributions/ErrorFunction.java b/src/main/java/edu/northwestern/at/utils/math/distributions/ErrorFunction.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/distributions/ErrorFunction.java rename to src/main/java/edu/northwestern/at/utils/math/distributions/ErrorFunction.java diff --git a/gpl/src/edu/northwestern/at/utils/math/distributions/FishersF.java b/src/main/java/edu/northwestern/at/utils/math/distributions/FishersF.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/distributions/FishersF.java rename to src/main/java/edu/northwestern/at/utils/math/distributions/FishersF.java diff --git a/gpl/src/edu/northwestern/at/utils/math/distributions/Gamma.java b/src/main/java/edu/northwestern/at/utils/math/distributions/Gamma.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/distributions/Gamma.java rename to src/main/java/edu/northwestern/at/utils/math/distributions/Gamma.java diff --git a/gpl/src/edu/northwestern/at/utils/math/distributions/Normal.java b/src/main/java/edu/northwestern/at/utils/math/distributions/Normal.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/distributions/Normal.java rename to src/main/java/edu/northwestern/at/utils/math/distributions/Normal.java diff --git a/gpl/src/edu/northwestern/at/utils/math/distributions/Sig.java b/src/main/java/edu/northwestern/at/utils/math/distributions/Sig.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/distributions/Sig.java rename to src/main/java/edu/northwestern/at/utils/math/distributions/Sig.java diff --git a/gpl/src/edu/northwestern/at/utils/math/distributions/Studentst.java b/src/main/java/edu/northwestern/at/utils/math/distributions/Studentst.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/distributions/Studentst.java rename to src/main/java/edu/northwestern/at/utils/math/distributions/Studentst.java diff --git a/gpl/src/edu/northwestern/at/utils/math/distributions/package.html b/src/main/java/edu/northwestern/at/utils/math/distributions/package.html similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/distributions/package.html rename to src/main/java/edu/northwestern/at/utils/math/distributions/package.html diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/AbstractMatrix.java b/src/main/java/edu/northwestern/at/utils/math/matrix/AbstractMatrix.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/AbstractMatrix.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/AbstractMatrix.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/CholeskyDecomposition.java b/src/main/java/edu/northwestern/at/utils/math/matrix/CholeskyDecomposition.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/CholeskyDecomposition.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/CholeskyDecomposition.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/ColumnTransformation.java b/src/main/java/edu/northwestern/at/utils/math/matrix/ColumnTransformation.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/ColumnTransformation.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/ColumnTransformation.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/ColumnTransformer.java b/src/main/java/edu/northwestern/at/utils/math/matrix/ColumnTransformer.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/ColumnTransformer.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/ColumnTransformer.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/DenseMatrix.java b/src/main/java/edu/northwestern/at/utils/math/matrix/DenseMatrix.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/DenseMatrix.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/DenseMatrix.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/EigenvalueDecomposition.java b/src/main/java/edu/northwestern/at/utils/math/matrix/EigenvalueDecomposition.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/EigenvalueDecomposition.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/EigenvalueDecomposition.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/LUDecomposition.java b/src/main/java/edu/northwestern/at/utils/math/matrix/LUDecomposition.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/LUDecomposition.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/LUDecomposition.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/Matrices.java b/src/main/java/edu/northwestern/at/utils/math/matrix/Matrices.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/Matrices.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/Matrices.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatricesMeasure.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatricesMeasure.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatricesMeasure.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatricesMeasure.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/Matrix.java b/src/main/java/edu/northwestern/at/utils/math/matrix/Matrix.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/Matrix.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/Matrix.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixConditionalEBETransformation.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixConditionalEBETransformation.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixConditionalEBETransformation.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixConditionalEBETransformation.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixEBEOperation.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixEBEOperation.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixEBEOperation.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixEBEOperation.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixEBETransformation.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixEBETransformation.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixEBETransformation.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixEBETransformation.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixEBETransformer.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixEBETransformer.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixEBETransformer.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixEBETransformer.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixFactory.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixFactory.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixFactory.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixFactory.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixFromString.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixFromString.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixFromString.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixFromString.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixMeasure.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixMeasure.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixMeasure.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixMeasure.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixMismatchedSizeException.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixMismatchedSizeException.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixMismatchedSizeException.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixMismatchedSizeException.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixOperator.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixOperator.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixOperator.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixOperator.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixProperty.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixProperty.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixProperty.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixProperty.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixSingularException.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixSingularException.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixSingularException.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixSingularException.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixToString.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixToString.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixToString.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixToString.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/MatrixTransformer.java b/src/main/java/edu/northwestern/at/utils/math/matrix/MatrixTransformer.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/MatrixTransformer.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/MatrixTransformer.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/QRDecomposition.java b/src/main/java/edu/northwestern/at/utils/math/matrix/QRDecomposition.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/QRDecomposition.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/QRDecomposition.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/RowTransformer.java b/src/main/java/edu/northwestern/at/utils/math/matrix/RowTransformer.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/RowTransformer.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/RowTransformer.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/SingularValueDecomposition.java b/src/main/java/edu/northwestern/at/utils/math/matrix/SingularValueDecomposition.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/SingularValueDecomposition.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/SingularValueDecomposition.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/SparseMatrix.java b/src/main/java/edu/northwestern/at/utils/math/matrix/SparseMatrix.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/SparseMatrix.java rename to src/main/java/edu/northwestern/at/utils/math/matrix/SparseMatrix.java diff --git a/gpl/src/edu/northwestern/at/utils/math/matrix/package.html b/src/main/java/edu/northwestern/at/utils/math/matrix/package.html similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/matrix/package.html rename to src/main/java/edu/northwestern/at/utils/math/matrix/package.html diff --git a/gpl/src/edu/northwestern/at/utils/math/package.html b/src/main/java/edu/northwestern/at/utils/math/package.html similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/package.html rename to src/main/java/edu/northwestern/at/utils/math/package.html diff --git a/gpl/src/edu/northwestern/at/utils/math/randomnumbers/MersenneTwister.java b/src/main/java/edu/northwestern/at/utils/math/randomnumbers/MersenneTwister.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/randomnumbers/MersenneTwister.java rename to src/main/java/edu/northwestern/at/utils/math/randomnumbers/MersenneTwister.java diff --git a/gpl/src/edu/northwestern/at/utils/math/randomnumbers/RandomVariable.java b/src/main/java/edu/northwestern/at/utils/math/randomnumbers/RandomVariable.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/randomnumbers/RandomVariable.java rename to src/main/java/edu/northwestern/at/utils/math/randomnumbers/RandomVariable.java diff --git a/gpl/src/edu/northwestern/at/utils/math/randomnumbers/package.html b/src/main/java/edu/northwestern/at/utils/math/randomnumbers/package.html similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/randomnumbers/package.html rename to src/main/java/edu/northwestern/at/utils/math/randomnumbers/package.html diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/Bisection.java b/src/main/java/edu/northwestern/at/utils/math/rootfinders/Bisection.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/Bisection.java rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/Bisection.java diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/BracketRoot.java b/src/main/java/edu/northwestern/at/utils/math/rootfinders/BracketRoot.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/BracketRoot.java rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/BracketRoot.java diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/Brent.java b/src/main/java/edu/northwestern/at/utils/math/rootfinders/Brent.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/Brent.java rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/Brent.java diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/MonadicFunctionRootFinder.java b/src/main/java/edu/northwestern/at/utils/math/rootfinders/MonadicFunctionRootFinder.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/MonadicFunctionRootFinder.java rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/MonadicFunctionRootFinder.java diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/NewtonRaphson.java b/src/main/java/edu/northwestern/at/utils/math/rootfinders/NewtonRaphson.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/NewtonRaphson.java rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/NewtonRaphson.java diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/RootFinderConvergenceTest.java b/src/main/java/edu/northwestern/at/utils/math/rootfinders/RootFinderConvergenceTest.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/RootFinderConvergenceTest.java rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/RootFinderConvergenceTest.java diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/RootFinderIterationInformation.java b/src/main/java/edu/northwestern/at/utils/math/rootfinders/RootFinderIterationInformation.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/RootFinderIterationInformation.java rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/RootFinderIterationInformation.java diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/Secant.java b/src/main/java/edu/northwestern/at/utils/math/rootfinders/Secant.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/Secant.java rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/Secant.java diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/StandardRootFinderConvergenceTest.java b/src/main/java/edu/northwestern/at/utils/math/rootfinders/StandardRootFinderConvergenceTest.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/StandardRootFinderConvergenceTest.java rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/StandardRootFinderConvergenceTest.java diff --git a/gpl/src/edu/northwestern/at/utils/math/rootfinders/package.html b/src/main/java/edu/northwestern/at/utils/math/rootfinders/package.html similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/rootfinders/package.html rename to src/main/java/edu/northwestern/at/utils/math/rootfinders/package.html diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/ContingencyTable.java b/src/main/java/edu/northwestern/at/utils/math/statistics/ContingencyTable.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/ContingencyTable.java rename to src/main/java/edu/northwestern/at/utils/math/statistics/ContingencyTable.java diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/Covar.java b/src/main/java/edu/northwestern/at/utils/math/statistics/Covar.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/Covar.java rename to src/main/java/edu/northwestern/at/utils/math/statistics/Covar.java diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/Descriptive.java b/src/main/java/edu/northwestern/at/utils/math/statistics/Descriptive.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/Descriptive.java rename to src/main/java/edu/northwestern/at/utils/math/statistics/Descriptive.java diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/FishersExactTest.java b/src/main/java/edu/northwestern/at/utils/math/statistics/FishersExactTest.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/FishersExactTest.java rename to src/main/java/edu/northwestern/at/utils/math/statistics/FishersExactTest.java diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/OneWayTable.java b/src/main/java/edu/northwestern/at/utils/math/statistics/OneWayTable.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/OneWayTable.java rename to src/main/java/edu/northwestern/at/utils/math/statistics/OneWayTable.java diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/PrincipalComponents.java b/src/main/java/edu/northwestern/at/utils/math/statistics/PrincipalComponents.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/PrincipalComponents.java rename to src/main/java/edu/northwestern/at/utils/math/statistics/PrincipalComponents.java diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/RankOrder.java b/src/main/java/edu/northwestern/at/utils/math/statistics/RankOrder.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/RankOrder.java rename to src/main/java/edu/northwestern/at/utils/math/statistics/RankOrder.java diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/SpearmanCorr.java b/src/main/java/edu/northwestern/at/utils/math/statistics/SpearmanCorr.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/SpearmanCorr.java rename to src/main/java/edu/northwestern/at/utils/math/statistics/SpearmanCorr.java diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/Standardize.java b/src/main/java/edu/northwestern/at/utils/math/statistics/Standardize.java similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/Standardize.java rename to src/main/java/edu/northwestern/at/utils/math/statistics/Standardize.java diff --git a/gpl/src/edu/northwestern/at/utils/math/statistics/package.html b/src/main/java/edu/northwestern/at/utils/math/statistics/package.html similarity index 100% rename from gpl/src/edu/northwestern/at/utils/math/statistics/package.html rename to src/main/java/edu/northwestern/at/utils/math/statistics/package.html diff --git a/src/main/java/edu/northwestern/license.txt b/src/main/java/edu/northwestern/license.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/net/sf/image4j/codec/bmp/BMPConstants.java b/src/main/java/net/sf/image4j/codec/bmp/BMPConstants.java similarity index 100% rename from src/net/sf/image4j/codec/bmp/BMPConstants.java rename to src/main/java/net/sf/image4j/codec/bmp/BMPConstants.java diff --git a/src/net/sf/image4j/codec/bmp/BMPDecoder.java b/src/main/java/net/sf/image4j/codec/bmp/BMPDecoder.java similarity index 100% rename from src/net/sf/image4j/codec/bmp/BMPDecoder.java rename to src/main/java/net/sf/image4j/codec/bmp/BMPDecoder.java diff --git a/src/net/sf/image4j/codec/bmp/BMPEncoder.java b/src/main/java/net/sf/image4j/codec/bmp/BMPEncoder.java similarity index 100% rename from src/net/sf/image4j/codec/bmp/BMPEncoder.java rename to src/main/java/net/sf/image4j/codec/bmp/BMPEncoder.java diff --git a/src/net/sf/image4j/codec/bmp/BMPImage.java b/src/main/java/net/sf/image4j/codec/bmp/BMPImage.java similarity index 100% rename from src/net/sf/image4j/codec/bmp/BMPImage.java rename to src/main/java/net/sf/image4j/codec/bmp/BMPImage.java diff --git a/src/net/sf/image4j/codec/bmp/ColorEntry.java b/src/main/java/net/sf/image4j/codec/bmp/ColorEntry.java similarity index 100% rename from src/net/sf/image4j/codec/bmp/ColorEntry.java rename to src/main/java/net/sf/image4j/codec/bmp/ColorEntry.java diff --git a/src/net/sf/image4j/codec/bmp/InfoHeader.java b/src/main/java/net/sf/image4j/codec/bmp/InfoHeader.java similarity index 100% rename from src/net/sf/image4j/codec/bmp/InfoHeader.java rename to src/main/java/net/sf/image4j/codec/bmp/InfoHeader.java diff --git a/src/net/sf/image4j/codec/bmp/package.html b/src/main/java/net/sf/image4j/codec/bmp/package.html similarity index 100% rename from src/net/sf/image4j/codec/bmp/package.html rename to src/main/java/net/sf/image4j/codec/bmp/package.html diff --git a/src/net/sf/image4j/codec/ico/ICOConstants.java b/src/main/java/net/sf/image4j/codec/ico/ICOConstants.java similarity index 100% rename from src/net/sf/image4j/codec/ico/ICOConstants.java rename to src/main/java/net/sf/image4j/codec/ico/ICOConstants.java diff --git a/src/net/sf/image4j/codec/ico/ICODecoder.java b/src/main/java/net/sf/image4j/codec/ico/ICODecoder.java similarity index 100% rename from src/net/sf/image4j/codec/ico/ICODecoder.java rename to src/main/java/net/sf/image4j/codec/ico/ICODecoder.java diff --git a/src/net/sf/image4j/codec/ico/ICOEncoder.java b/src/main/java/net/sf/image4j/codec/ico/ICOEncoder.java similarity index 100% rename from src/net/sf/image4j/codec/ico/ICOEncoder.java rename to src/main/java/net/sf/image4j/codec/ico/ICOEncoder.java diff --git a/src/net/sf/image4j/codec/ico/ICOImage.java b/src/main/java/net/sf/image4j/codec/ico/ICOImage.java similarity index 100% rename from src/net/sf/image4j/codec/ico/ICOImage.java rename to src/main/java/net/sf/image4j/codec/ico/ICOImage.java diff --git a/src/net/sf/image4j/codec/ico/IconEntry.java b/src/main/java/net/sf/image4j/codec/ico/IconEntry.java similarity index 100% rename from src/net/sf/image4j/codec/ico/IconEntry.java rename to src/main/java/net/sf/image4j/codec/ico/IconEntry.java diff --git a/src/net/sf/image4j/codec/ico/package.html b/src/main/java/net/sf/image4j/codec/ico/package.html similarity index 100% rename from src/net/sf/image4j/codec/ico/package.html rename to src/main/java/net/sf/image4j/codec/ico/package.html diff --git a/src/net/sf/image4j/codec/package.html b/src/main/java/net/sf/image4j/codec/package.html similarity index 100% rename from src/net/sf/image4j/codec/package.html rename to src/main/java/net/sf/image4j/codec/package.html diff --git a/src/net/sf/image4j/io/EndianUtils.java b/src/main/java/net/sf/image4j/io/EndianUtils.java similarity index 100% rename from src/net/sf/image4j/io/EndianUtils.java rename to src/main/java/net/sf/image4j/io/EndianUtils.java diff --git a/src/net/sf/image4j/io/LittleEndianInputStream.java b/src/main/java/net/sf/image4j/io/LittleEndianInputStream.java similarity index 100% rename from src/net/sf/image4j/io/LittleEndianInputStream.java rename to src/main/java/net/sf/image4j/io/LittleEndianInputStream.java diff --git a/src/net/sf/image4j/io/LittleEndianOutputStream.java b/src/main/java/net/sf/image4j/io/LittleEndianOutputStream.java similarity index 100% rename from src/net/sf/image4j/io/LittleEndianOutputStream.java rename to src/main/java/net/sf/image4j/io/LittleEndianOutputStream.java diff --git a/src/net/sf/image4j/io/LittleEndianRandomAccessFile.java b/src/main/java/net/sf/image4j/io/LittleEndianRandomAccessFile.java similarity index 100% rename from src/net/sf/image4j/io/LittleEndianRandomAccessFile.java rename to src/main/java/net/sf/image4j/io/LittleEndianRandomAccessFile.java diff --git a/src/net/sf/image4j/io/package.html b/src/main/java/net/sf/image4j/io/package.html similarity index 100% rename from src/net/sf/image4j/io/package.html rename to src/main/java/net/sf/image4j/io/package.html diff --git a/src/net/sf/image4j/util/ConvertUtil.java b/src/main/java/net/sf/image4j/util/ConvertUtil.java similarity index 100% rename from src/net/sf/image4j/util/ConvertUtil.java rename to src/main/java/net/sf/image4j/util/ConvertUtil.java diff --git a/src/net/sf/image4j/util/ImageUtil.java b/src/main/java/net/sf/image4j/util/ImageUtil.java similarity index 100% rename from src/net/sf/image4j/util/ImageUtil.java rename to src/main/java/net/sf/image4j/util/ImageUtil.java diff --git a/src/net/sf/image4j/util/package.html b/src/main/java/net/sf/image4j/util/package.html similarity index 100% rename from src/net/sf/image4j/util/package.html rename to src/main/java/net/sf/image4j/util/package.html diff --git a/bsd/src/org/arabidopsis/ahocorasick/AhoCorasick.java b/src/main/java/org/arabidopsis/ahocorasick/AhoCorasick.java similarity index 100% rename from bsd/src/org/arabidopsis/ahocorasick/AhoCorasick.java rename to src/main/java/org/arabidopsis/ahocorasick/AhoCorasick.java diff --git a/bsd/src/org/arabidopsis/ahocorasick/DenseEdgeList.java b/src/main/java/org/arabidopsis/ahocorasick/DenseEdgeList.java similarity index 100% rename from bsd/src/org/arabidopsis/ahocorasick/DenseEdgeList.java rename to src/main/java/org/arabidopsis/ahocorasick/DenseEdgeList.java diff --git a/bsd/src/org/arabidopsis/ahocorasick/EdgeList.java b/src/main/java/org/arabidopsis/ahocorasick/EdgeList.java similarity index 100% rename from bsd/src/org/arabidopsis/ahocorasick/EdgeList.java rename to src/main/java/org/arabidopsis/ahocorasick/EdgeList.java diff --git a/bsd/src/org/arabidopsis/ahocorasick/Queue.java b/src/main/java/org/arabidopsis/ahocorasick/Queue.java similarity index 100% rename from bsd/src/org/arabidopsis/ahocorasick/Queue.java rename to src/main/java/org/arabidopsis/ahocorasick/Queue.java diff --git a/bsd/src/org/arabidopsis/ahocorasick/SearchResult.java b/src/main/java/org/arabidopsis/ahocorasick/SearchResult.java similarity index 100% rename from bsd/src/org/arabidopsis/ahocorasick/SearchResult.java rename to src/main/java/org/arabidopsis/ahocorasick/SearchResult.java diff --git a/bsd/src/org/arabidopsis/ahocorasick/Searcher.java b/src/main/java/org/arabidopsis/ahocorasick/Searcher.java similarity index 100% rename from bsd/src/org/arabidopsis/ahocorasick/Searcher.java rename to src/main/java/org/arabidopsis/ahocorasick/Searcher.java diff --git a/bsd/src/org/arabidopsis/ahocorasick/SparseEdgeList.java b/src/main/java/org/arabidopsis/ahocorasick/SparseEdgeList.java similarity index 100% rename from bsd/src/org/arabidopsis/ahocorasick/SparseEdgeList.java rename to src/main/java/org/arabidopsis/ahocorasick/SparseEdgeList.java diff --git a/bsd/src/org/arabidopsis/ahocorasick/State.java b/src/main/java/org/arabidopsis/ahocorasick/State.java similarity index 100% rename from bsd/src/org/arabidopsis/ahocorasick/State.java rename to src/main/java/org/arabidopsis/ahocorasick/State.java diff --git a/bsd/license.txt b/src/main/java/org/arabidopsis/license.txt similarity index 97% rename from bsd/license.txt rename to src/main/java/org/arabidopsis/license.txt index 09c7376..9b1a833 100644 --- a/bsd/license.txt +++ b/src/main/java/org/arabidopsis/license.txt @@ -1,34 +1,34 @@ -License applicable only to the org.arabidopsis.ahocorasick package: - - -Copyright (c) 2005, 2008 Danny Yoo -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - - * Neither the name of the Carnegie Institution of Washington nor -the names of its contributors may be used to endorse or promote -products derived from this software without specific prior written -permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +License applicable only to the org.arabidopsis.ahocorasick package: + + +Copyright (c) 2005, 2008 Danny Yoo +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + + * Neither the name of the Carnegie Institution of Washington nor +the names of its contributors may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/main/resources/be/abeel/bioinformatics/dnaproperties/ConversionMap.java b/src/main/resources/be/abeel/bioinformatics/dnaproperties/ConversionMap.java new file mode 100644 index 0000000..802975d --- /dev/null +++ b/src/main/resources/be/abeel/bioinformatics/dnaproperties/ConversionMap.java @@ -0,0 +1,131 @@ +/** + * %HEADER% + */ +package be.abeel.bioinformatics.dnaproperties; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.HashMap; + +/** + * A conversion map can be used to convert n-nucleotides into numerical values. + * These conversion tables can be constructed from files in a very simple + * format. On each line there should be a n-nucleotide with its corresponding + * values seperated by a tab character. + * + * @author Thomas Abeel + * + */ +final class ConversionMap extends HashMap { + + private static final long serialVersionUID = 6218177437128101213L; + + private double defaultValue = 0; + + private int length = 0; + + private ConversionMap() { + }; + + static byte[] lowercase(byte[] bytes) { + for (int i = 0; i < bytes.length; i++) { + switch (bytes[i]) { + case (byte) 'A': + bytes[i] = (byte) 'a'; + break; + case (byte) 'T': + bytes[i] = (byte) 't'; + break; + case (byte) 'C': + bytes[i] = (byte) 'c'; + break; + case (byte) 'G': + bytes[i] = (byte) 'g'; + break; + } + } + return bytes; + } + + static int translate(byte... seq) { + int out = 0; + for (byte b : seq) { + + out *= 255; + out += b; + } + return out; + } + + static ConversionMap create(String file) { + ConversionMap out = new ConversionMap(); + URL url = ConversionMap.class.getResource(file); + try { + BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); + String line = in.readLine(); + while (line != null) { + if (line.length() > 0) { + String[] arr = line.split("\t"); + try { + double value = Double.parseDouble(arr[1]); + out.put(translate(lowercase(arr[0].getBytes())), value); + out.defaultValue += value; + out.length = arr[0].length(); + } catch (NumberFormatException e) { + throw new RuntimeException("Something is wrong with in conversion file: " + e); + } + } + line = in.readLine(); + } + in.close(); + out.defaultValue /= Math.pow(4, out.length); + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("Their was an error while reading the conversion map: " + e); + } + return out; + } + + @Override + public Double get(Object key) { + Double value = super.get((Integer) key); + if (value != null) + return value; + else + return defaultValue; + } + + /** + * Gives the length of n-nucleotide that can be converted with this + * conversion map. For example, if there are values available for + * dinucleotides, this method would return 2. + * + * @return the length of n-nucleotides that can be converted + */ + int length() { + return length; + } + + void normalize() { + // System.out.println("Normalizing map..."); + double upperBound = 1; + double lowerBound = -1; + double max = Double.MIN_VALUE; + double min = Double.MAX_VALUE; + for (Double d : super.values()) { + if (d > max) + max = d; + if (d < min) + min = d; + } + + for (Integer s : super.keySet()) { + Double d = super.get(s); + Double tmp = (d - min) / (max - min) * (upperBound - lowerBound) + lowerBound; + // System.out.println("\t"+s+"\t"+d+"\t"+tmp); + super.put(s, tmp); + } + defaultValue = (defaultValue - min) / (max - min) * (upperBound - lowerBound) + lowerBound; + } +} diff --git a/src/main/resources/be/abeel/bioinformatics/dnaproperties/DNAProperty.java b/src/main/resources/be/abeel/bioinformatics/dnaproperties/DNAProperty.java new file mode 100644 index 0000000..a11bef3 --- /dev/null +++ b/src/main/resources/be/abeel/bioinformatics/dnaproperties/DNAProperty.java @@ -0,0 +1,182 @@ +/** + * %HEADER% + */ +package be.abeel.bioinformatics.dnaproperties; + +import java.lang.reflect.Field; +import java.util.Vector; + +/** + * A interface that represents a property of the DNA that can be calculated from + * the sequence. Typically these properties are stored as a simple conversation + * tables which allow to convert each nucleotide, di-, tri- and so on + * n-nucleotide to a numberical value. Althoug more complex models are also + * possible + * + * @author Thomas Abeel + * + */ +public abstract class DNAProperty { + + public static final DNAProperty ATG = new ConversionMapDNAProperty("ATG-density"); + + public static final DNAProperty G = new ConversionMapDNAProperty("G-content"); + + public static final DNAProperty C = new ConversionMapDNAProperty("C-content"); + + public static final DNAProperty T = new ConversionMapDNAProperty("T-content"); + + public static final DNAProperty A = new ConversionMapDNAProperty("A-content"); + + public static final DNAProperty AT = new ConversionMapDNAProperty("AT-content"); + + public static final DNAProperty GC = new ConversionMapDNAProperty("GC-content"); + + public static final DNAProperty Pyrimidine = new ConversionMapDNAProperty("Pyrimidine-content"); + + public static final DNAProperty Purine = new ConversionMapDNAProperty("Purine-content"); + + public static final DNAProperty Bendability = new ConversionMapDNAProperty("Bendability"); + + public static final DNAProperty zDNA = new ConversionMapDNAProperty("zDNA"); + + public static final DNAProperty DuplexStabilityFreeEnergy = new ConversionMapDNAProperty( + "DuplexStabilityFreeEnergy"); + + public static final DNAProperty DuplexStabilityDisruptEnergy = new ConversionMapDNAProperty( + "DuplexStabilityDisruptEnergy"); + + public static final DNAProperty DNADenaturation = new ConversionMapDNAProperty("DNADenaturation"); + + public static final DNAProperty PropellorTwist = new ConversionMapDNAProperty("PropellorTwist"); + + public static final DNAProperty BaseStacking = new ConversionMapDNAProperty("BaseStacking"); + + public static final DNAProperty ProteinDeformation = new ConversionMapDNAProperty("ProteinDeformation"); + + public static final DNAProperty BendingStiffness = new ConversionMapDNAProperty("BendingStiffness"); + + public static final DNAProperty ProteinDNATwist = new ConversionMapDNAProperty("ProteinDNATwist"); + + public static final DNAProperty bDNATwist = new ConversionMapDNAProperty("bDNATwist"); + + public static final DNAProperty APhilicity = new ConversionMapDNAProperty("APhilicity"); + + public static final DNAProperty NucleosomePosition = new ConversionMapDNAProperty("NucleosomePosition"); + + public static final DNAProperty DimerRadicalCleavageIntensity = new RadicalCleavageIntensity(2); + + public static final DNAProperty TrimerRadicalCleavageIntensity = new RadicalCleavageIntensity(3); + + public static final DNAProperty TetramerRadicalCleavageIntensity = new RadicalCleavageIntensity(4); + + public static final DNAProperty PentamerRadicalCleavageIntensity = new RadicalCleavageIntensity(5); + + public static final DNAProperty Twist = new ConversionMapDNAProperty("Twist"); + + public static final DNAProperty Tilt = new ConversionMapDNAProperty("Tilt"); + + public static final DNAProperty Roll = new ConversionMapDNAProperty("Roll"); + + public static final DNAProperty Shift = new ConversionMapDNAProperty("Shift"); + + public static final DNAProperty Slide = new ConversionMapDNAProperty("Slide"); + + public static final DNAProperty Rise = new ConversionMapDNAProperty("Rise"); + + protected DNAProperty(String name) { + this.name = name; + } + + private String name = null; + + /** + * This method will return the average value of the structural feature over + * the sequence given as parameter. + * + * @param sequence + * the sequence for which to calculate the average. + * @return the average structural value + */ + public abstract double value(String seq); + + /** + * This method will return the average value of the normalized structural + * feature over the sequence given as parameter. + * + * @param sequence + * the sequence for which to calculate the average. + * @return the average structural value + */ + public abstract double normalizedValue(String seq); + + /** + * Return the profile for the sequence given as a parameter. + * + * @param sequence + * the sequence for which to calculate the structural profile. + * @return the profile of the sequence + */ + public abstract double[] profile(String seq); + + /** + * Return the normalized profile for the sequence given as a parameter. + * + * @param sequence + * the sequence for which to calculate the structural profile. + * @return the profile of the sequence + */ + public abstract double[] normalizedProfile(String seq); + + public abstract int length(); + + @Override + public String toString() { + return name; + } + + public static DNAProperty[] values() { + Field[] arr = DNAProperty.class.getFields(); + Vector props = new Vector(); + for (Field f : arr) { + if (f.getType().equals(DNAProperty.class)) { + // System.out.println(f.getName()); + try { + DNAProperty pp = (DNAProperty) f.get(null); + props.add(pp); + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + DNAProperty[] out = new DNAProperty[props.size()]; + props.toArray(out); + return out; + } + + public static DNAProperty create(String name) { + Field[] arr = DNAProperty.class.getFields(); + for (Field f : arr) { + if (f.getType().equals(DNAProperty.class)) { + // System.out.println(f.getName()); + try { + DNAProperty pp = (DNAProperty) f.get(null); + if (pp.toString().equalsIgnoreCase(name) || f.getName().equalsIgnoreCase(name)) + return pp; + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + return null; + } + +} diff --git a/src/be/abeel/bioinformatics/dnaproperties/a-content.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/a-content.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/a-content.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/a-content.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/aphilicity.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/aphilicity.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/aphilicity.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/aphilicity.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/at-content.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/at-content.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/at-content.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/at-content.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/atg-density.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/atg-density.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/atg-density.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/atg-density.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/basestacking.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/basestacking.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/basestacking.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/basestacking.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/bdnatwist.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/bdnatwist.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/bdnatwist.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/bdnatwist.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/bendability.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/bendability.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/bendability.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/bendability.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/bendingstiffness.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/bendingstiffness.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/bendingstiffness.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/bendingstiffness.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/c-content.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/c-content.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/c-content.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/c-content.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/dnadenaturation.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/dnadenaturation.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/dnadenaturation.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/dnadenaturation.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/duplexstabilitydisruptenergy.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/duplexstabilitydisruptenergy.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/duplexstabilitydisruptenergy.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/duplexstabilitydisruptenergy.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/duplexstabilityfreeenergy.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/duplexstabilityfreeenergy.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/duplexstabilityfreeenergy.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/duplexstabilityfreeenergy.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/g-content.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/g-content.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/g-content.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/g-content.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/gc-content.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/gc-content.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/gc-content.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/gc-content.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/nucleosomeposition.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/nucleosomeposition.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/nucleosomeposition.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/nucleosomeposition.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/propellortwist.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/propellortwist.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/propellortwist.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/propellortwist.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/proteindeformation.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/proteindeformation.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/proteindeformation.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/proteindeformation.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/proteindnatwist.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/proteindnatwist.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/proteindnatwist.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/proteindnatwist.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/purine-content.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/purine-content.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/purine-content.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/purine-content.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/pyrimidine-content.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/pyrimidine-content.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/pyrimidine-content.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/pyrimidine-content.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/rci2.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/rci2.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/rci2.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/rci2.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/rci3.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/rci3.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/rci3.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/rci3.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/rci4.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/rci4.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/rci4.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/rci4.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/rci5.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/rci5.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/rci5.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/rci5.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/rise.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/rise.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/rise.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/rise.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/roll.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/roll.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/roll.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/roll.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/shift.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/shift.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/shift.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/shift.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/slide.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/slide.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/slide.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/slide.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/t-content.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/t-content.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/t-content.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/t-content.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/tilt.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/tilt.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/tilt.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/tilt.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/twist.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/twist.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/twist.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/twist.tsv diff --git a/src/be/abeel/bioinformatics/dnaproperties/zdna.tsv b/src/main/resources/be/abeel/bioinformatics/dnaproperties/zdna.tsv similarity index 100% rename from src/be/abeel/bioinformatics/dnaproperties/zdna.tsv rename to src/main/resources/be/abeel/bioinformatics/dnaproperties/zdna.tsv diff --git a/resources/venn/venn2a.svg b/src/main/resources/venn/venn2a.svg similarity index 100% rename from resources/venn/venn2a.svg rename to src/main/resources/venn/venn2a.svg diff --git a/resources/venn/venn2b.svg b/src/main/resources/venn/venn2b.svg similarity index 100% rename from resources/venn/venn2b.svg rename to src/main/resources/venn/venn2b.svg diff --git a/resources/venn/venn3a.svg b/src/main/resources/venn/venn3a.svg similarity index 100% rename from resources/venn/venn3a.svg rename to src/main/resources/venn/venn3a.svg diff --git a/resources/venn/venn3b.svg b/src/main/resources/venn/venn3b.svg similarity index 100% rename from resources/venn/venn3b.svg rename to src/main/resources/venn/venn3b.svg diff --git a/resources/venn/venn4a.svg b/src/main/resources/venn/venn4a.svg similarity index 100% rename from resources/venn/venn4a.svg rename to src/main/resources/venn/venn4a.svg diff --git a/resources/venn/venn4b.svg b/src/main/resources/venn/venn4b.svg similarity index 100% rename from resources/venn/venn4b.svg rename to src/main/resources/venn/venn4b.svg diff --git a/resources/venn/venn5a.svg b/src/main/resources/venn/venn5a.svg similarity index 100% rename from resources/venn/venn5a.svg rename to src/main/resources/venn/venn5a.svg diff --git a/resources/venn/venn5b.svg b/src/main/resources/venn/venn5b.svg similarity index 100% rename from resources/venn/venn5b.svg rename to src/main/resources/venn/venn5b.svg diff --git a/src/atk/collection/Intersperse.scala b/src/main/scala/atk/collection/Intersperse.scala similarity index 100% rename from src/atk/collection/Intersperse.scala rename to src/main/scala/atk/collection/Intersperse.scala diff --git a/src/atk/compbio/DNAHash.scala b/src/main/scala/atk/compbio/DNAHash.scala similarity index 96% rename from src/atk/compbio/DNAHash.scala rename to src/main/scala/atk/compbio/DNAHash.scala index 9631327..dcc155d 100644 --- a/src/atk/compbio/DNAHash.scala +++ b/src/main/scala/atk/compbio/DNAHash.scala @@ -2,7 +2,7 @@ package atk.compbio object DNAHash { - def main(args: Array[String]) { + def main(args: Array[String]):Unit = { hash("ACGGTGCGA") hash("AACGGTGCGA") diff --git a/src/atk/compbio/DNAString.scala b/src/main/scala/atk/compbio/DNAString.scala similarity index 96% rename from src/atk/compbio/DNAString.scala rename to src/main/scala/atk/compbio/DNAString.scala index 88e6201..bb6cec7 100644 --- a/src/atk/compbio/DNAString.scala +++ b/src/main/scala/atk/compbio/DNAString.scala @@ -7,7 +7,7 @@ package atk.compbio */ class DNAString(str: String) { - def this(arr:Array[Byte]){ + def this(arr:Array[Byte]) = { this(new String(arr)) } @@ -76,7 +76,7 @@ class DNAString(str: String) { } /* Zero based setter for the sequence */ - private def set(pos: Int, c: Char) { + private def set(pos: Int, c: Char):Unit= { var coded = encode(c); var mask = 15 if (pos % 2 == 1) { diff --git a/src/atk/compbio/fastq/FastAFile.scala b/src/main/scala/atk/compbio/fastq/FastAFile.scala similarity index 100% rename from src/atk/compbio/fastq/FastAFile.scala rename to src/main/scala/atk/compbio/fastq/FastAFile.scala diff --git a/src/atk/compbio/fastq/FastQFile.scala b/src/main/scala/atk/compbio/fastq/FastQFile.scala similarity index 100% rename from src/atk/compbio/fastq/FastQFile.scala rename to src/main/scala/atk/compbio/fastq/FastQFile.scala diff --git a/src/atk/compbio/gff/GFFFile.scala b/src/main/scala/atk/compbio/gff/GFFFile.scala similarity index 100% rename from src/atk/compbio/gff/GFFFile.scala rename to src/main/scala/atk/compbio/gff/GFFFile.scala diff --git a/src/atk/compbio/gff/GFFLine.scala b/src/main/scala/atk/compbio/gff/GFFLine.scala similarity index 100% rename from src/atk/compbio/gff/GFFLine.scala rename to src/main/scala/atk/compbio/gff/GFFLine.scala diff --git a/bsd/src/atk/compbio/tree/TreeTools.scala b/src/main/scala/atk/compbio/tree/TreeTools.scala similarity index 100% rename from bsd/src/atk/compbio/tree/TreeTools.scala rename to src/main/scala/atk/compbio/tree/TreeTools.scala diff --git a/src/atk/compbio/vcf/Mutation.scala b/src/main/scala/atk/compbio/vcf/Mutation.scala similarity index 77% rename from src/atk/compbio/vcf/Mutation.scala rename to src/main/scala/atk/compbio/vcf/Mutation.scala index 8bb189f..d945734 100644 --- a/src/atk/compbio/vcf/Mutation.scala +++ b/src/main/scala/atk/compbio/vcf/Mutation.scala @@ -8,7 +8,7 @@ class Mutation(line: String) extends VCFLine(line) { def this(vcf:VCFLine)=this(vcf.line) lazy val identifier: String = { - variation + "." + pos + "." + ref+"."+alt + "" + variation + "." + pos + "." + ref + "." + alt } diff --git a/src/atk/compbio/vcf/VCFFile.scala b/src/main/scala/atk/compbio/vcf/VCFFile.scala similarity index 100% rename from src/atk/compbio/vcf/VCFFile.scala rename to src/main/scala/atk/compbio/vcf/VCFFile.scala diff --git a/src/atk/compbio/vcf/VCFLine.scala b/src/main/scala/atk/compbio/vcf/VCFLine.scala similarity index 100% rename from src/atk/compbio/vcf/VCFLine.scala rename to src/main/scala/atk/compbio/vcf/VCFLine.scala diff --git a/src/atk/io/NixWriter.scala b/src/main/scala/atk/io/NixWriter.scala similarity index 86% rename from src/atk/io/NixWriter.scala rename to src/main/scala/atk/io/NixWriter.scala index b1d3ed6..67f69f4 100644 --- a/src/atk/io/NixWriter.scala +++ b/src/main/scala/atk/io/NixWriter.scala @@ -14,11 +14,11 @@ class NixWriter(f: String,config:AnyRef=null,noheader:Boolean=false) extends Pri if(!noheader) println(generatorInfo(config)) - override def println(str: String) { + override def println(str: String): Unit= { print(str + "\n") } - override def close(){ + override def close(): Unit = { if(!noheader) println("## This analysis finished " + LocalDateTime.now()) super.close diff --git a/src/atk/io/URLCache.scala b/src/main/scala/atk/io/URLCache.scala similarity index 97% rename from src/atk/io/URLCache.scala rename to src/main/scala/atk/io/URLCache.scala index 88826eb..229ddeb 100644 --- a/src/atk/io/URLCache.scala +++ b/src/main/scala/atk/io/URLCache.scala @@ -34,7 +34,7 @@ object URLCache { private var lastQuery: Long = 0 - def age(url: String, encoding: String = "ISO-8859-1", aging: Long) { + def age(url: String, encoding: String = "ISO-8859-1", aging: Long):Unit= { val hash = md5key(url, encoding) val cached = new File(".url-cache/" + hash + ".blob") @@ -44,7 +44,7 @@ object URLCache { } } - def delete(urlKey:String, encoding: String = "ISO-8859-1"){ + def delete(urlKey:String, encoding: String = "ISO-8859-1"): Unit= { val hash = md5key(urlKey, encoding) val cached = new File(".url-cache/" + hash + ".blob") cached.delete() @@ -130,7 +130,7 @@ object URLCache { private class DefaultTrustManager extends X509TrustManager { override def checkClientTrusted(arg0: Array[X509Certificate], arg1: String) = {} - override def checkServerTrusted(arg0: Array[X509Certificate], arg1: String) {} + override def checkServerTrusted(arg0: Array[X509Certificate], arg1: String) = {} override def getAcceptedIssuers(): Array[X509Certificate] = null } diff --git a/tools/src/atk/tools/ATKConsole.scala b/src/main/scala/atk/tools/ATKConsole.scala similarity index 87% rename from tools/src/atk/tools/ATKConsole.scala rename to src/main/scala/atk/tools/ATKConsole.scala index 5ddcdf4..1a9752a 100644 --- a/tools/src/atk/tools/ATKConsole.scala +++ b/src/main/scala/atk/tools/ATKConsole.scala @@ -6,24 +6,24 @@ object ATKConsole { if (args.length == 0) { - listInstructions + listInstructions() } else { args(0) match { - case "list" => listInstructions - case "help" => listInstructions + case "list" => listInstructions() + case "help" => listInstructions() case "histogram" => Histogram.main(args.drop(1)) case "string-replace" =>StringReplace.main(args.drop(1)) case "fisher-list"=>FisherList.main(args.drop(1)) case "scatter" => Scatter.main(args.drop(1)) case "scatter-xy" =>ScatterXY.main(args.drop(1)) case "zscore" => ZscoreNormalize.main(args.drop(1)) - case _ => listInstructions + case _ => listInstructions() } } } - def listInstructions() { + def listInstructions():Unit = { println("Usage:java -jar atk.jar [instruction] [instruction options...]") println("Instructions:") println("\thistogram Create a histogram plot from data in file") diff --git a/gpl/src/atk/tools/FisherList.scala b/src/main/scala/atk/tools/FisherList.scala similarity index 85% rename from gpl/src/atk/tools/FisherList.scala rename to src/main/scala/atk/tools/FisherList.scala index 6f218bc..3827bf0 100644 --- a/gpl/src/atk/tools/FisherList.scala +++ b/src/main/scala/atk/tools/FisherList.scala @@ -12,8 +12,8 @@ object FisherList extends Tool{ def main(args: Array[String]): Unit = { val parser = new scopt.OptionParser[Config]("java -jar atk.jar fisher-list") { - opt[File]('i', "input") required () action { (x, c) => c.copy(input = x) } text ("Input file. ") - opt[File]('o', "output") action { (x, c) => c.copy(output = x) } text ("Output file") + opt[File]('i', "input").required().action{ (x, c) => c.copy(input = x) }.text("Input file. ") + opt[File]('o', "output").action{ (x, c) => c.copy(output = x) }.text("Output file") } parser.parse(args, Config()) map { config => @@ -22,7 +22,7 @@ object FisherList extends Tool{ } } - def fishlist(config: Config) { + def fishlist(config: Config): Unit = { //Takes a list of triplets consisting of a label and a pair of values and checks whether it's different from the population of all pairs. @@ -50,13 +50,13 @@ object FisherList extends Tool{ val sum2=triplets.map(_._2._2).sum val pw=new PrintWriter(config.output) - pw.println(generatorInfo) + pw.println(generatorInfo()) pw.println("##") pw.println("## label\tX\tY\tn11\tn12\tn21\tn22\tbonferroni(p)") pw.println("##") for((label,(x,y))<-triplets){ - val n11=x - val n12=y + val n11=x + val n12=y val n21=sum1-x val n22=sum2-y val p=FishersExactTest.fishersExactTest(n11, n12, n21, n22)(0) diff --git a/tools/src/atk/tools/Histogram.scala b/src/main/scala/atk/tools/Histogram.scala similarity index 78% rename from tools/src/atk/tools/Histogram.scala rename to src/main/scala/atk/tools/Histogram.scala index 841cac5..b3522db 100644 --- a/tools/src/atk/tools/Histogram.scala +++ b/src/main/scala/atk/tools/Histogram.scala @@ -27,15 +27,15 @@ object Histogram extends Tool { def main(args: Array[String]): Unit = { val parser = new scopt.OptionParser[HistogramConfig]("java -jar atk.jar histogram") { - opt[File]('i', "input") required () action { (x, c) => c.copy(input = x) } text ("Input data") - opt[String]('o', "output") action { (x, c) => c.copy(outputPrefix = x) } text ("Output prefix") - opt[String]('x', "x-label") action { (x, c) => c.copy(x = x) } text ("X-axis label") - opt[String]('y', "y-label") action { (x, c) => c.copy(y = x) } text ("Y-axis label") - opt[Int]('c', "column") action { (x, c) => c.copy(column = x) } text ("Column from which to extract values. Default = 0") - opt[Int]("stdev-limit") action { (x, c) => c.copy(limit = x) } text ("Maximum standard devitations on domain. Default = unlimited") - opt[Unit]("log") action { (x, c) => c.copy(log = true) } text ("Take log of values. Default = false") - opt[Unit]("tabulated") action { (x, c) => c.copy(tab = true) } text ("Export tab-delimited file with data in histogram") - opt[Unit]("no-bin") action { (x, c) => c.copy(nobin = true) } text ("Do not automagically bin data") + opt[File]('i', "input").required().action { (x, c) => c.copy(input = x) }.text ("Input data") + opt[String]('o', "output").action{ (x, c) => c.copy(outputPrefix = x) }.text ("Output prefix") + opt[String]('x', "x-label").action{ (x, c) => c.copy(x = x) }.text ("X-axis label") + opt[String]('y', "y-label").action{ (x, c) => c.copy(y = x) }.text ("Y-axis label") + opt[Int]('c', "column").action { (x, c) => c.copy(column = x) }.text ("Column from which to extract values. Default = 0") + opt[Int]("stdev-limit").action { (x, c) => c.copy(limit = x) }.text ("Maximum standard devitations on domain. Default = unlimited") + opt[Unit]("log").action { (x, c) => c.copy(log = true) }.text ("Take log of values. Default = false") + opt[Unit]("tabulated").action { (x, c) => c.copy(tab = true) }.text ("Export tab-delimited file with data in histogram") + opt[Unit]("no-bin").action { (x, c) => c.copy(nobin = true) }.text ("Do not automagically bin data") } parser.parse(args, HistogramConfig()) map { config => @@ -44,7 +44,7 @@ object Histogram extends Tool { } } - private def histo(config: HistogramConfig) { + private def histo(config: HistogramConfig): Unit = { assume(config.input.exists(), "Input file does not exist: " + config.input) val values = tLines(config.input).map { f => val v = f.split("\t")(config.column).toDouble @@ -90,13 +90,16 @@ object Histogram extends Tool { println("h: " + h) val range = h println("range= " + range) - val binned = cleanData.groupBy(g => (g / range).toInt).mapValues(_.size).map(f => (f._1 * range, f._2.toDouble / cleanData.size)) + val binned:Map[Double,Double] = cleanData.groupBy(g => (g / range).toInt) + .map{ case (k,v) => ( k*range, v.size.toDouble / cleanData.size) } + // mapValues is lazy and does not return the correct type. + //.mapValues(_.size).map(f => (f._1 * range, f._2.toDouble / cleanData.size)) binned } - def plot(values: List[Double], config: HistogramConfig) { + def plot(values: List[Double], config: HistogramConfig): Unit = { val input = if (config.nobin) { values.groupBy { identity }.mapValues(_.size.toDouble) } else { diff --git a/tools/src/atk/tools/Scatter.scala b/src/main/scala/atk/tools/Scatter.scala similarity index 63% rename from tools/src/atk/tools/Scatter.scala rename to src/main/scala/atk/tools/Scatter.scala index 562e2eb..ed139ae 100644 --- a/tools/src/atk/tools/Scatter.scala +++ b/src/main/scala/atk/tools/Scatter.scala @@ -30,15 +30,15 @@ object Scatter extends Tool with ScatterTrait { val parser = new scopt.OptionParser[Config]("java -jar atk.jar scatter") { val default = new Config() - opt[File]('i', "input") required () action { (x, c) => c.copy(input = x) } text ("Input data. This should be a two column file with numberic values.") - opt[File]('o', "output") action { (x, c) => c.copy(output = x) } text ("Output file") - opt[String]('x', "x-label") action { (x, c) => c.copy(x = x) } text ("X-axis label") - opt[String]('y', "y-label") action { (x, c) => c.copy(y = x) } text ("Y-axis label") - opt[Double]("x-min") action { (x, c) => c.copy(minX = x) } text ("Minimum value to display on the X-axis") - opt[Double]("y-min") action { (x, c) => c.copy(minY = x) } text ("Minimum value to display on the Y-axis") - opt[Double]("x-max") action { (x, c) => c.copy(maxX = x) } text ("Maximum value to display on the X-axis") - opt[Double]("y-max") action { (x, c) => c.copy(maxY = x) } text ("Maximum value to display on the Y-axis") - opt[Unit]("log") action { (x, c) => c.copy(log = true) } text ("Take log of values. Default = " + default.log) + opt[File]('i', "input").required().action { (x, c) => c.copy(input = x) }.text ("Input data. This should be a two column file with numberic values.") + opt[File]('o', "output").action { (x, c) => c.copy(output = x) }.text ("Output file") + opt[String]('x', "x-label").action { (x, c) => c.copy(x = x) }.text ("X-axis label") + opt[String]('y', "y-label").action { (x, c) => c.copy(y = x) }.text ("Y-axis label") + opt[Double]("x-min").action { (x, c) => c.copy(minX = x) }.text ("Minimum value to display on the X-axis") + opt[Double]("y-min").action { (x, c) => c.copy(minY = x) }.text ("Minimum value to display on the Y-axis") + opt[Double]("x-max").action { (x, c) => c.copy(maxX = x) }.text ("Maximum value to display on the X-axis") + opt[Double]("y-max").action { (x, c) => c.copy(maxY = x) }.text ("Maximum value to display on the Y-axis") + opt[Unit]("log").action { (x, c) => c.copy(log = true) }.text ("Take log of values. Default = " + default.log) } parser.parse(args, Config()) map { config => @@ -47,7 +47,7 @@ object Scatter extends Tool with ScatterTrait { } } - private def scatter(config: Config) { + private def scatter(config: Config): Unit = { val data = tColumns(List(0, 1), tLines(config.input)).map { list => list(0).toDouble -> list(1).toDouble } diff --git a/tools/src/atk/tools/ScatterTrait.scala b/src/main/scala/atk/tools/ScatterTrait.scala similarity index 99% rename from tools/src/atk/tools/ScatterTrait.scala rename to src/main/scala/atk/tools/ScatterTrait.scala index 3bb74b3..404abdd 100644 --- a/tools/src/atk/tools/ScatterTrait.scala +++ b/src/main/scala/atk/tools/ScatterTrait.scala @@ -15,7 +15,7 @@ import be.abeel.jfreechart.JFreeChartWrapper import org.jfree.chart.plot.PlotOrientation trait ScatterTrait { - def scatterPlot(data: List[(Double, Double)], xLabel: String, yLabel: String, output: String, minX:Double=Double.MinValue, maxX:Double=Double.MaxValue, minY:Double=Double.MinValue, maxY:Double=Double.MaxValue) { + def scatterPlot(data: List[(Double, Double)], xLabel: String, yLabel: String, output: String, minX:Double=Double.MinValue, maxX:Double=Double.MaxValue, minY:Double=Double.MinValue, maxY:Double=Double.MaxValue): Unit = { val arr = Array.ofDim[Array[Double]](2) arr(0) = Array.ofDim(data.size) diff --git a/tools/src/atk/tools/ScatterXY.scala b/src/main/scala/atk/tools/ScatterXY.scala similarity index 70% rename from tools/src/atk/tools/ScatterXY.scala rename to src/main/scala/atk/tools/ScatterXY.scala index c3daab5..a24a98b 100644 --- a/tools/src/atk/tools/ScatterXY.scala +++ b/src/main/scala/atk/tools/ScatterXY.scala @@ -30,15 +30,15 @@ object ScatterXY extends Tool with ScatterTrait{ val parser = new scopt.OptionParser[Config]("java -jar atk.jar scatter-XY") { val default = new Config() - opt[File]('x', "x-input") required () action { (x, c) => c.copy(inputX = x) } text ("Input data X, keys must match Y") - opt[File]('y', "y-input") required () action { (x, c) => c.copy(inputY = x) } text ("Input data Y, keys must match X") - opt[File]('o', "output") action { (x, c) => c.copy(output = x) } text ("Output file") - opt[String]("x-label") action { (x, c) => c.copy(x = x) } text ("X-axis label") - opt[String]("y-label") action { (x, c) => c.copy(y = x) } text ("Y-axis label") - opt[Int]("value-column") action { (x, c) => c.copy(valueColumn = x) } text ("Column from which to extract values. Default = " + default.valueColumn) - opt[Int]("key-column") action { (x, c) => c.copy(keyColumn = x) } text ("Column from which to extract keys. Default = " + default.keyColumn) - opt[Double]("missing-value") action { (x, c) => c.copy(missing = x) } text ("Value to use for missing entries. Default = " + default.missing) - opt[Unit]("log") action { (x, c) => c.copy(log = true) } text ("Take log of values. Default = " + default.log) + opt[File]('x', "x-input").required ().action { (x, c) => c.copy(inputX = x) }.text ("Input data X, keys must match Y") + opt[File]('y', "y-input").required ().action { (x, c) => c.copy(inputY = x) }.text ("Input data Y, keys must match X") + opt[File]('o', "output").action { (x, c) => c.copy(output = x) }.text ("Output file") + opt[String]("x-label").action { (x, c) => c.copy(x = x) }.text ("X-axis label") + opt[String]("y-label").action { (x, c) => c.copy(y = x) }.text ("Y-axis label") + opt[Int]("value-column").action { (x, c) => c.copy(valueColumn = x) }.text ("Column from which to extract values. Default = " + default.valueColumn) + opt[Int]("key-column").action { (x, c) => c.copy(keyColumn = x) }.text ("Column from which to extract keys. Default = " + default.keyColumn) + opt[Double]("missing-value").action { (x, c) => c.copy(missing = x) }.text ("Value to use for missing entries. Default = " + default.missing) + opt[Unit]("log"). action { (x, c) => c.copy(log = true) }.text ("Take log of values. Default = " + default.log) } parser.parse(args, Config()) map { config => @@ -47,7 +47,7 @@ object ScatterXY extends Tool with ScatterTrait{ } } - private def scatter(config: Config) { + private def scatter(config: Config): Unit = { assume(config.inputX.exists(), "Input file does not exist: " + config.inputX) assume(config.inputY.exists(), "Input file does not exist: " + config.inputY) diff --git a/tools/src/atk/tools/StringReplace.scala b/src/main/scala/atk/tools/StringReplace.scala similarity index 69% rename from tools/src/atk/tools/StringReplace.scala rename to src/main/scala/atk/tools/StringReplace.scala index 035b4c9..675eceb 100644 --- a/tools/src/atk/tools/StringReplace.scala +++ b/src/main/scala/atk/tools/StringReplace.scala @@ -13,9 +13,9 @@ object StringReplace extends Tool { def main(args: Array[String]): Unit = { val parser = new scopt.OptionParser[Config]("java -jar atk.jar string-replace") { - opt[File]('i', "input") required () action { (x, c) => c.copy(input = x) } text ("Input file") - opt[File]('r', "replace") required () action { (x, c) => c.copy(replace = x) } text ("Replace key value pairs file") - opt[File]('o', "output") required () action { (x, c) => c.copy(output = x) } text ("Output file") + opt[File]('i', "input").required (). action { (x, c) => c.copy(input = x) }.text ("Input file") + opt[File]('r', "replace").required ().action { (x, c) => c.copy(replace = x) }.text ("Replace key value pairs file") + opt[File]('o', "output").required ().action { (x, c) => c.copy(output = x) }.text ("Output file") } parser.parse(args, Config()) map { config => @@ -24,7 +24,7 @@ object StringReplace extends Tool { } } - def replace(config: Config) { + def replace(config: Config): Unit = { val in = Source.fromFile(config.input).getLines.toList.mkString("\n") val replace = tMap(tLines(config.replace),keyColumn=0,valueColumn=1,limitSplit=false) diff --git a/tools/src/atk/tools/ZscoreNormalize.scala b/src/main/scala/atk/tools/ZscoreNormalize.scala similarity index 76% rename from tools/src/atk/tools/ZscoreNormalize.scala rename to src/main/scala/atk/tools/ZscoreNormalize.scala index 74f2c54..9b04202 100644 --- a/tools/src/atk/tools/ZscoreNormalize.scala +++ b/src/main/scala/atk/tools/ZscoreNormalize.scala @@ -15,9 +15,9 @@ object ZscoreNormalize extends Tool { def main(args: Array[String]): Unit = { val parser = new scopt.OptionParser[Config]("java -jar atk.jar zscore") { - opt[File]('i', "input") required () action { (x, c) => c.copy(input = x) } text ("Input data") - opt[File]('o', "output") action { (x, c) => c.copy(output = x) } text ("Output file") - opt[Int]('c', "column") action { (x, c) => c.copy(column = x) } text ("Column from which to extract and replace values with z-scores. Default = " + new Config().column) + opt[File]('i', "input").required().action { (x, c) => c.copy(input = x) }.text ("Input data") + opt[File]('o', "output").action { (x, c) => c.copy(output = x) }.text ("Output file") + opt[Int]('c', "column").action { (x, c) => c.copy(column = x) }.text ("Column from which to extract and replace values with z-scores. Default = " + new Config().column) } parser.parse(args, Config()) map { config => @@ -26,7 +26,7 @@ object ZscoreNormalize extends Tool { } } - private def zscore(config: Config) { + private def zscore(config: Config): Unit= { val summary=new SummaryStatistics diff --git a/src/atk/util/BitSetTools.scala b/src/main/scala/atk/util/BitSetTools.scala similarity index 100% rename from src/atk/util/BitSetTools.scala rename to src/main/scala/atk/util/BitSetTools.scala diff --git a/src/atk/util/ColorPalette.scala b/src/main/scala/atk/util/ColorPalette.scala similarity index 100% rename from src/atk/util/ColorPalette.scala rename to src/main/scala/atk/util/ColorPalette.scala diff --git a/src/atk/util/ColorTools.scala b/src/main/scala/atk/util/ColorTools.scala similarity index 100% rename from src/atk/util/ColorTools.scala rename to src/main/scala/atk/util/ColorTools.scala diff --git a/src/atk/util/Lines.scala b/src/main/scala/atk/util/Lines.scala similarity index 100% rename from src/atk/util/Lines.scala rename to src/main/scala/atk/util/Lines.scala diff --git a/src/atk/util/LoggingTrait.scala b/src/main/scala/atk/util/LoggingTrait.scala similarity index 88% rename from src/atk/util/LoggingTrait.scala rename to src/main/scala/atk/util/LoggingTrait.scala index f52a630..52ff0c7 100644 --- a/src/atk/util/LoggingTrait.scala +++ b/src/main/scala/atk/util/LoggingTrait.scala @@ -7,7 +7,7 @@ trait LoggingTrait { setDebugLevel(Level.INFO) - def setDebugLevel(newLvl: Level) { + def setDebugLevel(newLvl: Level):Unit= { val rootLogger = LogManager.getLogManager().getLogger(""); val handlers = rootLogger.getHandlers(); rootLogger.setLevel(newLvl); diff --git a/src/atk/util/Tool.scala b/src/main/scala/atk/util/Tool.scala similarity index 96% rename from src/atk/util/Tool.scala rename to src/main/scala/atk/util/Tool.scala index cb8543f..af121fa 100644 --- a/src/atk/util/Tool.scala +++ b/src/main/scala/atk/util/Tool.scala @@ -120,7 +120,7 @@ trait Tool extends Lines with LoggingTrait{ def generatorInfo(config: AnyRef = null): String = { "# Generated with " + classInfo() + "\n" + "# Source code in " + classFileName() + "\n" + - "# Binary in " + executeEnvironment + "\n" + + "# Binary in " + executeEnvironment() + "\n" + "# Date " + new Date() + "\n" + "# Working directory " + new File(".").getAbsolutePath() + "\n#\n" + "# Please contact Thomas Abeel for problems or questions:\n#\tt.abeel@tudelft.nl\n#\n" + diff --git a/src/atk/util/URLTools.scala b/src/main/scala/atk/util/URLTools.scala similarity index 100% rename from src/atk/util/URLTools.scala rename to src/main/scala/atk/util/URLTools.scala diff --git a/src/scopt/OptionParser.scala b/src/main/scala/scopt/OptionParser.scala similarity index 99% rename from src/scopt/OptionParser.scala rename to src/main/scala/scopt/OptionParser.scala index 473abaa..e0809ad 100644 --- a/src/scopt/OptionParser.scala +++ b/src/main/scala/scopt/OptionParser.scala @@ -83,7 +83,7 @@ object Read { // reads("1,2,3,4,5") == Seq(1,2,3,4,5) implicit def seqRead[A: Read]: Read[Seq[A]] = reads { (s: String) => - s.split(sep).map(implicitly[Read[A]].reads) + s.split(sep).toList.map(implicitly[Read[A]].reads) } // reads("1=false,2=true") == Map(1 -> false, 2 -> true) @@ -217,7 +217,7 @@ abstract case class OptionParser[C](programName: String) { /** adds an argument invoked by an option without `-` or `--`. * @param name name in the usage text */ - def arg[A: Read](name: String): OptionDef[A, C] = makeDef(Arg, name) required() + def arg[A: Read](name: String): OptionDef[A, C] = makeDef(Arg, name).required() /** adds a command invoked by an option without `-` or `--`. * @param name name of the command @@ -252,7 +252,7 @@ abstract case class OptionParser[C](programName: String) { def checkConfig(f: C => Either[String, Unit]): OptionDef[Unit, C] = makeDef[Unit](Check, "") validateConfig(f) - def showHeader() { + def showHeader(): Unit= { Console.out.println(header) } def header: String = { diff --git a/test/src/atk/TestDNAProperty.java b/src/test/java/atk/TestDNAProperty.java similarity index 100% rename from test/src/atk/TestDNAProperty.java rename to src/test/java/atk/TestDNAProperty.java diff --git a/test/src/atk/TestGZIPPrintWriter.java b/src/test/java/atk/TestGZIPPrintWriter.java similarity index 100% rename from test/src/atk/TestGZIPPrintWriter.java rename to src/test/java/atk/TestGZIPPrintWriter.java diff --git a/test/src/atk/TestGraphics.java b/src/test/java/atk/TestGraphics.java similarity index 100% rename from test/src/atk/TestGraphics.java rename to src/test/java/atk/TestGraphics.java diff --git a/test/src/atk/TestLineIterator.java b/src/test/java/atk/TestLineIterator.java similarity index 61% rename from test/src/atk/TestLineIterator.java rename to src/test/java/atk/TestLineIterator.java index 9459183..2ebfbe6 100644 --- a/test/src/atk/TestLineIterator.java +++ b/src/test/java/atk/TestLineIterator.java @@ -10,19 +10,23 @@ import be.abeel.io.LineIterator; public class TestLineIterator { + private final static String TEXTFILE = "src/test/resources/COPYING"; + private final static String GZTFILE = "src/test/resources/COPYING.gz"; + @Test public void testLineIterator(){ - LineIterator it=new LineIterator("COPYING"); - LineIterator it2=new LineIterator("COPYING.gz"); + LineIterator it=new LineIterator(TEXTFILE); + LineIterator it2=new LineIterator(GZTFILE); while(it.hasNext()){ Assert.assertEquals(it.next(), it2.next()); } } @Test public void testLineIterator2(){ - LineIterator it=new LineIterator("COPYING"); - LineIterator it2=new LineIterator(new File("COPYING.gz")); + LineIterator it=new LineIterator(TEXTFILE); + LineIterator it2=new LineIterator(GZTFILE); + while(it.hasNext()){ Assert.assertEquals(it.next(), it2.next()); } @@ -30,10 +34,10 @@ public void testLineIterator2(){ @Test public void testLineIterator3(){ - LineIterator it=new LineIterator("COPYING"); + LineIterator it=new LineIterator(TEXTFILE); LineIterator it2=null; try { - it2 = new LineIterator(new FileInputStream("COPYING.gz")); + it2 = new LineIterator(new FileInputStream(GZTFILE)); } catch (FileNotFoundException e) { Assert.fail(); } diff --git a/test/src/atk/TestPair.java b/src/test/java/atk/TestPair.java similarity index 100% rename from test/src/atk/TestPair.java rename to src/test/java/atk/TestPair.java diff --git a/test/src/atk/TestTimeInterval.java b/src/test/java/atk/TestTimeInterval.java similarity index 100% rename from test/src/atk/TestTimeInterval.java rename to src/test/java/atk/TestTimeInterval.java diff --git a/tutorial/src/atk/tutorial/ExportJFreeChart.java b/src/test/java/atk/tutorial/ExportJFreeChartTest.java similarity index 89% rename from tutorial/src/atk/tutorial/ExportJFreeChart.java rename to src/test/java/atk/tutorial/ExportJFreeChartTest.java index 77d636a..f4a12dd 100644 --- a/tutorial/src/atk/tutorial/ExportJFreeChart.java +++ b/src/test/java/atk/tutorial/ExportJFreeChartTest.java @@ -8,13 +8,15 @@ import org.jfree.chart.plot.PlotOrientation; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; +import org.junit.Test; import be.abeel.graphics.GraphicsFileExport; import be.abeel.jfreechart.JFreeChartWrapper; -public class ExportJFreeChart { +public class ExportJFreeChartTest { - public static void main(String[] args) { + @Test + public void testMakeChart() { XYSeries ser = new XYSeries("Sample"); ser.add(0, 1); diff --git a/src/test/resources/COPYING b/src/test/resources/COPYING new file mode 100644 index 0000000..0af428c --- /dev/null +++ b/src/test/resources/COPYING @@ -0,0 +1,3 @@ +test line 1 +test another line +test a third line. diff --git a/src/test/resources/COPYING.gz b/src/test/resources/COPYING.gz new file mode 100644 index 0000000..2362e8f Binary files /dev/null and b/src/test/resources/COPYING.gz differ diff --git a/test/test.fastq b/src/test/resources/test.fastq similarity index 100% rename from test/test.fastq rename to src/test/resources/test.fastq diff --git a/test/src/atk/compbio/TestDNAString.scala b/src/test/scala/atk/compbio/TestDNAString.scala similarity index 64% rename from test/src/atk/compbio/TestDNAString.scala rename to src/test/scala/atk/compbio/TestDNAString.scala index 93a52f5..9df44f1 100644 --- a/test/src/atk/compbio/TestDNAString.scala +++ b/src/test/scala/atk/compbio/TestDNAString.scala @@ -1,13 +1,13 @@ package atk.compbio -import org.scalatest.FunSuite -import org.scalatest.Matchers._ +import org.scalatest.funsuite.* +//import org.scalatest.Matchers._ object TestDNAString { } -class TestDNAString extends FunSuite { +class TestDNAString extends AnyFunSuite { val str = "ACTGATCACCAGACTGATCG" val dna = new DNAString(str) test("test string") { @@ -26,8 +26,8 @@ class TestDNAString extends FunSuite { test("test oob") { - an[IndexOutOfBoundsException] should be thrownBy dna.get(-1) - an[IndexOutOfBoundsException] should be thrownBy dna.get(dna.size) + assertThrows[IndexOutOfBoundsException](dna.get(-1)) + assertThrows[IndexOutOfBoundsException](dna.get(dna.size)) } } \ No newline at end of file diff --git a/src/test/scala/atk/compbio/TestFastQ.scala b/src/test/scala/atk/compbio/TestFastQ.scala new file mode 100644 index 0000000..04b108f --- /dev/null +++ b/src/test/scala/atk/compbio/TestFastQ.scala @@ -0,0 +1,22 @@ +package atk.compbio + +//import org.scalatest.Matchers._ +import org.scalatest.funsuite.* + +import atk.compbio.fastq.FastQFile + +object TestFastQ { + +} + +class TestFastQ extends AnyFunSuite { + + test("test fq") { + for (entry <- FastQFile("src/test/resources/test.fastq")) { + println(entry) + } + + FastQFile("src/test/resources/test.fastq").filter(_.name.contains("1")).toList.map(println(_)) + } + +} \ No newline at end of file diff --git a/test/src/atk/io/TestURLCache.scala b/src/test/scala/atk/io/TestURLCache.scala similarity index 89% rename from test/src/atk/io/TestURLCache.scala rename to src/test/scala/atk/io/TestURLCache.scala index 94d7676..e891c63 100644 --- a/test/src/atk/io/TestURLCache.scala +++ b/src/test/scala/atk/io/TestURLCache.scala @@ -1,10 +1,10 @@ package atk.io -import org.scalatest.FunSuite +import org.scalatest.funsuite.* import java.io.PrintWriter object TestURLCache { - def main(args: Array[String]) { + def main(args: Array[String]): Unit = { URLCache.debug=true URLCache.queryWait = 1000 val us = URLCache.query("https://brickset.com/buy/amazon", URLCache.DAY, cookies = "PreferredCountry2=CountryCode=US&CountryName=United States", key = "brickset_US") @@ -13,7 +13,7 @@ object TestURLCache { } } -class TestURLCache extends FunSuite { +class TestURLCache extends AnyFunSuite { test("testCertificateBypass") { println(URLCache.query("https://www.brickwatch.net/de-DE/",bypassCertificates=true)) diff --git a/test/src/atk/util/TestBitSetTools.scala b/src/test/scala/atk/util/TestBitSetTools.scala similarity index 94% rename from test/src/atk/util/TestBitSetTools.scala rename to src/test/scala/atk/util/TestBitSetTools.scala index 6a808d0..a64201a 100644 --- a/test/src/atk/util/TestBitSetTools.scala +++ b/src/test/scala/atk/util/TestBitSetTools.scala @@ -14,14 +14,14 @@ */ package atk.util -import org.scalatest.FunSuite +import org.scalatest.funsuite.* import scala.collection.mutable.BitSet /** * THIS IS NOT A PROPER TEST-CASE --> needs assume statements */ -class TestBitSetTools extends FunSuite { +class TestBitSetTools extends AnyFunSuite { test("testToString") { diff --git a/test/src/atk/util/TestLines.scala b/src/test/scala/atk/util/TestLines.scala similarity index 80% rename from test/src/atk/util/TestLines.scala rename to src/test/scala/atk/util/TestLines.scala index 659eb89..a4b7ea6 100644 --- a/test/src/atk/util/TestLines.scala +++ b/src/test/scala/atk/util/TestLines.scala @@ -1,16 +1,16 @@ package atk.util -import org.scalatest.FunSuite +import org.scalatest.funsuite.* import java.io.PrintWriter import atk.io.NixWriter object TestLines extends Lines { - def main(args: Array[String]) { + def main(args: Array[String]): Unit= { } } -class TestLines extends FunSuite with Lines { +class TestLines extends AnyFunSuite with Lines { test("testReadComment") { val pw = new PrintWriter("tmp.txt") diff --git a/test/src/atk/util/TestTool.scala b/src/test/scala/atk/util/TestTool.scala similarity index 70% rename from test/src/atk/util/TestTool.scala rename to src/test/scala/atk/util/TestTool.scala index 7bffb8a..70867b0 100644 --- a/test/src/atk/util/TestTool.scala +++ b/src/test/scala/atk/util/TestTool.scala @@ -1,17 +1,17 @@ package atk.util -import org.scalatest.FunSuite +import org.scalatest.funsuite.* object TestTool extends Tool { - def main(args: Array[String]) { + def main(args: Array[String]): Unit= { } } -class TestTool extends FunSuite with Tool { +class TestTool extends AnyFunSuite with Tool { test("test time stamp") { - println(timestamp) + println(timestamp()) } test("testLog") { diff --git a/test/src/atk/compbio/TestFastQ.scala b/test/src/atk/compbio/TestFastQ.scala deleted file mode 100644 index 5519b43..0000000 --- a/test/src/atk/compbio/TestFastQ.scala +++ /dev/null @@ -1,21 +0,0 @@ -package atk.compbio - -import org.scalatest.FunSuite -import org.scalatest.Matchers._ -import atk.compbio.fastq.FastQFile - -object TestFastQ { - -} - -class TestFastQ extends FunSuite { - - test("test fq") { - for (entry <- FastQFile("test/test.fastq")) { - println(entry) - } - - FastQFile("test/test.fastq").filter(_.name.contains("1")).toList.map(println(_)) - } - -} \ No newline at end of file