Skip to content

Commit

Permalink
adding in tumor_f_star column for CGA pipeline (the column remains op…
Browse files Browse the repository at this point in the history
…tional)
  • Loading branch information
[email protected] committed Apr 1, 2019
1 parent 7d53018 commit 876672d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions deTiN/deTiN.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, args, ascna_probe_number_filter=200, ascna_SNP_number_filter=
def read_call_stats_file(self):
fields = ['contig', 'position', 'ref_allele', 'alt_allele', 'tumor_name', 'normal_name', 't_alt_count',
't_ref_count'
, 'n_alt_count', 'n_ref_count', 'failure_reasons', 'judgement']
, 'n_alt_count', 'n_ref_count', 'failure_reasons', 'judgement','t_lod_fstar']
fields_type = {'contig': str, 'position': np.int, 'ref_allele': str, 'alt_allele': str, 'tumor_name': str,
'normal_name': str,
't_alt_count': np.int, 't_ref_count': np.int, 'n_alt_count': np.int, 'n_ref_count': np.int,
Expand All @@ -105,8 +105,15 @@ def read_call_stats_file(self):
self.call_stats_table = pd.read_csv(self.call_stats_file, '\t', index_col=False,
comment='#', usecols=fields, dtype=fields_type)
except (ValueError, LookupError):
print 'Error reading call stats skipping first two rows and trying again'
self.call_stats_table = pd.read_csv(self.call_stats_file, '\t', index_col=False,
try:
fields = ['contig', 'position', 'ref_allele', 'alt_allele', 'tumor_name', 'normal_name', 't_alt_count',
't_ref_count'
, 'n_alt_count', 'n_ref_count', 'failure_reasons', 'judgement']
self.call_stats_table = pd.read_csv(self.call_stats_file, '\t', index_col=False,
comment='#', usecols=fields, dtype=fields_type)
except (ValueError, LookupError):
print 'Error reading call stats skipping first two rows and trying again'
self.call_stats_table = pd.read_csv(self.call_stats_file, '\t', index_col=False,
comment='#', skiprows=2, usecols=fields, dtype=fields_type)
if type(self.call_stats_table['contig'][0]) == str:
self.call_stats_table['Chromosome'] = du.chr2num(np.array(self.call_stats_table['contig']))
Expand Down

0 comments on commit 876672d

Please sign in to comment.