Skip to content
Snippets Groups Projects

Update consistency checks to be fully in python.

Merged Venkat Malladi requested to merge 60-consistency_tests into develop
@@ -4,6 +4,7 @@ import pytest
import pandas as pd
from io import StringIO
import os
import json
test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
'/../../'
@@ -13,23 +14,21 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
def test_consistencySE():
assert os.path.exists(os.path.join(
test_output_path, 'SE_multiqc_data.json'))
assert readAssigned("assignedSE.txt", "assignedExpectSE.txt")
with open(os.path.join(
test_output_path, 'SE_multiqc_data.json')) as f:
assigned_reads_json = json.load(f)
assigned_reads = assigned_reads_json['report_general_stats_data'][4]['16-1ZX4']['Assigned']
assert assigned_reads == 7742416
@pytest.mark.consistencyPE
def test_consistencyPE():
assert os.path.exists(os.path.join(
test_output_path, 'PE_multiqc_data.json'))
assert readAssigned("assignedPE.txt", "assignedExpectPE.txt")
def readAssigned(fileAssigned, fileExpectAssigned):
data = False
assigned = open(fileAssigned, "r")
expect = open(fileExpectAssigned, "r")
lineAssigned = assigned.readline()
lineExpect = expect.readline()
if int(lineAssigned.strip()) < (int(lineExpect.strip())+(int(lineExpect.strip())*0.00001)) and int(lineAssigned.strip()) > (int(lineExpect.strip())-(int(lineExpect.strip())*0.00001)):
data = True
return data
with open(os.path.join(
test_output_path, 'PE_multiqc_data.json')) as f:
assigned_reads_json = json.load(f)
assigned_reads = assigned_reads_json['report_general_stats_data'][4]['Q-Y5JA']['Assigned']
assert assigned_reads == 2599149