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/SLiMHelpClasses.html
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -474,7 +474,7 @@
474
474
<p class="p6">The <span class="s1">mutType</span> parameter may be <span class="s1">NULL</span>, or may specify a mutation type by its <span class="s1">integer</span> id or with the <span class="s1">MutationType</span> object itself.<span class="Apple-converted-space"> </span>If <span class="s1">mutType</span> is <span class="s1">NULL</span> (the default), mutations of every mutation type are returned; no filtering by mutation type is done.<span class="Apple-converted-space"> </span>Otherwise, only mutations of the specified mutation type will be returned.</p>
475
475
<p class="p6">The <span class="s1">chromosomes</span> parameter may be <span class="s1">NULL</span>, or may provide a vector of chromosomes specified by their <span class="s1">integer</span> id, <span class="s1">string</span> symbol, or with the <span class="s1">Chromosome</span> object itself.<span class="Apple-converted-space"> </span>If <span class="s1">chromosomes</span> is <span class="s1">NULL</span> (the default), mutations associated with every chromosome are returned; no filtering by chromosome is done.<span class="Apple-converted-space"> </span>Otherwise, only mutations associated with the specified chromosomes will be returned.</p>
476
476
<p class="p6">The returned vector will contain tranches of mutations, one tranche per chromosome, in the order that the chromosomes were specified (if <span class="s1">chromosomes</span> is non-<span class="s1">NULL</span>) or the order the chromosomes were defined in the model (if <span class="s1">chromosomes</span> is <span class="s1">NULL</span>).<span class="Apple-converted-space"> </span>Within a given tranche, the mutations for that chromosome will be returned in sorted order by <span class="s1">position</span>.<span class="Apple-converted-space"> </span>(If more than one mutation associated with a given chromosome exists at the same position, the order in which those mutations are returned is undefined.)</p>
477
-
<p class="p6">This method replaces the deprecated method <span class="s1">uniqueMutationsOfType()</span>, while providing additional useful options.<span class="Apple-converted-space"> </span>It is particularly useful for efficient, vectorized assessment of the homozygous versus heterozygous state of the mutations contained by an individual, which is otherwise difficult to assess efficiently.</p>
477
+
<p class="p6">This method replaces the deprecated method <span class="s1">uniqueMutationsOfType()</span>, while providing additional useful options.<span class="Apple-converted-space"> </span>It is particularly useful for efficient, vectorized assessment of the homozygous versus heterozygous state of the mutations contained by an individual, which is otherwise difficult to assess efficiently.<span class="Apple-converted-space"> </span>See also the method <span class="s1">zygosityOfMutations()</span>, which provides an alternative approach for assessing the zygosity of mutations in an individual.</p>
<p class="p6">Returns the individual offset(s) for the trait(s) specified by <span class="s1">trait</span>.<span class="Apple-converted-space"> </span>The traits can be specified as <span class="s1">integer</span> indices or <span class="s1">string</span> names of traits in the species, or directly as <span class="s1">Trait</span> objects; <span class="s1">NULL</span> represents all of the traits in the species, in the order in which they were defined.<span class="Apple-converted-space"> </span>Offsets for a given target individual will be returned consecutively in the order in which the traits are specified by <span class="s1">trait</span>.</p>
<p class="p6"><b>This method has been deprecated, and may be removed in a future release of SLiM.</b><span class="Apple-converted-space"> </span>Its functionality was replaced by <span class="s1">mutationsFromHaplosomes()</span> in SLiM 5.0.</p>
536
536
<p class="p6">Returns an <span class="s1">object</span> vector of all the mutations that are of the type specified by <span class="s1">mutType</span>, out of all of the mutations in the individual.<span class="Apple-converted-space"> </span>Mutations present in both homologous haplosomes will occur only once in the result of this method, and the mutations for a given chromosomes will be given in sorted order by <span class="s1">position</span>, so in single-chromosome simulations this method is similar to <span class="s1">sortBy(unique(individual.haplosomes.mutationsOfType(mutType)), "position")</span>.<span class="Apple-converted-space"> </span>(Even with a single chromosome it is not identical to that call, since if multiple mutations exist at the exact same position, they may be sorted differently by this method than they would be by <span class="s1">sortBy()</span>.)<span class="Apple-converted-space"> </span>If you just need a count of the matching <span class="s1">Mutation</span> objects, rather than a vector of the matches, use <span class="s1">-countOfMutationsOfType()</span>.<span class="Apple-converted-space"> </span>This method is provided for speed; it is much faster than the corresponding Eidos code.<span class="Apple-converted-space"> </span>Indeed, it is faster than just <span class="s1">individual.haplosomes.mutationsOfType(mutType)</span>, and gives uniquing and sorting on top of that, so it is advantageous unless duplicate entries for homozygous mutations are actually needed.</p>
<p class="p6">Returns an <span class="s1">integer</span> matrix with the target individuals’ zygosity for all of the <span class="s1">Mutation</span> objects passed in <span class="s1">mutations</span>.<span class="Apple-converted-space"> </span>If the optional <span class="s1">mutations</span> argument is <span class="s1">NULL</span> (the default), zygosity values will be returned for all of the active <span class="s1">Mutation</span> objects in the species – the same <span class="s1">Mutation</span> objects, and in the same order, as would be returned by the <span class="s1">mutations</span> property of <span class="s1">sim</span>, in other words.<span class="Apple-converted-space"> </span>The returned matrix has one column for each individual and one row for each mutation.</p>
539
+
<p class="p6">For a mutation on a diploid chromosome, the zygosity will be either <span class="s1">0</span> (absent), <span class="s1">1</span> (heterozygous), or <span class="s1">2</span> (homozygous).<span class="Apple-converted-space"> </span>This is the straightforward “base case” that is usually meant by the term “zygosity”.</p>
540
+
<p class="p6">If one of the two haplosomes of an intrinsically diploid chromosome is a null haplosome (as would be the case for an X chromosome in a male individual, for example), mutations present in the non-null haplosome are called “hemizygous”, and the zygosity returned for them is configurable using the <span class="s1">hemizygousValue</span> parameter.<span class="Apple-converted-space"> </span>By default, the zygosity returned for hemizygous mutations is <span class="s1">1</span>.</p>
541
+
<p class="p6">Finally, although the term “zygosity” is not usually used in the context of haploidy, this method nevertheless supports intrinsically haploid chromosomes; the zygosity returned for mutations present on an intrinsically haploid chromosome is configurable using the <span class="s1">haploidValue</span> parameter.<span class="Apple-converted-space"> </span>By default, the zygosity returned for haploid mutations is <span class="s1">1</span>.</p>
542
+
<p class="p6">For a large number of mutations – and especially for a <span class="s1">mutations</span> value of <span class="s1">NULL</span>, representing all mutations in the species – this method should be much more efficient than using methods such as <span class="s1">containsMutations()</span> to assess zygosity.<span class="Apple-converted-space"> </span>Nevertheless, calculating fitness effects in script based upon zygosity will generally be slower than SLiM’s internal fitness calculations.<span class="Apple-converted-space"> </span>Note that for just one or a few mutations – especially if <span class="s1">mutations</span> contains just a small fraction of all of the mutations in the species – this method will probably be much slower than alternative approaches; this method is optimized for the bulk case.</p>
543
+
<p class="p6">See also the method <span class="s1">mutationsFromHaplosomes()</span>, which provides an alternative approach for assessing the zygosity of mutations in an individual.</p>
Copy file name to clipboardExpand all lines: SLiMgui/SLiMHelpClasses.rtf
+56-1Lines changed: 56 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3873,7 +3873,9 @@ The returned vector will contain tranches of mutations, one tranche per chromoso
3873
3873
\f4\fs20 . (If more than one mutation associated with a given chromosome exists at the same position, the order in which those mutations are returned is undefined.)\
3874
3874
This method replaces the deprecated method
3875
3875
\f3\fs18 uniqueMutationsOfType()
3876
-
\f4\fs20 , while providing additional useful options. It is particularly useful for efficient, vectorized assessment of the homozygous versus heterozygous state of the mutations contained by an individual, which is otherwise difficult to assess efficiently.\
3876
+
\f4\fs20 , while providing additional useful options. It is particularly useful for efficient, vectorized assessment of the homozygous versus heterozygous state of the mutations contained by an individual, which is otherwise difficult to assess efficiently. See also the method
3877
+
\f3\fs18 zygosityOfMutations()
3878
+
\f4\fs20 , which provides an alternative approach for assessing the zygosity of mutations in an individual.\
\f4\fs20 , and gives uniquing and sorting on top of that, so it is advantageous unless duplicate entries for homozygous mutations are actually needed.\
\f4\fs20 matrix with the target individuals\'92 zygosity for all of the
4568
+
\f3\fs18 Mutation
4569
+
\f4\fs20 objects passed in
4570
+
\f3\fs18 mutations
4571
+
\f4\fs20 . If the optional
4572
+
\f3\fs18 mutations
4573
+
\f4\fs20 argument is
4574
+
\f3\fs18 NULL
4575
+
\f4\fs20 (the default), zygosity values will be returned for all of the active
4576
+
\f3\fs18 Mutation
4577
+
\f4\fs20 objects in the species \'96 the same
4578
+
\f3\fs18 Mutation
4579
+
\f4\fs20 objects, and in the same order, as would be returned by the
4580
+
\f3\fs18 mutations
4581
+
\f4\fs20 property of
4582
+
\f3\fs18 sim
4583
+
\f4\fs20 , in other words. The returned matrix has one column for each individual and one row for each mutation.\
4584
+
For a mutation on a diploid chromosome, the zygosity will be either
4585
+
\f3\fs18 0
4586
+
\f4\fs20 (absent),
4587
+
\f3\fs18 1
4588
+
\f4\fs20 (heterozygous), or
4589
+
\f3\fs18 2
4590
+
\f4\fs20 (homozygous). This is the straightforward \'93base case\'94 that is usually meant by the term \'93zygosity\'94.\
4591
+
If one of the two haplosomes of an intrinsically diploid chromosome is a null haplosome (as would be the case for an X chromosome in a male individual, for example), mutations present in the non-null haplosome are called \'93hemizygous\'94, and the zygosity returned for them is configurable using the
4592
+
\f3\fs18 hemizygousValue
4593
+
\f4\fs20 parameter. By default, the zygosity returned for hemizygous mutations is
4594
+
\f3\fs18 1
4595
+
\f4\fs20 .\
4596
+
Finally, although the term \'93zygosity\'94 is not usually used in the context of haploidy, this method nevertheless supports intrinsically haploid chromosomes; the zygosity returned for mutations present on an intrinsically haploid chromosome is configurable using the
4597
+
\f3\fs18 haploidValue
4598
+
\f4\fs20 parameter. By default, the zygosity returned for haploid mutations is
4599
+
\f3\fs18 1
4600
+
\f4\fs20 .\
4601
+
For a large number of mutations \'96 and especially for a
4602
+
\f3\fs18 mutations
4603
+
\f4\fs20 value of
4604
+
\f3\fs18 NULL
4605
+
\f4\fs20 , representing all mutations in the species \'96 this method should be much more efficient than using methods such as
4606
+
\f3\fs18 containsMutations()
4607
+
\f4\fs20 to assess zygosity. Nevertheless, calculating fitness effects in script based upon zygosity will generally be slower than SLiM\'92s internal fitness calculations. Note that for just one or a few mutations \'96 especially if
4608
+
\f3\fs18 mutations
4609
+
\f4\fs20 contains just a small fraction of all of the mutations in the species \'96 this method will probably be much slower than alternative approaches; this method is optimized for the bulk case.\
4610
+
See also the method
4611
+
\f3\fs18 mutationsFromHaplosomes()
4612
+
\f4\fs20 , which provides an alternative approach for assessing the zygosity of mutations in an individual.\
Copy file name to clipboardExpand all lines: VERSIONS
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,7 @@ multitrait branch:
132
132
add a cachedFitness property to class Individual to provide another way of accessing fitness values for individuals, besides the cachedFitness() method of Subpopulation
133
133
extend the Eidos deleteFile() and fileExists() functions to support passing in a vector of file paths
134
134
extend the Eidos + operator to support adding logical+logical, integer+logical, and logical+integer (all for NxN, 1xN, Nx1), as in R
135
+
add zygosityOfMutations([No<Mutation> mutations = NULL], [integer$ hemizygousValue = 1], [integer$ haploidValue = 1]) for assessing zygosity (see also mutationsFromHaplosomes())
0 commit comments