Skip to content

Commit

Permalink
Update backSwap.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyBaril committed Apr 30, 2024
1 parent 7718e8f commit 77f7215
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/backSwap.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
orig = dict(csv.reader(open(dictionary), delimiter="\t"))
dict = {value:key for key, value in orig.items()}

table = pd.read_csv(input, names = ['scaf', 'start', 'end', 'repeat', 'score', 'strand'], delim_whitespace = True, header = None)
table = pd.read_csv(input, names = ['scaf', 'start', 'end', 'repeat', 'score', 'strand'], sep='\s+', header = None)
table['scaf'] = table['scaf'].astype(str)
table['scaf'].replace(dict, inplace = True)
# table['scaf'].replace(dict, inplace = True)
table['scaf'] = table['scaf'].replace(dict)

table.to_csv(output, index = False, header = False, sep = '\t')

0 comments on commit 77f7215

Please sign in to comment.