You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: QtSLiM/help/SLiMHelpFunctions.html
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -103,12 +103,12 @@
103
103
<pclass="p3">Set a mutation rate map from data read from the file at <spanclass="s3">path</span>.<spanclass="Apple-converted-space"></span>This function is essentially a wrapper for <spanclass="s3">initializeMutationRate()</span> that uses <spanclass="s3">readCSV()</span> and passes the data through.<spanclass="Apple-converted-space"></span>The file is expected to contain two columns of data.<spanclass="Apple-converted-space"></span>The first column must be <spanclass="s3">integer</span> start positions for rate map regions; the first region should start at position <spanclass="s3">0</span> if the map’s positions are <spanclass="s3">0</span>-based, or at position <spanclass="s3">1</span> if the map’s positions are <spanclass="s3">1</span>-based; in the latter case, <spanclass="s3">1</span> will be subtracted from every position since SLiM uses <spanclass="s3">0</span>-based positions.<spanclass="Apple-converted-space"></span>The second column must be <spanclass="s3">float</span> rates, relative to the scaling factor specified in <spanclass="s3">scale</span>; for example, if a given rate is <spanclass="s3">1.2</span> and <spanclass="s3">scale</span> is <spanclass="s3">1e-8</span> (the default), the rate used will be <spanclass="s3">1.2e-8</span>.<spanclass="Apple-converted-space"></span>No column header line should be present; the file should start immediately with numerical data.<spanclass="Apple-converted-space"></span>The expected separator between columns is a tab character by default, but may be passed in <spanclass="s3">sep</span>; the expected decimal separator is a period by default, but may be passed in <spanclass="s3">dec</span>.<spanclass="Apple-converted-space"></span>Once read, the map is converted into a rate map specified with end positions, rather than start positions, and the position given by <spanclass="s3">lastPosition</span> is used as the end of the last rate region; it should be the last position of the chromosome.</p>
104
104
<pclass="p3">See <spanclass="s3">readCSV()</span> for further details on <spanclass="s3">sep</span> and <spanclass="s3">dec</span>, which are passed through to it; and see <spanclass="s3">initializeMutationRate()</span> for details on how the rate map is validated and used, and how the <spanclass="s3">sex</span> parameter is used.</p>
105
105
<pclass="p3">This function is written in Eidos, and its source code can be viewed with <spanclass="s3">functionSource()</span>, so you can copy and modify its code if you need to modify its functionality.</p>
<pclass="p3">Add a mutation type at initialization time.<spanclass="Apple-converted-space"></span>The <spanclass="s3">id</span> must not already be used for any mutation type in the simulation.<spanclass="Apple-converted-space"></span>The <spanclass="s3">id</span> parameter may be either an <spanclass="s3">integer</span> giving the ID of the new mutation type, or a <spanclass="s3">string</span> giving the name of the new mutation type (such as <spanclass="s3">"m5"</span> to specify an ID of 5).<spanclass="Apple-converted-space"></span>The global symbol for the new mutation type, such as <spanclass="s3">m5</span>, is immediately available; the return value also provides the new object.</p>
108
-
<pclass="p3">The <spanclass="s3">dominanceCoeff</span> parameter supplies the default dominance coefficient for the mutation type, for all traits; <spanclass="s3">0.0</span> produces no dominance, <spanclass="s3">1.0</span> complete dominance, and values greater than <spanclass="s3">1.0</span>, overdominance.<spanclass="Apple-converted-space"></span>The default dominance coefficient for the mutation type for a specific trait can subsequently be configured with the <spanclass="s3">setDefaultDominanceForTrait()</span> method if desired.<spanclass="Apple-converted-space"></span>Note that the mutation type’s default hemizygous dominance coefficient is not supplied to this function; it always defaults to <spanclass="s3">1.0</span>, but can subsequently be configured with the <spanclass="s3">setDefaultHemizygousDominanceForTrait()</span> method if desired.</p>
109
-
<pclass="p3">The <spanclass="s3">distributionType</span> and the ellipsis parameters together define the distribution of effect size (DES) for the mutation type, for all traits.<spanclass="Apple-converted-space"></span>The DES for the mutation type for a specific trait can subsequently be separately configured with the <spanclass="s3">setEffectDistributionForTrait()</span> method if desired.<spanclass="Apple-converted-space"></span>The <spanclass="s3">distributionType</span> parameter may be <spanclass="s3">"f"</span>, in which case the ellipsis <spanclass="s3">...</span> should supply a <spanclass="s3">numeric$</span> fixed selection coefficient; <spanclass="s3">"e"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span> mean selection coefficient for an exponential distribution; <spanclass="s3">"g"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span> mean selection coefficient and a <spanclass="s3">numeric$</span> alpha shape parameter for a gamma distribution; <spanclass="s3">"n"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span> mean selection coefficient and a <spanclass="s3">numeric$</span> sigma (standard deviation) parameter for a normal distribution; <spanclass="s3">"p"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span> mean selection coefficient and a <spanclass="s3">numeric$</span> scale parameter for a Laplace distribution; <spanclass="s3">"w"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span><spanclass="s7">λ</span> scale parameter and a <spanclass="s3">numeric$</span> k shape parameter for a Weibull distribution; or <spanclass="s3">"s"</span>, in which case the ellipsis should supply a <spanclass="s3">string$</span> Eidos script parameter.<spanclass="Apple-converted-space"></span>See the <spanclass="s3">MutationType</span> class documentation for discussion of the various DESs and their uses.</p>
108
+
<pclass="p3">The <spanclass="s3">dominanceCoeff</span> parameter supplies the default dominance coefficient for the mutation type, for all traits; <spanclass="s3">0.0</span> produces no dominance, <spanclass="s3">1.0</span> complete dominance, and values greater than <spanclass="s3">1.0</span>, overdominance.<spanclass="Apple-converted-space"></span>The default dominance coefficient for the mutation type for a specific trait can subsequently be configured with the <spanclass="s3">setDefaultDominanceForTrait()</span> method if desired.<spanclass="Apple-converted-space"></span>Note that the mutation type’s default hemizygous dominance coefficient is not supplied to this function; it always defaults to <spanclass="s3">1.0</span>, but the <spanclass="s3">setDefaultHemizygousDominanceForTrait()</span> method can configure it subsequently if desired.</p>
109
+
<pclass="p3">The <spanclass="s3">distributionType</span> and the ellipsis parameters together define the distribution of effect size (DES) for the mutation type, for all traits.<spanclass="Apple-converted-space"></span>The DES for the mutation type for a specific trait can subsequently be separately configured with the <spanclass="s3">setEffectDistributionForTrait()</span> method if desired.<spanclass="Apple-converted-space"></span>The <spanclass="s3">distributionType</span> parameter may be <spanclass="s3">"f"</span>, in which case the ellipsis <spanclass="s3">...</span> should supply a <spanclass="s3">numeric$</span> fixed selection coefficient; <spanclass="s3">"e"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span> mean selection coefficient for an exponential distribution; <spanclass="s3">"g"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span> mean selection coefficient and a <spanclass="s3">numeric$</span> alpha shape parameter for a gamma distribution; <spanclass="s3">"n"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span> mean selection coefficient and a <spanclass="s3">numeric$</span> sigma (standard deviation) parameter for a normal distribution; <spanclass="s3">"p"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span> mean selection coefficient and a <spanclass="s3">numeric$</span> scale parameter for a Laplace distribution; <spanclass="s3">"w"</span>, in which case the ellipsis should supply a <spanclass="s3">numeric$</span><spanclass="s7">λ</span> scale parameter and a <spanclass="s3">numeric$</span> k shape parameter for a Weibull distribution; or <spanclass="s3">"s"</span>, in which case the ellipsis should supply a <spanclass="s3">string$</span> Eidos script parameter.<spanclass="Apple-converted-space"></span>If <spanclass="s3">distributionType</span> is <spanclass="s3">NULL</span> (the default), a fixed effect of <spanclass="s3">0.0</span> is used, representing a neutral DES; this is equivalent to type <spanclass="s3">"f"</span> except that the value <spanclass="s3">0.0</span> is assumed and must not be supplied.<spanclass="Apple-converted-space"></span>See the <spanclass="s3">MutationType</span> class documentation for discussion of the various DESs and their uses.</p>
110
110
<pclass="p3"><spanclass="s1">Note that by default in WF models, all mutations of a given mutation type will be converted into </span><spanclass="s2">Substitution</span><spanclass="s1"> objects when they reach fixation, for efficiency reasons.<spanclass="Apple-converted-space"></span>If you need to disable this conversion, to keep mutations of a given type active in the simulation even after they have fixed, you can do so by setting the </span><spanclass="s2">convertToSubstitution</span><spanclass="s1"> property of </span><spanclass="s2">MutationType</span><spanclass="s1"> to </span><spanclass="s2">F</span><spanclass="s1">.<spanclass="Apple-converted-space"></span>In contrast, by default in nonWF models mutations will not be converted into </span><spanclass="s2">Substitution</span><spanclass="s1"> objects when they reach fixation; </span><spanclass="s2">convertToSubstitution</span><spanclass="s1"> is </span><spanclass="s2">F</span><spanclass="s1"> by default in nonWF models.<spanclass="Apple-converted-space"></span>To enable conversion in nonWF models for neutral mutation types with no indirect fitness effects, you should therefore set </span><spanclass="s2">convertToSubstitution</span><spanclass="s1"> to </span><spanclass="s2">T</span><spanclass="s1">.</span></p>
<pclass="p3"><spanclass="s1">Add a nucleotide-based mutation type at initialization time.<spanclass="Apple-converted-space"></span>This function is identical to </span><spanclass="s2">initializeMutationType()</span><spanclass="s1"> except that the new mutation type will be nucleotide-based – in other words, mutations belonging to the new mutation type will have an associated nucleotide.<spanclass="Apple-converted-space"></span>This function may be called only in nucleotide-based models (as enabled by the </span><spanclass="s2">nucleotideBased</span><spanclass="s1"> parameter to </span><spanclass="s2">initializeSLiMOptions()</span><spanclass="s1">).</span></p>
113
113
<pclass="p3"><spanclass="s1">Nucleotide-based mutations always use a </span><spanclass="s2">mutationStackGroup</span><spanclass="s1"> of </span><spanclass="s2">-1</span><spanclass="s1"> and a </span><spanclass="s2">mutationStackPolicy</span><spanclass="s1"> of </span><spanclass="s2">"l"</span><spanclass="s1">.<spanclass="Apple-converted-space"></span>This ensures that a new nucleotide mutation always replaces any previously existing nucleotide mutation at a given position, regardless of the mutation types of the nucleotide mutations.<spanclass="Apple-converted-space"></span>These values are set automatically by </span><spanclass="s2">initializeMutationTypeNuc()</span><spanclass="s1">, and may not be changed.</span></p>
114
114
<pclass="p3"><spanclass="s1">See the documentation for </span><spanclass="s2">initializeMutationType()</span><spanclass="s1"> for all other discussion.</span></p>
\f2\fs20 method if desired. Note that the mutation type\'92s default hemizygous dominance coefficient is not supplied to this function; it always defaults to
901
901
\f1\fs18 1.0
902
-
\f2\fs20 , but can subsequently be configured with the
902
+
\f2\fs20 , but the
903
903
\f1\fs18 setDefaultHemizygousDominanceForTrait()
904
-
\f2\fs20 method if desired.\
904
+
\f2\fs20 method can configure it subsequently if desired.\
905
905
The
906
906
\f1\fs18 distributionType
907
907
\f2\fs20 and the ellipsis parameters together define the distribution of effect size (DES) for the mutation type, for all traits. The DES for the mutation type for a specific trait can subsequently be separately configured with the
@@ -948,11 +948,20 @@ The
948
948
\f1\fs18 "s"
949
949
\f2\fs20 , in which case the ellipsis should supply a
950
950
\f1\fs18 string$
951
-
\f2\fs20 Eidos script parameter. See the
951
+
\f2\fs20 Eidos script parameter. If
952
+
\f1\fs18 distributionType
953
+
\f2\fs20 is
954
+
\f1\fs18 NULL
955
+
\f2\fs20 (the default), a fixed effect of
956
+
\f1\fs18 0.0
957
+
\f2\fs20 is used, representing a neutral DES; this is equivalent to type
958
+
\f1\fs18 "f"
959
+
\f2\fs20 except that the value
960
+
\f1\fs18 0.0
961
+
\f2\fs20 is assumed and must not be supplied. See the
952
962
\f1\fs18 MutationType
953
963
\f2\fs20 class documentation for discussion of the various DESs and their uses.\
Note that by default in WF models, all mutations of a given mutation type will be converted into
957
966
\f1\fs18 Substitution
958
967
\f2\fs20 objects when they reach fixation, for efficiency reasons. If you need to disable this conversion, to keep mutations of a given type active in the simulation even after they have fixed, you can do so by setting the
@@ -974,7 +983,8 @@ Note that by default in WF models, all mutations of a given mutation type will b
\cf0 This function will likely be extended with further options in the future, added on to the end of the argument list. Using named arguments with this call is recommended for readability. Note that turning on optional features may increase the runtime and memory footprint of SLiM.\
Copy file name to clipboardExpand all lines: VERSIONS
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,7 @@ multitrait branch:
109
109
allow the destination subpop to be given as a source, iff all rates supplied are 0.0, to stop all migration: allSubpops.setMigrationRates(allSubpops, 0.0)
110
110
fix #567, plot windows can have their aspect ratio distorted due to screen size and other constraints
extend initializeMutationType() and initializeMutationTypeNuc() to make the effect distribution optional with [Ns$ distributionType = NULL], where NULL is equivalent to `"f", 0.0`
0 commit comments