Skip to content

Commit

Permalink
Remember intact sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Jul 21, 2023
1 parent 7f4eba1 commit 891b4a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gene_splicer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,17 @@ def translate_hivintact_error(error):
]

def iterate_hivintact_data(name, outpath):
intact = {}
for d in glob.glob(str(outpath / 'hivintact*')):
for (SEQID, sequence) in read_fasta(os.path.join(d, 'intact.fasta')):
row = [SEQID, 'Intact']
intact[SEQID] = True
yield row

with open(os.path.join(d, 'errors.json'), 'r') as f:
js = json.load(f)
for SEQID in js:
if SEQID in intact: continue
all_errors = [obj.get('error') for obj in js[SEQID] if 'error' in obj]
if all_errors:
ordered = sorted(all_errors, key=HIVINTACT_ERRORS_TABLE.index)
Expand Down

0 comments on commit 891b4a8

Please sign in to comment.