Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

Commit

Permalink
Deactivated sequence retrieval from DAS if no network connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggirelli committed Feb 7, 2019
1 parent c2c32c1 commit 1a8f91d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bin/ifpd_mkdb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ bed = UCSCbed(args.bedFile,
oligoGenerator = bed.buffer(False, args.enforceBED3)
if args.retainSequences:
logging.info("Enabled sequence retrieval from UCSC...")
oligoGenerator = UCSCbed.add_sequence_to_raw_record(oligoGenerator)
oligoGenerator = UCSCbed.add_sequence_to_raw_record(
oligoGenerator, args.hasNetwork)

logging.info("Writing database...")
chromList = set()
Expand Down
4 changes: 2 additions & 2 deletions ifpd/bioext.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def parse_bed_line(line, enforceBED3 = False, incrementChromEnd = False):
return(lineDF)

@staticmethod
def add_sequence_to_raw_record(bedRecords):
def add_sequence_to_raw_record(bedRecords, hasNetwork = False):
for record in bedRecords:
assert type("") == type(record)
record = record.strip().split("\t")
Expand All @@ -114,7 +114,7 @@ def add_sequence_to_raw_record(bedRecords):
assert_msg += f" {len(record)} found."
assert 3 <= len(record), assert_msg

if 4 > len(record):
if 4 > len(record) and hasNetwork:
oligoSequence = fp.web.get_sequence_from_UCSC(
(record[0], int(record[1]), int(record[2])), args.refGenome)
record.append(oligoSequence)
Expand Down

0 comments on commit 1a8f91d

Please sign in to comment.