adamallo / SimPhy

SimPhy: A comprehensive simulator of gene family evolution
GNU General Public License v2.0
26 stars 1 forks source link

Passing huge fixed species tree #4

Closed uym2 closed 6 years ago

uym2 commented 6 years ago

Hello, I am trying to simulate gene trees from a fixed species tree that is very large (10k leaves). I passed the tree in Newick format via the -S option but got the error "Argument list too long". Is there a way to get around this issue?

Below is the command I used. I attach the species tree that I used for your reference.

spTree=$1

/home/umai/Packages_N_Libraries/SimPhy_1.0.2/bin/simphy_lnx64_lsb -S cat $spTree -RL U:381,381 -RG 1 -v 3 -CS 12345 -O simphy -LT U:0.0000002,0.0000002 -LK 1 -SP U:10000000,10000000 -HS LN:1.5,1 -HL LN:1.2,1 -HG LN:1.4,1

I appreciate your help. tree.txt

adamallo commented 6 years ago

That problem is related to the OS limitation in the length of your command-line arguments and not with SimPhy itself. You could use the -SR option to input the species-tree in a file specified in NEXUS format. You could easily generate the file with a one-liner, for example echo -e "#NEXUS\nbegin trees;\n\ttree 1=$spTree\nend;" > spTree.nex. I have also realized that your input tree does include a label in internal nodes (they look like posteriors or bootstrap supports) and SimPhy is not compatible with them (I will make it compatible ASAP). However, you can filter them out quickly: echo -e "#NEXUS\nbegin trees;\n\ttree 1=$(echo $spTree | sed "s/)[^:]*/)/g");\nend;" > test.tree.nex Also, to use such big trees, you will need to modify (and export) certain environment variables like SIMPHY_MAXIT and SIMPHY_MAXLEAVES. Please, keep me informed if you find more problems since I have never used SimPhy with trees of these dimensions. I hope this helps. DM