Skip to content

Commit

Permalink
version 4.7.12 (-c added)
Browse files Browse the repository at this point in the history
  • Loading branch information
smirarab committed Dec 3, 2015
1 parent 1f09016 commit 84e438d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- version 4.7.12:
- Added an option (-c) so that ties are broken randomly

- version 4.7.8:
- Fixed a bug in normalization of quartet scores. For very large datasets, the normalization of the quartet scores was incorrect. This only affected the outputted normalized score.
The tree topology, and the non-normalized scores were not affected.
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,43 @@ Email: `[email protected]` for questions.
INSTALLATION:
-----------
There is no installation required to run ASTRAL.
You simply need to download the [zip file](https://github.com/smirarab/ASTRAL/raw/master/Astral.4.7.8.zip)
You simply need to download the [zip file](https://github.com/smirarab/ASTRAL/raw/master/Astral.4.7.12.zip)
and extract the contents to a folder of your choice. Alternatively, you can clone the [github repository](https://github.com/smirarab/ASTRAL/). You can run `make.sh` to build the project or simply use the jar file that is included with the repository.

ASTRAL is a java-based application, and should run in any environment (Windows, Linux, Mac, etc.) as long as java is installed. Java 1.5 or later is required. We have tested ASTRAL only on Linux and MAC.

To test your installation, go to the place where you uncompressed ASTRAL, and run:

```
java -jar astral.4.7.8.jar -i test_data/song_primates.424.gene.tre
java -jar astral.4.7.12.jar -i test_data/song_primates.424.gene.tre
```

This should quickly finish. There are also other sample input files under `test_data/` that can be used.

ASTRAL can be run from any directories. You just need to run `java -jar /path/to/astral/astral.4.7.8.jar`.
Also, you can move `astral.4.7.8.jar` to any location you like and run it from there, but note that you need
ASTRAL can be run from any directories. You just need to run `java -jar /path/to/astral/astral.4.7.12.jar`.
Also, you can move `astral.4.7.12.jar` to any location you like and run it from there, but note that you need
to move the `lib` directory as well.

EXECUTION:
-----------
ASTRAL currently has no GUI. You need to run it through command-line. In a terminal, go the location where you have downloaded the software, and issue the following command:

```
java -jar astral.4.7.8.jar
java -jar astral.4.7.12.jar
```

This will give you a list of options available in ASTRAL.

To find the species tree given a set of gene trees in a file called `in.tree`, use:

```
java -jar astral.4.7.8.jar -i in.tree
java -jar astral.4.7.12.jar -i in.tree
```

The results will be outputted to the standard output. To save the results in a file use the `-o` option (**Strongly recommended, unless you are using a pipeline**):

```
java -jar astral.4.7.8.jar -i in.tree -o out.tre
java -jar astral.4.7.12.jar -i in.tree -o out.tre
```

The input gene trees can have missing taxa, polytommies (unresolved branches), and also multiple individuals per species. When multiple individuals from the same species are available, a mapping file needs to be provided using a `-a` option. This mapping file should have one line per species, and each line needs to be in one of two formats:
Expand All @@ -71,7 +71,7 @@ that you test [multiind](https://github.com/smirarab/ASTRAL/tree/multiind) branc
To perform 100 replicates of multi-locus bootstrapping ([Seo 2008](http://www.ncbi.nlm.nih.gov/pubmed/18281270)), use:

```
java -jar astral.4.7.8.jar -i best_ml -b bs_paths -r 100
java -jar astral.4.7.12.jar -i best_ml -b bs_paths -r 100
```

In this command, `bs_paths` is a file that gives the location of gene tree bootstrap files, one line per gene.
Expand All @@ -96,7 +96,7 @@ Also related to bootstrapping are `-g` (to enable gene/site resampling) and `-s`
For big datasets (say more than 100 taxon) increasing the memory available to Java can result in speed ups. Note that you should give Java only as much free memory as you have available on your machine. So, for example, if you have 3GB of free memory, you can invoke ASTRAL using the following command to make all the 3GB available to Java:

```
java -Xmx3000M -jar astral.4.7.8.jar -i in.tree
java -Xmx3000M -jar astral.4.7.12.jar -i in.tree
```

Acknowledgment
Expand Down
3 changes: 3 additions & 0 deletions main/phylonet/coalescent/AbstractComputeMinCostTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ private double computeMinCost() throws CannotResolveException {
&& (lscore + rscore + c < v._max_score)) {
continue;
}
if (lscore + rscore + c == v._max_score && GlobalMaps.random.nextBoolean()) {
continue;
}
v._max_score = (lscore + rscore + c);
v._min_lc = smallV;
v._min_rc = bigv;
Expand Down
4 changes: 3 additions & 1 deletion main/phylonet/coalescent/AbstractInference.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ public abstract class AbstractInference<T> {
public boolean outputCompleted;
boolean searchSpace;
private boolean run;
private boolean randtie;

public AbstractInference(boolean rooted, boolean extrarooted, List<Tree> trees,
List<Tree> extraTrees, boolean exactSolution, int addExtra,
boolean outputCompletedGenes, boolean outSearch, boolean run) {
boolean outputCompletedGenes, boolean outSearch, boolean run, boolean randomtiebreaker) {
super();
this.rooted = rooted;
this.extrarooted = extrarooted;
Expand All @@ -58,6 +59,7 @@ public AbstractInference(boolean rooted, boolean extrarooted, List<Tree> trees,
this.outputCompleted = outputCompletedGenes;
this.searchSpace = outSearch;
this.run = run;
this.randtie = randomtiebreaker;
}

protected Collapse.CollapseDescriptor doCollapse(List<Tree> trees) {
Expand Down
28 changes: 19 additions & 9 deletions main/phylonet/coalescent/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

public class CommandLine {

protected static String _versinon = "4.7.8";
protected static String _versinon = "4.7.12";


private static void exitWithErr(String extraMessage, SimpleJSAP jsap) {
Expand Down Expand Up @@ -143,6 +143,10 @@ private static SimpleJSAP getJSAP() throws JSAPException {
JSAP.INTEGER_PARSER, null, JSAP.NOT_REQUIRED,
'm', "minleaves",
"Remove genes with less than specificed number of leaves "),

new Switch("random tie breaker",
'c', "random-tie-break",
"beeaks ties randomly (the random seed given with -s controls the random choices)."),

new Switch( "duplication",
'd', "dup",
Expand Down Expand Up @@ -196,6 +200,7 @@ public static void main(String[] args) throws Exception{
Integer minleaves = null;
BufferedWriter outbuffer;
Set<String> keepOptions = new HashSet<String>();
boolean randtie;

jsap = getJSAP();
config = jsap.parse(args);
Expand Down Expand Up @@ -240,6 +245,8 @@ public static void main(String[] args) throws Exception{
System.err.println("Using DynaDup application, minimizing MGDL (not ASTRAL).");
}

randtie = config.getBoolean("random tie breaker");

System.err.println("\n================== ASTRAL ===================== \n" );
System.err.println("This is ASTRAL version " + _versinon);

Expand Down Expand Up @@ -325,7 +332,7 @@ public static void main(String[] args) throws Exception{

AbstractInference inference =
initializeInference(criterion, rooted, extrarooted, mainTrees,
extraTrees, cs, cd, wh, exact, addExtra, keepOptions);
extraTrees, cs, cd, wh, exact, addExtra, keepOptions, randtie);
for (Tree tr : toScore) {
inference.scoreGeneTree(tr);
}
Expand Down Expand Up @@ -448,7 +455,7 @@ public static void main(String[] args) throws Exception{
rooted, extrarooted, extraTrees, cs, cd,
wh, exact, outbuffer,
readInputTrees(input, rooted, false, false, minleaves),
null, outgroup, addExtra, keepOptions));
null, outgroup, addExtra, keepOptions, randtie));
}

if (bootstraps != null && bootstraps.size() != 0) {
Expand All @@ -461,7 +468,8 @@ public static void main(String[] args) throws Exception{

System.err.println("\n======== Running the main analysis");
runOnOneInput(criterion, rooted, extrarooted, extraTrees, cs, cd,
wh, exact, outbuffer, mainTrees, bootstraps, outgroup, addExtra, keepOptions);
wh, exact, outbuffer, mainTrees, bootstraps, outgroup, addExtra,
keepOptions, randtie);

outbuffer.close();

Expand All @@ -473,13 +481,13 @@ public static void main(String[] args) throws Exception{
private static Tree runOnOneInput(int criterion, boolean rooted,
boolean extrarooted, List<Tree> extraTrees, double cs, double cd,
double wh, boolean exact, BufferedWriter outbuffer, List<Tree> input,
Iterable<Tree> bootstraps, String outgroup, int addExtra, Set<String> keepOptions) {
Iterable<Tree> bootstraps, String outgroup, int addExtra, Set<String> keepOptions, boolean randtie) {
long startTime;
startTime = System.currentTimeMillis();

AbstractInference inference =
initializeInference(criterion, rooted, extrarooted, input,
extraTrees, cs, cd, wh, exact, addExtra, keepOptions);
extraTrees, cs, cd, wh, exact, addExtra, keepOptions, randtie);

List<Solution> solutions = inference.inferSpeciesTree();

Expand All @@ -502,17 +510,19 @@ private static Tree runOnOneInput(int criterion, boolean rooted,

private static AbstractInference initializeInference(int criterion, boolean rooted,
boolean extrarooted, List<Tree> trees, List<Tree> extraTrees,
double cs, double cd, double wh, boolean exact, int addExtra, Set<String> keepOptions) {
double cs, double cd, double wh, boolean exact, int addExtra, Set<String> keepOptions,
boolean randtie) {
AbstractInference inference;
if (criterion == 1 || criterion == 0) {
inference = new DLInference(rooted, extrarooted,
trees, extraTrees,exact ,criterion > 0, keepOptions.contains("completed"));
trees, extraTrees,exact ,criterion > 0, keepOptions.contains("completed"),
randtie);
} else if (criterion == 2) {
inference = new WQInference(rooted, extrarooted,
trees, extraTrees, exact,criterion > 0, 1, addExtra,
keepOptions.contains("completed"),
keepOptions.contains("searchspace_norun") || keepOptions.contains("searchspace"),
!keepOptions.contains("searchspace_norun") );
!keepOptions.contains("searchspace_norun"), randtie );
} else {
throw new RuntimeException("criterion not set?");
}
Expand Down
6 changes: 4 additions & 2 deletions main/phylonet/coalescent/DLInference.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ public class DLInference extends AbstractInference<STBipartition> {
//Map<STITreeCluster, Vertex> clusterToVertex;

public DLInference(boolean rooted, boolean extrarooted, List<Tree> trees,
List<Tree> extraTrees, boolean exactSolution, boolean duploss, boolean outputCompletedGenes) {
super(rooted, extrarooted, trees, extraTrees, exactSolution, 0, outputCompletedGenes, false, true);
List<Tree> extraTrees, boolean exactSolution, boolean duploss, boolean outputCompletedGenes,
boolean randtie) {
super(rooted, extrarooted, trees, extraTrees, exactSolution, 0, outputCompletedGenes, false, true,
randtie);
this.optimizeDuploss = duploss ? 3 : 1;
}

Expand Down
4 changes: 2 additions & 2 deletions main/phylonet/coalescent/WQInference.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class WQInference extends AbstractInference<Tripartition> {

public WQInference(boolean rooted, boolean extrarooted, List<Tree> trees,
List<Tree> extraTrees, boolean exactSolution, boolean duploss, int alg, int addExtra,
boolean outputCompletedGenes, boolean outSearch, boolean run) {
boolean outputCompletedGenes, boolean outSearch, boolean run, boolean randomtiebreaker) {
super(rooted, extrarooted, trees, extraTrees, exactSolution,
addExtra, outputCompletedGenes, outSearch, run);
addExtra, outputCompletedGenes, outSearch, run, randomtiebreaker);
this.forceAlg = alg;
}

Expand Down

0 comments on commit 84e438d

Please sign in to comment.