Skip to content

Commit

Permalink
Merge pull request #76 from ypriverol/master
Browse files Browse the repository at this point in the history
bug fix when only one factor value is provided
  • Loading branch information
ypriverol authored Feb 17, 2021
2 parents 53a5aab + 5406d57 commit a4867e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 4 additions & 5 deletions sdrf_pipelines/openms/openms.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,12 @@ def openms_convert(self, sdrf_file: str = None, keep_raw: bool = False, one_tabl
c.startswith('comment[modification parameters')] # columns with modification parameters

if not split_by_columns:
# get factor columns (except constant ones)

factor_cols = [c for ind, c in enumerate(sdrf) if
c.startswith('factor value[') and len(sdrf[c].unique()) > 1]
c.startswith('factor value[') and len(sdrf[c].unique()) >= 1]

# get characteristics columns (except constant ones)
characteristics_cols = [c for ind, c in enumerate(sdrf) if
c.startswith('characteristics[') and len(sdrf[c].unique()) > 1]
c.startswith('characteristics[') and len(sdrf[c].unique()) >= 1]
# and remove characteristics columns already present as factor
characteristics_cols = self.removeRedundantCharacteristics(characteristics_cols, sdrf, factor_cols)
print('Factor columns: ' + str(factor_cols))
Expand Down Expand Up @@ -358,7 +357,7 @@ def removeRedundantCharacteristics(self, characteristics_cols, sdrf, factor_cols
def reportWarnings(self, sdrf_file):
if len(self.warnings) != 0:
for k, v in self.warnings.items():
print('WARNING: "' + k + '" occured ' + str(v) + ' times.')
print('WARNING: "' + k + '" occurred ' + str(v) + ' times.')
print("SUCCESS (WARNINGS=" + str(len(self.warnings)) + "): " + sdrf_file)

def writeTwoTableExperimentalDesign(self, output_filename, sdrf, file2technical_rep, source_name_list,
Expand Down
4 changes: 1 addition & 3 deletions sdrf_pipelines/tests/sdrfchecker_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

def test_validate_srdf():
"""
Test the default behaviour of the vcf-to-proteindb tool
:return:
"""
runner = CliRunner()
Expand All @@ -17,11 +16,10 @@ def test_validate_srdf():

def test_convert_openms():
"""
Test the default behaviour of the vcf-to-proteindb tool
:return:
"""
runner = CliRunner()
result = runner.invoke(cli, ['convert-openms', '-t2', '-l', '-s', 'testdata/sdrf.tsv'])
result = runner.invoke(cli, ['convert-openms', '-t2', 'l', '-s', 'testdata/sdrf.tsv'])
print('convert to openms' + result.output)
assert 'ERROR' not in result.output

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="sdrf-pipelines",
version="0.0.12",
version="0.0.13",
author="BigBio Team",
author_email="ypriverol@gmail.com",
description="Translate, convert SDRF to configuration pipelines",
Expand Down

0 comments on commit a4867e6

Please sign in to comment.