The library allows you to access experiments on PhyloData using Java. It is designed to make handling data as easy as possible, so that you can focus on more interesting things.
Check out the Maven Central Repository.
If you’re using Maven, simply add PhyloData as a dependency to the pom.xml
file.
Alternatively, you can download the jar file directly (click on Browse and then download the PhyloData-x.x.x.jar
file). You will also need to download and add the following jar files to your project:
Go find an interesting experiment and click on Use Experiment, or simply try the following snippet:
import com.phylodata.loader.ExperimentLoader;
import com.phylodata.types.PaperWithExperiment;
public class Tests {
public static void main(String[] args) {
PaperWithExperiment experiment = new ExperimentLoader(
"munro-2019-climate-6tvf", 1
).load();
System.out.println("Title: " + experiment.getPaper().getTitle());
}
}
PhyloData downloads all relevant files into the data/munro-2019-climate-6tvf
folder. However, you don’t have to juggle with file paths to access the files:
PaperWithExperiment experiment = new ExperimentLoader(
"munro-2019-climate-6tvf", 1
).load();
File treesFile = experiment.getFileOfType(File.FileType.POSTERIOR_TREES);
System.out.println("Trees file path: " + treesFile.getLocalPath());
This means that you will never have to worry about where and how the files are stored. You can always run the same program and it just works - no matter if it is on your local computer, a remote server, or on the computer of a friend.
Now that you’ve seen the basic way to download an experiment, you should explore the main concepts of the library: