当你只能接触到某人的有形特征或表型时,他们家族史的谱系通常被用来找出每个家庭成员的实际遗传信息或基因型。
当像我们一样处理简单优势时,一个简单的谱系图就足以找出每个人的等位基因,或者他们所拥有的基因的版本。在简单的支配地位中,拥有显性等位基因(用大写字母表示)的人将始终具有该版本所代表的特征,而不管其他等位基因如何。需要两个隐性等位基因(用小写字母表示)才能表达该版本。换句话说,显性等位基因总是掩盖该基因的隐性版本。下面是一个系谱图的例子:

这里的每一行都是一代人。圆圈是女性,男性是正方形,水平线是婚姻,垂直线条是子女。很简单。黑色指隐性表型,白色,显性。从上面开始,(假设等位基因是A和a),我们知道person 2有aa,纯合隐性,因为这是隐性表型的唯一可能选择。现在,即使一个人可能是Aa或AA都是显性表型,因为他有一个隐性的孩子,他必须是Aa,或杂合子。你可以为其他人这么做。如果您没有任何使您能够计算出第二个等位基因的信息,则可以这样做:A_。
[GenI, GenII, etc.]的任何正常格式的世代列表的形式。A或a。(不,图表上的人数不会超过95人)。A或a,A为显性等位基因,a为隐性等位基因。Aa而不是aA。[["0A1234", "1a0234"], ["2A01", "3a01", "4A015678",
"5a4678"], ["6a45", "7A45","8A45"]] (The one above) ->
[["Aa", "aa"], ["Aa", "aa", "Aa", "aa"], ["aa", "Aa", "Aa"]]
[["0A12", "1A02"], ["2A301", "3a2"]] ->
[["A_", "A_"], ["A_", "aa"]]发布于 2019-11-19 09:50:38
εNUε'aåi„aaë¯.øX<X>‚è˜y2£lSδåPài„Aaë„A_我的Java回答港。
ε # Map over the rows of the (implicit) input-list:
NU # Store the outer-map index in variable `X`
ε # Map over the strings `y` of the current row:
'aåi '# If the current string contains an "a":
„aa # Push string "aa"
ë # Else (it contains an "A" instead):
¯.ø # Surround the (implicit) input-list with two empty lists
# (05AB1E has automatic wrap-around when indexing lists,
# so this is to prevent that)
X<X>‚ # Push `X-1` and `X+1` and pair them together
è # Index both into the list to get (potential) parent and child rows
˜ # Flatten it to a single list
y # Push the current string we're mapping again
2£ # Only leave the first 2 characters (its id and the letter "A")
l # Lowercase the "A" to "a"
S # And convert it to a list of characters: [id, "A"]
δå # Check in each string whether it contains the id and "A"
P # Check for each whether it contained BOTH the id AND "A"
ài # If a child/parent is found for which this is truthy:
„Aa # Push string "Aa"
ë # Else:
„A_ # Push string "A_"
# (after which the mapped result is output implicitly)https://codegolf.stackexchange.com/questions/51658
复制相似问题