Skip to content

Commit

Permalink
Added sorted outputs to improve handling in IGV
Browse files Browse the repository at this point in the history
-> Fix #55
  • Loading branch information
basti committed Jan 11, 2019
1 parent 97c526d commit 6ed7d98
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion bin/3.1_create_gtf/Modules/Validator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import os


class Validator:

"""
Class to validate the gtf-output-file.
Class to validate and sort the gtf-output-file.
@author: Sebastian Beyvers
@contact: sebastian.beyvers@med.uni-giessen.de
Expand All @@ -13,8 +16,17 @@ def __init__(self, out_file):
# input_parameter: out_file = path to output file

self.out_file = out_file
self.sort_file()
self.test_read_file()

def sort_file(self):

# function that utilizes linux sort to sort the output by chromosome and start coordinate,
# this improves handling in tools like IGV

command = "sort -V -k1,1 -k4,4n -o "+self.out_file+" "+self.out_file
os.system(command)

def test_read_file(self):

# Method to test the output file-format
Expand Down

0 comments on commit 6ed7d98

Please sign in to comment.