Skip to content

Commit

Permalink
removed bioalphabet
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawkey committed Jul 13, 2021
1 parent 9e5a3e7 commit 5c865ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions scripts/create_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
from run_commands import run_command

class RemovedHit(object):
Expand Down Expand Up @@ -336,7 +335,7 @@ def check_seq_between(genbank_seq, insertion, start, end, name, temp):
# Get sequence between left and right ends
seq_between = genbank_seq[start:end]
# Turn the sequence into a fasta file
seq_between = SeqRecord(Seq(str(seq_between), generic_dna), id=name)
seq_between = SeqRecord(Seq(str(seq_between)), id=name)
out_seq_between = os.path.join(temp, name + '.fasta')
out_insertion = os.path.join(temp, name + 'ISseq.fasta')
SeqIO.write(seq_between, out_seq_between, 'fasta')
Expand Down
5 changes: 2 additions & 3 deletions scripts/mapping_to_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import shlex
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
import logging
from subprocess import Popen, PIPE
from run_commands import run_command, CommandError, make_directories
Expand Down Expand Up @@ -141,7 +140,7 @@ def extract_clipped_reads(sam_file, min_size, max_size, out_left_file, out_right
if map_regions[0][-1] == 'S':
num_soft_clipped = int(map_regions[0][:-1])
if min_size <= num_soft_clipped <= max_size:
soft_clipped_seq = Seq(entries[9][:num_soft_clipped], generic_dna)
soft_clipped_seq = Seq(entries[9][:num_soft_clipped])
qual_scores = entries[10][:num_soft_clipped]
if reverse_complement:
out_left.write('@' + read_name + '\n' + str(soft_clipped_seq.reverse_complement()) + '\n+\n' + qual_scores[::-1] + '\n')
Expand All @@ -150,7 +149,7 @@ def extract_clipped_reads(sam_file, min_size, max_size, out_left_file, out_right
if map_regions[-1][-1] == 'S':
num_soft_clipped = int(map_regions[-1][:-1])
if min_size <= num_soft_clipped <= max_size:
soft_clipped_seq = Seq(entries[9][-num_soft_clipped:], generic_dna)
soft_clipped_seq = Seq(entries[9][-num_soft_clipped:])
qual_scores = entries[10][-num_soft_clipped:]
if reverse_complement:
out_right.write('@' + read_name + '\n' + str(soft_clipped_seq.reverse_complement()) + '\n+\n' + qual_scores[::-1] + '\n')
Expand Down

0 comments on commit 5c865ce

Please sign in to comment.