Skip to content

Commit

Permalink
Merge pull request #38 from bigbio/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
husensofteng authored Feb 15, 2021
2 parents 4e61ebf + d62f1ee commit dbbe330
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## [v0.0.13](https://github.com/bigbio/py-pgatk/tree/v0.0.13) (2021-02-15)

## [v0.0.12](https://github.com/bigbio/py-pgatk/tree/v0.0.12) (2021-02-11)

## [v0.0.11](https://github.com/bigbio/py-pgatk/tree/v0.0.11) (2021-02-07)
Expand Down
11 changes: 7 additions & 4 deletions pypgatk/cgenomes/cgenomes_proteindb.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def cosmic_to_proteindb(self):
line_counter += 1
row = line.strip().split("\t")
# filter out mutations from unspecified groups
if filter_col:
if filter_col is not None:
if row[filter_col] not in self._accepted_values and self._accepted_values != ['all']:
continue

Expand Down Expand Up @@ -221,7 +221,7 @@ def cosmic_to_proteindb(self):
output.write(entry)
mutation_dic[header] = 1

if self._split_by_filter_column and filter_col:
if self._split_by_filter_column and filter_col is not None:
try:
groups_mutations_dict[row[filter_col]][header] = entry
except KeyError:
Expand Down Expand Up @@ -262,8 +262,10 @@ def get_value_per_sample(self, local_clinical_sample_file, filter_column):
# check for header and re-assign columns
if 'SAMPLE_ID' in sl and filter_column in sl:
filter_column_col, sample_id_col = self.get_sample_headers(sl, filter_column)
if filter_column_col and sample_id_col:
if filter_column_col is not None and sample_id_col is not None:
sample_value[sl[sample_id_col]] = sl[filter_column_col].strip().replace(' ', '_')
else:
print("No column was for {}, {} in {}".format(filter_column, 'SAMPLE_ID', local_clinical_sample_file))
return sample_value

@staticmethod
Expand Down Expand Up @@ -299,6 +301,7 @@ def cbioportal_to_proteindb(self):
if self._accepted_values != ['all'] or self._split_by_filter_column:
if self._local_clinical_sample_file:
sample_groups_dict = self.get_value_per_sample(self._local_clinical_sample_file, self._filter_column)
print('sample_groups_dict', self._local_clinical_sample_file, self._filter_column)
if sample_groups_dict == {}:
return
else:
Expand Down Expand Up @@ -353,7 +356,7 @@ def cbioportal_to_proteindb(self):
try:
seq = seq_dic[enst]
except KeyError:
print("%s not found:" % enst)
print("No matching recored for gene ({}) from row {} in FASTA file:".format(enst, row))
continue

if ":" in pos:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def readme():


setup(name='pypgatk',
version='0.0.13',
version='0.0.14',
description='Python tools for proteogenomics',
url='http://github.com/bigbio/py-pgatk',
long_description=readme(),
Expand Down

0 comments on commit dbbe330

Please sign in to comment.