Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
7f8ea80
Add speciman and data
raviautar May 4, 2016
c880f04
Add getter, setters for specimen
raviautar May 4, 2016
57c4d37
Added specimen parser
raviautar May 5, 2016
a349ed8
Merging to get latest updates on phyloparser
raviautar May 5, 2016
6cd6054
Progress on parser
raviautar May 5, 2016
7a70c3a
Removed bug causing build failure
raviautar May 5, 2016
9b6caea
Parsing primary info of specimen
raviautar May 6, 2016
6fb3a2e
Created completed methods for parser metadata
raviautar May 6, 2016
579900f
Add the corresponding genomes to the segments
smesseim May 6, 2016
247e92c
fix bug not adding specimen in specimen map
raviautar May 6, 2016
18f3efc
Added metadata parser javadoc
raviautar May 6, 2016
c928d97
Completed java doc for metadata parser and fixed bug with parsing age…
raviautar May 6, 2016
230a14c
Commit to reopen pull request
raviautar May 6, 2016
219ae79
Cleaned up javadoc in Specimen class to make a bit more clear
raviautar May 7, 2016
9bca406
Added parent methods to the data interface
raviautar May 7, 2016
c6b9c54
Changed name of Data interface and abstracted over it in the Parser
raviautar May 7, 2016
ec1b64c
Merge pull request #45 from ProgrammingLife2016/feature/metadataparser
raviautar May 7, 2016
32715b4
Intuitive zooming on graph
May 7, 2016
83537cb
Fixed mouse leave document bug
May 7, 2016
d57baf3
Cleaned up parser package
raviautar May 7, 2016
d4817de
Renamed segments package
raviautar May 7, 2016
34a3f24
Changed zoom on scroll function
May 7, 2016
044d080
Cleaned up metadata for dublicates
raviautar May 8, 2016
5526041
Removed bugs in metadataparser caused by new format of csv file
raviautar May 8, 2016
42e4ac8
PhyloGeneticTreeParser tests
SamuelSital May 8, 2016
ba4f23a
Merge pull request #46 from ProgrammingLife2016/feature/cleanparser
SamuelSital May 8, 2016
6dbd4b3
Temporary fix PhyloGenticTreeParser
SamuelSital May 9, 2016
c5de311
Print status of data loading
smesseim May 9, 2016
0b352fe
Fix checkstyle
smesseim May 9, 2016
1fd7ca4
Refactor position handling to Node
smesseim May 9, 2016
b9b62ad
Fix misleading JavaDoc
smesseim May 9, 2016
94c3b50
Merge pull request #48 from ProgrammingLife2016/feature/percentagepri…
smesseim May 9, 2016
9d48bfd
Merge remote-tracking branch 'origin/develop' into feature/checkstyle…
smesseim May 9, 2016
fabed39
Custom string iterator
SamuelSital May 9, 2016
f6794ef
Merge pull request #49 from ProgrammingLife2016/feature/checkstyle-fix-3
smesseim May 9, 2016
3f657d9
Remove .fasta extension from genome name
smesseim May 9, 2016
c4ff56c
Merge remote-tracking branch 'origin/feature/phyloparser' into featur…
smesseim May 9, 2016
4bc0ed6
Working parser
SamuelSital May 9, 2016
4a14784
Clean up parser
SamuelSital May 9, 2016
5cd0d28
Add JSON serializer for treenode
smesseim May 9, 2016
0901cd5
Merge remote-tracking branch 'origin/feature/phyloparser' into featur…
smesseim May 9, 2016
614a298
fix test failures
smesseim May 9, 2016
0a00450
Merge pull request #50 from ProgrammingLife2016/feature/phyloparser-json
smesseim May 10, 2016
10cd412
Merge remote-tracking branch 'origin/feature/phyloparser' into featur…
smesseim May 10, 2016
0db671b
Fix front end
SamuelSital May 11, 2016
0d47478
Fix merge conflict
SamuelSital May 11, 2016
0fa2671
Add pan/zoom widget and send zoom level to server
SamuelSital May 11, 2016
65353f0
Merge conflict fix
SamuelSital May 11, 2016
2fdf1e9
Load data after zoom level ajax request
SamuelSital May 11, 2016
7951d1d
Restructured test package
raviautar May 12, 2016
38775d3
Added tests for specimenparser
raviautar May 12, 2016
a79ce71
Completed metadata parser
raviautar May 12, 2016
e91e16d
fixed all checkstyle errors
raviautar May 12, 2016
f0c3922
Testing mapcollection interface
raviautar May 12, 2016
40d42ec
Phylognetic tree in IFRAME
SamuelSital May 12, 2016
56aa40a
Fixed CONTENT_LENGTH_MISMATCH error
May 12, 2016
eda98c1
Add semantic zooming
smesseim May 12, 2016
26d7bdd
Add all gfa's to LFS
smesseim May 12, 2016
1b4d02a
Hide irrelevant links
smesseim May 12, 2016
73de374
Added ajax request on panning/zooming with minx and miny
May 12, 2016
2dfd47f
Fix Phylogenetic tree in div
SamuelSital May 12, 2016
9f31e76
Merge branch 'feature/phyloparser' of https://github.com/ProgrammingL…
SamuelSital May 12, 2016
2ce1a5b
Modified ajax pan/zoom request
May 12, 2016
f570e89
Merge remote-tracking branch 'origin/feature/phyloparser' into featur…
smesseim May 12, 2016
c907ce1
Fix failing test
smesseim May 12, 2016
a16e7de
Add bounding for semantic zooming
smesseim May 12, 2016
d83627c
Completed tests for specimencollection
raviautar May 12, 2016
61c1bc2
Removed final checkstyle errors
raviautar May 13, 2016
2009d4b
Merge to get the new testing package structure
raviautar May 13, 2016
034ab16
Added new package for phyloparser to maintain structure
raviautar May 13, 2016
90121dd
Merge pull request #52 from ProgrammingLife2016/testing/metaparser
SamuelSital May 13, 2016
6879fc8
Fix positioning phylotree
SamuelSital May 13, 2016
8f45f19
Merge branch 'feature/phyloparser' of https://github.com/ProgrammingL…
SamuelSital May 13, 2016
4e5e4d0
Added missing tests for phyloparser
raviautar May 13, 2016
83f6cc9
Merge remote-tracking branch 'origin/feature/phyloparser' into featur…
smesseim May 13, 2016
f04c50d
Added few tests for phylotree
raviautar May 13, 2016
2749b72
Merge to get newest test classes
raviautar May 13, 2016
77c68d6
Completed all test for phylotree
raviautar May 13, 2016
e42a252
Added test case to test PositionHandler
raviautar May 13, 2016
b47ee10
Remove orphan nodes
smesseim May 13, 2016
998f79f
Merge pull request #54 from ProgrammingLife2016/testing/phylotreeparser
smesseim May 13, 2016
d2d275d
Merge branch 'feature/phylosemanticism' of github.com:ProgrammingLife…
smesseim May 13, 2016
4d7a284
Merge pull request #55 from ProgrammingLife2016/testing/segments
smesseim May 13, 2016
c900f25
Merge pull request #56 from ProgrammingLife2016/feature/phylosemanticism
raviautar May 13, 2016
14038b6
Bump version number to 0.2.0
smesseim May 13, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gfa filter=lfs diff=lfs merge=lfs -text
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ Not officially supported.
git clone https://github.com/ProgrammingLife2016/PL1-2016.git
cd PL1-2016
mvn package
java -cp target/byzantinegenerals-0.1.3.jar io.github.programminglife2016.pl1_2016.Launcher
java -cp target/byzantinegenerals-0.2.0.jar io.github.programminglife2016.pl1_2016.Launcher

### Subsequent runs

Go to the `PL1-2016` directory.

git pull
mvn package
java -cp target/byzantinegenerals-0.1.3.jar io.github.programminglife2016.pl1_2016.Launcher
java -cp target/byzantinegenerals-0.2.0.jar io.github.programminglife2016.pl1_2016.Launcher

## Usage

The server is running on `http://localhost:8081`.

Open the web app at `http://localhost:8081/static/index.html`.
Open the web app at `http://localhost:8081`.

If you are a developer, you might be interested in interacting with the server
directly. In that case, consult the API documentation below.
Expand Down
8 changes: 8 additions & 0 deletions code.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

public static void main(String[] args) {
TokenIterator it = new TokenIterator("cbbaaacabaa", "bc");
while (it.hasNext()) {
System.out.println("next: " + it.next());
}
}

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.programminglife2016.pl1_2016</groupId>
<artifactId>byzantinegenerals</artifactId>
<version>0.1.3</version>
<version>0.2.0</version>

<build>
<plugins>
Expand Down
20 changes: 15 additions & 5 deletions src/main/java/io/github/programminglife2016/pl1_2016/Launcher.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package io.github.programminglife2016.pl1_2016;

import io.github.programminglife2016.pl1_2016.parser.JsonSerializable;
import io.github.programminglife2016.pl1_2016.parser.SimpleParser;
import io.github.programminglife2016.pl1_2016.parser.phylotree.TreeNodeCollection;
import io.github.programminglife2016.pl1_2016.parser.nodes.NodeCollection;
import io.github.programminglife2016.pl1_2016.parser.nodes.SegmentParser;
import io.github.programminglife2016.pl1_2016.parser.phylotree.PhyloGeneticTreeParser;
import io.github.programminglife2016.pl1_2016.server.api.RestServer;
import io.github.programminglife2016.pl1_2016.server.Server;

Expand All @@ -12,6 +14,7 @@
* Reads the input and launches the server.
*/
public final class Launcher {
private static final double NANOSECONDS_PER_SECOND = 1000000000.0;
private Launcher() {
}
/**
Expand All @@ -20,9 +23,16 @@ private Launcher() {
* @throws IOException thrown if the port is in use.
*/
public static void main(String[] args) throws IOException {
InputStream is = Launcher.class.getResourceAsStream("/genomes/TB10_200.gfa");
JsonSerializable jsonSerializable = new SimpleParser().parse(is);
Server server = new RestServer(jsonSerializable);
System.out.println("Started loading.");
long startTime = System.nanoTime();
InputStream is = Launcher.class.getResourceAsStream("/genomes/TB10.gfa");
NodeCollection nodeCollection = new SegmentParser().parse(is);
long endTime = System.nanoTime();
System.out.println(String.format("Loading time: %f s.", (endTime - startTime)
/ NANOSECONDS_PER_SECOND));
InputStream nwk = Launcher.class.getResourceAsStream("/genomes/TB10.nwk");
TreeNodeCollection treeNodes = new PhyloGeneticTreeParser().parse(nwk);
Server server = new RestServer(nodeCollection, treeNodes.getRoot());
server.startServer();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.github.programminglife2016.pl1_2016.parser;

import io.github.programminglife2016.pl1_2016.parser.phylotree.TreeNode;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;

public class ClosestGenomeSelectionStrategy implements GenomeSelectionStrategy {
@Override
public Collection<String> genomes(TreeNode rootNode, int level) {
List<TreeNode> treeNodes = rootNode.flatten().stream().collect(Collectors.toList());
Collection<String> genomes = new ArrayList<>();
for (int i = 0; i < Math.min(Math.pow(2, level), treeNodes.size()); i++) {
genomes.add(treeNodes.get(i).getName());
}
// return genomes;
return Arrays.asList("TKK 02 0007", "TKK 02 0006");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.github.programminglife2016.pl1_2016.parser;

import io.github.programminglife2016.pl1_2016.parser.phylotree.TreeNode;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Optional;

public class FurthestGenomeSelectionStrategy implements GenomeSelectionStrategy {
@Override
public Collection<String> genomes(TreeNode rootNode, int level) {
if (level == 0) {
Optional<TreeNode> treeNode = rootNode.flatten().stream().findFirst();
return Collections.singletonList(treeNode.get().getName());
}
if (rootNode.getChildren().isEmpty()) {
return Collections.singletonList(rootNode.getName());
} else {
Collection<TreeNode> children = rootNode.getChildren();
Collection<String> allGenomes = new ArrayList<>();
for (TreeNode child : children) {
Collection<String> genomes = genomes(child, level - 1);
allGenomes.addAll(genomes);
}
return allGenomes;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.github.programminglife2016.pl1_2016.parser;

import io.github.programminglife2016.pl1_2016.parser.phylotree.TreeNode;

import java.util.Collection;

public interface GenomeSelectionStrategy {
Collection<String> genomes(TreeNode rootNode, int level);
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
package io.github.programminglife2016.pl1_2016.parser;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
* Data is sent by the server in JSON format. Classes extending this method can convert their
* representation to JSON.
*/
public interface JsonSerializable {
/**
* Convert the representation to JSON.
*
* @return JSON representation of this object.
*/
default String toJson() {
Gson gson = new GsonBuilder()
.registerTypeAdapter(NodeList.class, new NodeCollectionSerializer())
.registerTypeAdapter(NodeMap.class, new NodeCollectionSerializer()).create();
return gson.toJson(this);
}
String toJson();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.github.programminglife2016.pl1_2016.parser;

import io.github.programminglife2016.pl1_2016.parser.nodes.NodeCollection;

public interface NodeReductionStrategy {
NodeCollection reduce(NodeCollection original);
}

This file was deleted.

This file was deleted.

Loading