FePhyFoFum / phyx

phylogenetics tools for linux (and other mostly posix compliant) computers
blackrim.org
GNU General Public License v3.0
111 stars 17 forks source link

pxrmt Segmentation fault with multiple OGs, and failed to redirect via pipe issues #159

Closed Cactusolo closed 3 years ago

Cactusolo commented 3 years ago

I have two issues with pxrmt function:

  1. When outgroup more than one, then raising "Segmentation fault (core dumped)"

    [cactus]$ pxrmt -t tmp.tre -n 4400,63358,63359,63360 -o test.tre
    Segmentation fault (core dumped)
  2. Output to a file failed and always STOUT

    [cactus]$ pxrr -t RAxML_bipartitions.Zygophyllales_2run -g 690755,690812,690814,690816,690824 || pxrmt -n 690755,690812,690814,690816,690824 -o test.tre
    ((690755:0.0309192250234428,(690812:0.0158617919125023,.....);

    The tree file was print to terminal screen and out file "test.tre" is empty. and I also tried with redirect >test.tre also empty.

Please help and me know if you need a test data. Not sure, if I need to update to the recent version, current is v1.1.0.

Thanks!

Miao

josephwb commented 3 years ago

Sorry for the trouble. That version is a bit old (latest release is v1.2.1, and the master branch is v1.3). So please try upgrading. If it still fails, please provide input that we can troubleshoot.

Cactusolo commented 3 years ago

@josephwb it resolved after upgrade to v.1.3. Many thanks!

One small comment that, I found that the tip names in the output tree file containing single quote [ ' ], which may cause problem for downstream tip manipulation. For example, it won't work for relabel the tips, unless I remove all the single quote [don't have this my original tree file], or providing correspond name mapping file with tips in single quote.

josephwb commented 3 years ago

Hrm could you please provide an example (input, output, and example of a problematic label)? Quotes are only ever introduced if a label contains a newick-illegal character. But such labels should (almost) always have 2 quotes.

Cactusolo commented 3 years ago

Hrm could you please provide an example (input, output, and example of a problematic label)? Quotes are only ever introduced if a label contains a newick-illegal character. But such labels should (almost) always have 2 quotes.

# original tree
[cactus@test]$ cat test.tre
(454434-az:0.00225757676750129024,((4288:0.00095317223035216254,1197917:0.00000100000050002909):0.08510136778879195951,454421-az:0.00608116695325890220):0.00528080745550952267,454597-az:0.00112679728728448366):0.0;

# stdout output
[cactus@test]$ pxrr -t test.tre  -g 1197917,4288
((4288:0.0009531722303522,1197917:0.0000010000005):0.042550683894396,('454421-az':0.0060811669532589,('454434-az':0.0022575767675013,'454597-az':0.0011267972872845):0.0052808074555095):0.042550683894396);

# output to a `test_out.tre` file
[cactus@test]$ pxrr -t RAxML_bestTree.Vahliales_2run  -g 1197917,4288 -o test_out.tre

# single quote remains
[cactus@test]$ cat test_out.tre
((4288:0.0009531722303522,1197917:0.0000010000005):0.042550683894396,('454421-az':0.0060811669532589,('454434-az':0.0022575767675013,'454597-az':0.0011267972872845):0.0052808074555095):0.042550683894396);

#original tips
[cactus@test]$ pxlstr -t test.tre -i
1197917
4288
454421-az
454434-az
454597-az
josephwb commented 3 years ago

Thanks for that. ATM we are quoting any label that contains a non-compliant Nexus character. - happens to be illegal for Nexus, but not for newick. I see your point about matching labels downstream. I will figure out how to handle things more accurately.

josephwb commented 3 years ago

@Cactusolo Ok things should work for you now. I may take out the compliancy-quoting, since almost no users will be aware of which characters are illegal.

FWIW:

nexus_illegal = ()[]{}/\,;:=*'"`+-<>
newick_illegal = ()[]\':;,