Skip to content

Commit

Permalink
Update polya_umi.py to include a range for seq_nano
Browse files Browse the repository at this point in the history
  • Loading branch information
jencyw committed Aug 11, 2023
1 parent 8d28760 commit 96bfc19
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions tallytrin/python/polya_umi.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,14 @@ def remove_indels(x, umi, first):

for record in fh:
n += 1
seq_nano = record.sequence
seq_nano = record.sequence[-200:]

m=regex.finditer("(GTACTCTGCGTTGATACCACTGCTT){e<=0}", str(record.sequence))
m=regex.finditer("(GTACTCTGCGTTGATACCACTGCTT){e<=0}", seq_nano)


for i in m:
after_polya = seq_nano[i.start()-30:]
umi_polya = seq_nano[i.start()-30:i.start()]

new_umi = []
umi_polya = seq_nano[i.start()-30:i.start()]

umi_polya, errors = remove_point_mutations(umi_polya)

Expand All @@ -124,16 +123,11 @@ def remove_indels(x, umi, first):
else:


after_umi = seq_nano[:i.start()-30]

record_new = record.name + "_" + str(umi_polya)

quality_afterumipolya = record.quality[:i.start()-30]
seq_afterumipolya = seq_nano[:i.start()-30]

if len(umi_polya) == 30:
y += 1
outfile.write("@%s\n%s\n+\n%s\n" % (record_new, seq_afterumipolya, quality_afterumipolya))
outfile.write("@%s\n%s\n+\n%s\n" % (record_new, record.sequence, record.quality))
else:
pass

Expand Down

0 comments on commit 96bfc19

Please sign in to comment.