Cannot pipe a tree to `seq-gen`
SamStudio8 opened this issue · comments
It is not possible to echo a string into seq-gen
to use as a tree:
$ echo "(A:0.1,B:0.1,C:0.1);" | /home/sam/ware/Seq-Gen.v1.3.3/source/seq-gen -mGTR
Sequence Generator - seq-gen
Version 1.3.2x
(c) Copyright, 1996-2004 Andrew Rambaut and Nick Grassly
Department of Zoology, University of Oxford
South Parks Road, Oxford OX1 3PS, U.K.
Error reading tree number 1: .
Meanwhile, the following works:
/home/sam/ware/Seq-Gen.v1.3.3/source/seq-gen -mGTR <<< "(A:0.1,B:0.1,C:0.1);"
From what I can tell, this could be caused by multiple calls of feof(stdin)
in seq-gen.c
or treefile.c
?
I'm not really sure what the "first pass" of stdin
does, as this is also a valid input that produces sequences:
/home/sam/ware/Seq-Gen.v1.3.3/source/seq-gen -mGTR
Sequence Generator - seq-gen
Version 1.3.2x
(c) Copyright, 1996-2004 Andrew Rambaut and Nick Grassly
Department of Zoology, University of Oxford
South Parks Road, Oxford OX1 3PS, U.K.
<CTRL-D>
(A:0.1,B:0.1,C:0.1);
<CTRL-D>
I am piping trees into Seq-Gen just fine. I believe they need to be in the Phylip format (I had to add a couple lines above my Newick trees to get it to work, should be a fairly simple conversion)
@niemasd Ah yes, that must be what those additional feof(stdin)
calls were looking for. I seem to recall the PHYLIP
format has a header line that describes the number of sequences and their length? Although my latter example shows that one can just interactively leave that header blank with a CTRL+D
and seq-gen
works anyway, so I'm not entirely sure whether the header is used for anything.
Ah this issue helped a lot. I couldn't pipe an alignment+tree into seq-gen but I can as a command line argument.