Skip to content
This repository was archived by the owner on May 2, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions bed_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import sys

def bed_parser(bfile):
output_data = []
with open(bfile) as bed_data:
for line in bed_data.input():
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Input can be omitted

try:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation

line = bed_data.stdin.readline()
if not line:
break
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't really understand what this code do )
To read file usually you do:

with open(file) as in_f:
    for line in in_f:
        do_what_you_want_with_line(line)

Copy link
Collaborator Author

@DariaGorbach DariaGorbach Oct 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's supposed to be a verification, whether file contains lines or not

return
for line in bed_data.input():
if len(bed_data) < 3:
break
else:
continue
for element in range(len(bed_data)):
output_data.append(turple(element[0:5]))
return output_data