chaoszhang / A-pro

ASTRAL for PaRalogs and Orthologs
19 stars 6 forks source link

libAstral.so #11

Closed serene66 closed 2 years ago

serene66 commented 3 years ago

Hi, When I run the command, I got the following error result.

Command:

cd /software/A-pro/ASTRAL-MP java -Xmx10240m -D"java.library.path=lib" -jar astral.1.1.4.jar -i /test/example1.tre -o /test/pro.tre 2>/test/out.log

out.log:

Picked up _JAVA_OPTIONS: -Xmx5g

================== ASTRAL-Pro =====================

This is ASTRAL-Pro (A-Pro) version 1.1.4

Error: Fail to load native library libAstral.so. Make sure you are using the correct Djava.library.path (to the lib directory under ASTRAL-Pro where libAstral.so can be found). Trying running make.sh. For mode debugging, run: java -Djava.library.path=lib/ -jar native_library_tester.jar

Exception in thread "main" java.lang.NullPointerException at phylonet.coalescent.CommandLine.exitWithErr(CommandLine.java:54) at phylonet.coalescent.CommandLine.main(CommandLine.java:486)

How can I solve it? I have already run "make.sh", and alter " java -Djava.library.path=lib/". Thank you!

serene66 commented 3 years ago

Can multiple allelic types of a single copy gene in polyploid species be used for this method?

chaoszhang commented 3 years ago

Hi, Can you compile using g++ -std=c++11 -I"$DIR" -I"$DIR/linux" -march=native -Ofast -fPIC -o lib/libAstral.so -shared main/phylonet_coalescent_Polytree_PTNative.cpp where $DIR is set to where jni.h is and run again? Best, Chao

serene66 commented 3 years ago

Thank you for your advice. I did it according to your method. g++ -std=c++11 -I"$DIR" -I"$DIR/linux" -march=native -Ofast -fPIC -o lib/libAstral.so -shared main/phylonet_coalescent_Polytree_PTNative.cpp

An error is as follows: In file included from main/phylonet_coalescent_Polytree_PTNative.cpp:8:0:main/phylonet_coalescent_Polytree_PTNative.h:2:17: fatal error: jni.h: No such file or directory

include

compilation terminated.

What should I do next? Looking forward to your reply.

chaoszhang commented 3 years ago

Please replace $DIR with the directory containing jni.h. For example it may look like /usr/lib/jvm/*/include. Please try ls /usr/lib/jvm/*/include/jni.h to confirm the location of jni.h.

serene66 commented 3 years ago

Thank you very much. This problem has been solved. I am reading your article and have a little question. Your method A-Pro can handle orthology and paralogy, so can it infer polyploid phylogenies by using single copy nuclear genes? In a polyploid species, there are more than two genetypes in the single copy nuclear gene by selecting alleles, which can be regarded as the multi-copy gene of a diploid species. Can I solve this problem in your method?

smirarab commented 3 years ago

If you have two alleles instead of multiple copies, you can use the -a option of the normal ASTRAL. See:

Rabiee, Maryam, Erfan Sayyari, and Siavash Mirarab. “Multi-Allele Species Reconstruction Using ASTRAL.” Molecular Phylogenetics and Evolution 130 (January 2019): 286–96. https://doi.org/10.1016/j.ympev.2018.10.033.