LinguaPhylo / linguaPhylo

LinguaPhylo: A language for describing, visualising and simulating probabilistic phylogenetic models
GNU Lesser General Public License v3.0
14 stars 7 forks source link

new interface for writing values to a file #437

Closed walterxie closed 4 months ago

walterxie commented 4 months ago

Introduce the interface :

public interface TextFileFormatted {

    List<String> getTextForFile();

    String getFileType();

}

which will allow lphy extension developers to customise what and how they want to write a Value< TextFileFormatted > to a file. See the example of lphy.base.evolution.alignment.FastaAlignment, and the function fasta will return it as the type.

The previous ValueFormatter https://github.com/LinguaPhylo/linguaPhylo/issues/294 will not be available to use.

walterxie commented 4 months ago

lphy example:

D ~ PhyloCTMC(tree=ψ, L=L, Q=jukesCantor());
fastaD = fasta(D);