Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
master_project_JLU2018/bin/3.1_create_gtf/Modules/Validator.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
35 lines (25 sloc)
972 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Validator: | |
""" | |
Class to validate the gtf-output-file. | |
@author: Sebastian Beyvers | |
@contact: sebastian.beyvers@med.uni-giessen.de | |
""" | |
def __init__(self, out_file): | |
# Constructor | |
# input_parameter: out_file = path to output file | |
self.out_file = out_file | |
self.test_read_file() | |
def test_read_file(self): | |
# Method to test the output file-format | |
with open(self.out_file) as outfile: | |
line = outfile.readline() | |
if line: | |
if len(line.split("\t")) == 9: | |
print("Validation complete no errors found !") | |
else: | |
print("Incorrect output Format: Try again after deleting data folder.") | |
else: | |
print("Outputfile not in correct Format: Try again after deleting data Folder.") | |
exit(1) | |
# Debug | |
# v = Validator("/home/basti/Schreibtisch/test_hg38.gtf") |