This repository was archived by the owner on May 2, 2019. It is now read-only.
Open
Conversation
Owner
AleksandrSl
reviewed
Oct 11, 2018
pybedtools_parser.py
Outdated
| # Ignore annotation lines. | ||
| if any(i in line_elements for i in ("#", "browser", "track")): | ||
| continue | ||
| # Check if a non-annotation line if valid. |
pybedtools_parser.py
Outdated
| continue | ||
| # Check if a non-annotation line if valid. | ||
| elif len(line_elements) < 3: | ||
| sys.exit("Program expects a valid BED file with at least 3 columns (chromosome, start and end).\n" |
Owner
There was a problem hiding this comment.
IMHO sys.exit is not the best way. Some kind of error is more suitable.
Python has multiline strings, sot there's no need in \n
pybedtools_parser.py
Outdated
| "Problem in line: %s" % line) | ||
| # End of check | ||
| else: | ||
| # Give "None" name if file is BED3 or doesn't contain name option for other BED types. |
Owner
There was a problem hiding this comment.
I think that following lines will have the same effect without else
AleksandrSl
reviewed
Nov 6, 2018
|
|
||
| def check_len(line): | ||
| try: | ||
| line[2] |
Owner
There was a problem hiding this comment.
Why line, not smth like elements?) And why not if len(line) < 3:
| parsed_data.append(tuple(line_elements[0:5])) | ||
| check_len(line_elements) | ||
| check_int(line_elements) | ||
| parsed_data.append(tuple(line_elements[0:5])) |
Collaborator
Author
There was a problem hiding this comment.
Realised we shoud either take 4 or 6 elements, not 5...
There can be score and strand information. Should we ignore it?
Owner
There was a problem hiding this comment.
Yes, we can ignore it for the moment
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

No description provided.