From d099112c4f32fad3aec28231e427e05c695f4a57 Mon Sep 17 00:00:00 2001 From: walterxie Date: Fri, 17 Nov 2023 11:43:14 +1300 Subject: [PATCH] better comments on charset --- .../main/java/lphy/base/evolution/alignment/CharSetBlock.java | 2 ++ .../java/lphy/base/evolution/alignment/MetaDataAlignment.java | 2 +- tutorials/RSV2.lphy | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lphy-base/src/main/java/lphy/base/evolution/alignment/CharSetBlock.java b/lphy-base/src/main/java/lphy/base/evolution/alignment/CharSetBlock.java index 91588db31..e19646d86 100644 --- a/lphy-base/src/main/java/lphy/base/evolution/alignment/CharSetBlock.java +++ b/lphy-base/src/main/java/lphy/base/evolution/alignment/CharSetBlock.java @@ -7,6 +7,8 @@ /** * Parse charset, especially codon position expressions. + * It should follow the Nexus Format (Maddison et al. 1997). + * */ public class CharSetBlock { diff --git a/lphy-base/src/main/java/lphy/base/evolution/alignment/MetaDataAlignment.java b/lphy-base/src/main/java/lphy/base/evolution/alignment/MetaDataAlignment.java index 324807fa9..7bee64c2a 100644 --- a/lphy-base/src/main/java/lphy/base/evolution/alignment/MetaDataAlignment.java +++ b/lphy-base/src/main/java/lphy/base/evolution/alignment/MetaDataAlignment.java @@ -169,7 +169,7 @@ public void setChronoUnit(ChronoUnit chronoUnit) { "If the string doesn't match charset's syntax, then check if the string matches " + "a defined name in the nexus file. Otherwise it is an error. " + "The string is referred to one partition at a call, but can be multiple blocks, " + - "such as d.charset(\"2-457\\3 660-896\\3\").", + "such as a dummy example: d.charset([\"2-457\\3\", \"660-896\\3\", \"1-.\\3\"]).", narrativeName = "character set", category = GeneratorCategory.TAXA_ALIGNMENT, examples = {"twoPartitionCoalescentNex.lphy","https://linguaphylo.github.io/tutorials/time-stamped-data/"}) diff --git a/tutorials/RSV2.lphy b/tutorials/RSV2.lphy index 0c875539e..396608957 100644 --- a/tutorials/RSV2.lphy +++ b/tutorials/RSV2.lphy @@ -2,7 +2,8 @@ data { options = {ageDirection="forward", ageRegex="s(\d+)$"}; D = readNexus(file="data/RSV2.nex", options=options); taxa = D.taxa(); - codon = D.charset(["3-629\3","1-629\3", "2-629\3"]); + // codon positions + codon = D.charset(["1-.\3", "2-.\3", "3-.\3"]); L = codon.nchar(); n=length(codon); // 3 partitions }