Skip to content

Commit

Permalink
Report is_rev_comp in outcome_summary.csv, as part of #7.
Browse files Browse the repository at this point in the history
  • Loading branch information
donkirkby committed Apr 26, 2021
1 parent dc8cd71 commit ceac503
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions gene_splicer/outcome_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def set_passed(self, row):
self.data[row['sample']]['conseq_passed'] = True
self.data[row['sample']]['sequence'] = row['sequence']
self.data[row['sample']]['seqtype'] = row['seqtype']
self.data[row['sample']]['is_rev_comp'] = row['is_rev_comp']

def set_failed(self, row, error):
logger.critical('Sample "%s" already has a passed sequence!' %
Expand All @@ -52,20 +53,14 @@ def set_failed(self, row, error):
def add_failure(self, row, seqtype):
nfailed = len(self.data[row['sample']]['failed'])
self.data[row['sample']]['failed'].append({
f'fail_error_{nfailed}':
row['error'],
f'fail_fwd_err_{nfailed}':
row['fwd_error'],
f'fail_rev_err_{nfailed}':
row['rev_error'],
f'fail_seqtype_{nfailed}':
seqtype,
f'fail_seqlen_{nfailed}':
row['seqlen'],
f'fail_sequence_{nfailed}':
row['sequence'],
f'fail_ref_{nfailed}':
row['reference']
f'fail_error_{nfailed}': row['error'],
f'fail_fwd_err_{nfailed}': row['fwd_error'],
f'fail_rev_err_{nfailed}': row['rev_error'],
f'fail_seqtype_{nfailed}': seqtype,
f'fail_is_rev_comp_{nfailed}': row['is_rev_comp'],
f'fail_seqlen_{nfailed}': row['seqlen'],
f'fail_sequence_{nfailed}': row['sequence'],
f'fail_ref_{nfailed}': row['reference']
})

def handle_edge_cases(self, row):
Expand Down Expand Up @@ -162,7 +157,7 @@ def process_contigs(self, contigs_df):
def write(self):
fieldnames = [
'sample', 'run', 'passed', 'error', 'reference', 'seqtype',
'seqlen', 'sequence', 'fwd_err', 'rev_err'
'is_rev_comp', 'seqlen', 'sequence', 'fwd_err', 'rev_err'
]

# Write the rows
Expand Down Expand Up @@ -280,6 +275,7 @@ def reduce(self):
error_row = conseq_failures[0]
for field_name in ('ref',
'seqtype',
'is_rev_comp',
'seqlen',
'sequence',
'fwd_err',
Expand Down

0 comments on commit ceac503

Please sign in to comment.