def base_complement(k):
""" Return complement of base.
Performs the subsitutions: A<=>T, C<=>G, X=>X for both upper and lower
case. The return value is identical to the argument for all other values.
:param k: A base.
:returns: Complement of base.
:rtype: str
"""
try:
return comp[k]
except KeyError:
sys.stderr.write(
"WARNING: No reverse complement for {} found, returning argument.".format(k))
return k
评论列表
文章目录