Skip to content

Commit

Permalink
remove strand offset from protein schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgowan committed Jul 28, 2020
1 parent e4b3ab6 commit 1dff613
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fastg2protlib/protein_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,15 @@ def _write_protein_scores(p_scores):
def _write_fasta(p_scores):
with open("protein.fasta", "w") as f:
for ps in p_scores:
s = f"SELECT sequence, start, stop, strand FROM protein WHERE id = {ps.protein_id}"
s = f"SELECT sequence FROM protein WHERE id = {ps.protein_id}"
rs = _query_db(s)
results = rs.fetchone()
sequence = results[0]
start_offset = results[1]
stop_offset = results[2]
strand_id = results[3]
rs = _query_db(
f"SELECT walk FROM walk WHERE id IN (SELECT walk_id FROM protein_to_walk WHERE protein_id = {ps.protein_id})"
)
f.write(
f">Protein_{ps.protein_id}|{rs.fetchone()[0]}_start:{start_offset}_stop:{stop_offset}_strand:{strand_id}"
f">Protein_{ps.protein_id}|{rs.fetchone()[0]}"
)
f.write(os.linesep)
f.write(f"{sequence}")
Expand Down

0 comments on commit 1dff613

Please sign in to comment.