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
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -99,9 +99,9 @@
99
99
<pclass="p3"><spanclass="s1">If the optional </span><spanclass="s2">sex</span><spanclass="s1"> parameter is </span><spanclass="s2">"*"</span><spanclass="s1"> (the default), then the supplied mutation rate map will be used for both sexes (which is the only option for hermaphroditic simulations).<spanclass="Apple-converted-space"></span>In sexual simulations </span><spanclass="s2">sex</span><spanclass="s1"> may be </span><spanclass="s2">"M"</span><spanclass="s1"> or </span><spanclass="s2">"F"</span><spanclass="s1"> instead, in which case the supplied mutation rate map is used only for that sex (i.e., when generating a gamete from a parent of that sex).<spanclass="Apple-converted-space"></span>In this case, two calls must be made to </span><spanclass="s2">initializeMutationRate()</span><spanclass="s1">, one for each sex, even if a rate of zero is desired for the other sex; no default mutation rate map is supplied.</span></p>
100
100
<pclass="p3"><spanclass="s1">In nucleotide-based models, </span><spanclass="s2">initializeMutationRate()</span><spanclass="s1"> may not be called.<spanclass="Apple-converted-space"></span>Instead, the desired sequence-based mutation rate(s) should be expressed in the </span><spanclass="s2">mutationMatrix</span><spanclass="s1"> parameter to </span><spanclass="s2">initializeGenomicElementType()</span><spanclass="s1">.<spanclass="Apple-converted-space"></span>If variation in the mutation rate along the chromosome is desired, </span><spanclass="s2">initializeHotspotMap()</span><spanclass="s1"> should be used.</span></p>
101
101
<pclass="p3">The <spanclass="s3">initializeMutationRateFromFile()</span> function is a useful convenience function if you wish to read the mutation rate map from a file.</p>
<pclass="p4">(void)initializeMutationRateFromFile(string$ path, integer$ lastPosition, [float$ scale = 1.0e-08], [string$ sep = "\t"], [string$ dec = "."], [string$ sex = "*"])</p>
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
-
<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.</p>
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>
policy change: the nucleotide and nucleotideValue properties of Substitution are now read-only (I think it was a bug that they were ever read-write...?)
86
+
fix #564, initializeMutationRateFromFile() needs a `sex` parameter; I'm doing this in multitrait to avoid the annoying doc conflicts
0 commit comments