-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wegene_utils.py #2
Open
yhlhhhhh
wants to merge
6
commits into
wegene-llc:master
Choose a base branch
from
yhlhhhhh:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
新定义了Get_MT(),Get_Simple_MT(length),Get_Y(),Get_Simple_Y(length)四种函数,方便了对于输入单倍群的处理
xraywu
suggested changes
Apr 25, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 请勿使用全局变量
- 实际逻辑有误,比如 Get_Simple_Y() 中 counter 初始化为 0,length != 1 时不可能进入循环,见下方 DEMO
def Get_Simple_Y(length, user_y):
if len(user_y) == 1:
Simple_y = user_y
else:
letter_list = re.split('\d',user_y)
number_list = re.split('\D',user_y)
counter = 0
Simple_y = ''
while length - 1 == counter:
if isinstance(counter,int) == True:
Simple_y += letter_list[counter]
counter += 1
else:
Simple_y += number_list[counter]
return Simple_y
print(Get_Simple_Y(2,'E1b1a1a1a2a1a3a2a1a10'))
- 实际情况中单倍群命名更复杂,比如 MT 的 L1’2’3’4’5’6、Y 的 CT 等,边缘情况均未处理
- 请 follow 项目的代码风格及命名规则
好的👌我有时间再改改,谢谢(≧∇≦)/ |
目前先把get_mt( ),get_y( )和to_markdown_table( )这三个函数加上,先用着吧吧,get_simple_mt( )和get_simple_y( )这两个函数可能还要修改一段时间。
目前先加这三个函数先用着:get_mt( ), get_y( ), to_markdown_table( ) get_simple_mt( ), get_simple_y( )稍后再加
Add 5 functions: get_mt( ), get_y( ), get_simple_mt( ), get_simple_y( ), to_markdown_table( )
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
新定义了Get_MT(),Get_Simple_MT(length),Get_Y(),Get_Simple_Y(length)四种函数,方便了对于输入单倍群的处理