-
Notifications
You must be signed in to change notification settings - Fork 2
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
plate ID and empty metadata parsing #14
Conversation
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.
Minor comments about syntax.
plate_mapper/plate_mapper.py
Outdated
@@ -110,7 +117,7 @@ def plate_mapper(input_f, barseq_f, output_f, names_f=None, special_f=None): | |||
for line in special_f: | |||
line = line.rstrip() | |||
l = line.split('\t') | |||
if len(l) < 4: | |||
if len(l) < 3: |
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.
Can you add a comment about what this number is supposed to be?
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.
Sure! Will do. @mortonjt
plate_mapper/plate_mapper.py
Outdated
@@ -127,19 +134,22 @@ def plate_mapper(input_f, barseq_f, output_f, names_f=None, special_f=None): | |||
# [ barcode sequence, linker primer sequence, primer plate #, well ID ] | |||
sample, property = '', [] | |||
if plate in plates: | |||
id = primer2plate[plate] |
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.
This is not recommended, since id is a reserved keyword. One option is to rename this variable to id_
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.
How about "pid" (plate ID)?
plate_mapper/plate_mapper.py
Outdated
@@ -127,19 +134,22 @@ def plate_mapper(input_f, barseq_f, output_f, names_f=None, special_f=None): | |||
# [ barcode sequence, linker primer sequence, primer plate #, well ID ] | |||
sample, property = '', [] |
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.
Too bad we didn't catch this last time. property is also a reserved keyword. This should be replace with something like property_
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.
How about "metadata"?
plate_mapper/plate_mapper.py
Outdated
sample = '%s%s.%s' % (specs[sample]['name'], plate, well) | ||
if specs[sample]['property']: | ||
# replace property if available | ||
property = specs[sample]['property'] |
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.
same here
plate_mapper/plate_mapper.py
Outdated
@@ -127,19 +134,22 @@ def plate_mapper(input_f, barseq_f, output_f, names_f=None, special_f=None): | |||
# [ barcode sequence, linker primer sequence, primer plate #, well ID ] | |||
sample, property = '', [] | |||
if plate in plates: | |||
id = primer2plate[plate] | |||
if well in plates[plate]: | |||
sample, property = plates[plate][well], properties[plate] |
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.
same here
plate_mapper/plate_mapper.py
Outdated
if specs[sample]['property']: | ||
# replace property if available | ||
property = specs[sample]['property'] | ||
sample = '%s%s.%s' % (specs[sample]['name'], id, well) | ||
else: | ||
# normal sample name | ||
samples.append(sample) | ||
elif '' in specs: | ||
# empty well (if defined as a special sample) | ||
property = specs['']['property'] |
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.
same here
+1
…On Wed, Feb 8, 2017 at 11:46 AM, Qiyun Zhu ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In plate_mapper/plate_mapper.py
<#14>:
> @@ -127,19 +134,22 @@ def plate_mapper(input_f, barseq_f, output_f, names_f=None, special_f=None):
# [ barcode sequence, linker primer sequence, primer plate #, well ID ]
sample, property = '', []
if plate in plates:
+ id = primer2plate[plate]
How about "pid" (plate ID)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD_a3fqzH01Po96MZYAby4LNEpkR-cWCks5raht6gaJpZM4L6Oit>
.
|
+1
…On Wed, Feb 8, 2017 at 11:45 AM, Qiyun Zhu ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In plate_mapper/plate_mapper.py
<#14>:
> @@ -127,19 +134,22 @@ def plate_mapper(input_f, barseq_f, output_f, names_f=None, special_f=None):
# [ barcode sequence, linker primer sequence, primer plate #, well ID ]
sample, property = '', []
How about "metadata"?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD_a3TxrKZnpPVXydTf5l3eHsIU8TBjEks5rahtqgaJpZM4L6Oit>
.
|
1 similar comment
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.
Only one minor comment
plate_mapper/plate_mapper.py
Outdated
@@ -73,16 +75,21 @@ def plate_mapper(input_f, barseq_f, output_f, names_f=None, special_f=None): | |||
elif int(v) != cols+1: | |||
raise ValueError('Error: column headers are not ' | |||
'incremental integers.') | |||
# get plate ID (trailing numeric part) | |||
for i in reversed(l[0]): |
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.
I'm pretty sure this look can be replaced with a regex, but at the sametime, I'm not very concerned about the logic
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.
@wasade Thanks for the comment! I love regex because I was a Perl person. Here I chose this way so that I don't have to import re
. Let's leave it as is?
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.
re comes bundled with the python standard library - so importing it shouldn't be a problem.
Upon the requests from the wet lab crew, I modified two functions:
Please let me know if you have any comments. Thank you!
@wasade @mortonjt @josenavas @antgonza @sjanssen2