-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update defaults.py #539
Merged
Merged
Update defaults.py #539
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,9 @@ def setUpModule(): | |
"git clone -b tests --single-branch [email protected]:ISA-tools/ISAdatasets {0}" | ||
.format(utils.DATA_DIR)) | ||
|
||
def replace_windows_newlines(input_string): | ||
return input_string.replace('\r\r\n', '\n').replace('\r\n', '\n').replace('\r', '\n') | ||
|
||
|
||
class TestIsaMerge(unittest.TestCase): | ||
|
||
|
@@ -1069,7 +1072,7 @@ def test_source_protocol_ref_sample(self): | |
i.studies = [s] | ||
expected = """Source Name\tProtocol REF\tSample Name | ||
source1\tsample collection\tsample1""" | ||
self.assertIn(expected, isatab.dumps(i)) | ||
self.assertIn(expected, replace_windows_newlines(isatab.dumps(i))) | ||
|
||
def test_source_protocol_ref_sample_x2(self): | ||
i = Investigation() | ||
|
@@ -1167,7 +1170,7 @@ def test_source_protocol_ref_sample_with_characteristics(self): | |
i.studies = [s] | ||
expected = """Source Name\tCharacteristics[reference descriptor]\tProtocol REF\tSample Name\tCharacteristics[organism part] | ||
source1\tnot applicable\tsample collection\tsample1\tliver""" | ||
self.assertIn(expected, isatab.dumps(i)) | ||
self.assertIn(expected, replace_windows_newlines(isatab.dumps(i))) | ||
|
||
def test_source_protocol_ref_sample_with_parameter_values(self): | ||
i = Investigation() | ||
|
@@ -1188,7 +1191,7 @@ def test_source_protocol_ref_sample_with_parameter_values(self): | |
i.studies = [s] | ||
expected = """Source Name\tProtocol REF\tParameter Value[temperature]\tSample Name | ||
source1\tsample collection\t10\tsample1""" | ||
self.assertIn(expected, isatab.dumps(i)) | ||
self.assertIn(expected, replace_windows_newlines(isatab.dumps(i))) | ||
|
||
def test_source_protocol_ref_sample_with_factor_values(self): | ||
i = Investigation() | ||
|
@@ -1216,11 +1219,11 @@ def test_source_protocol_ref_sample_with_factor_values(self): | |
s.assays = [a] | ||
expected_study_table = """Source Name\tProtocol REF\tSample Name\tFactor Value[study group] | ||
source1\tsample collection\tsample1\tStudy group 1""" | ||
self.assertIn(expected_study_table, isatab.dumps(i)) | ||
self.assertIn(expected_study_table, replace_windows_newlines(isatab.dumps(i))) | ||
expected_assay_table = """Sample Name\tFactor Value[study group]\tProtocol REF | ||
sample1\tStudy group 1\textraction""" | ||
self.assertIn(expected_assay_table, | ||
isatab.dumps(i, write_fvs_in_assay_table=True)) | ||
replace_windows_newlines(isatab.dumps(i, write_fvs_in_assay_table=True))) | ||
|
||
def test_source_protocol_ref_protocol_ref_sample(self): | ||
i = Investigation() | ||
|
@@ -1239,7 +1242,7 @@ def test_source_protocol_ref_protocol_ref_sample(self): | |
i.studies = [s] | ||
expected = """Source Name\tProtocol REF\tProtocol REF\tSample Name | ||
source1\tsample collection\taliquoting\taliquot1""" | ||
self.assertIn(expected, isatab.dumps(i)) | ||
self.assertIn(expected, replace_windows_newlines(isatab.dumps(i))) | ||
|
||
def test_source_protocol_ref_sample_protocol_ref_sample(self): | ||
i = Investigation() | ||
|
@@ -1261,7 +1264,7 @@ def test_source_protocol_ref_sample_protocol_ref_sample(self): | |
i.studies = [s] | ||
expected = """Source Name\tProtocol REF\tSample Name\tProtocol REF\tSample Name | ||
source1\tsample collection\tsample1\taliquoting\taliquot1""" | ||
self.assertIn(expected, isatab.dumps(i)) | ||
self.assertIn(expected, replace_windows_newlines(isatab.dumps(i))) | ||
|
||
def test_sample_protocol_ref_material_protocol_ref_data2(self): | ||
i = Investigation() | ||
|
@@ -1295,7 +1298,7 @@ def test_sample_protocol_ref_material_protocol_ref_data2(self): | |
i.studies = [s] | ||
expected = (f"""Sample Name\tProtocol REF\tExtract Name\tProtocol REF\tAssay Name\tRaw Data File\tComment[checksum type]\tComment[checksum]\n""" + | ||
f"""sample1\textraction\textract1\tnucleic acid sequencing\tassay-1\tdatafile.raw\t{cs_comment1.value}\t{cs_comment2.value}""") | ||
self.assertIn(expected, isatab.dumps(i)) | ||
self.assertIn(expected, replace_windows_newlines(isatab.dumps(i))) | ||
|
||
def test_sample_protocol_ref_material_protocol_ref_data3(self): | ||
i = Investigation() | ||
|
@@ -1334,7 +1337,7 @@ def test_sample_protocol_ref_material_protocol_ref_data3(self): | |
|
||
# self.assertIn(expected_line1, dump_out) | ||
# self.assertIn(expected_line2, dump_out) | ||
self.assertIn(expected, isatab.dumps(i)) | ||
self.assertIn(expected, replace_windows_newlines(isatab.dumps(i))) | ||
|
||
def test_sample_protocol_ref_material_protocol_ref_data4(self): | ||
i = Investigation() | ||
|
@@ -1373,7 +1376,7 @@ def test_sample_protocol_ref_material_protocol_ref_data4(self): | |
|
||
# self.assertIn(expected_line1, dump_out) | ||
# self.assertIn(expected_line2, dump_out) | ||
self.assertIn(expected, isatab.dumps(i)) | ||
self.assertIn(expected, replace_windows_newlines(isatab.dumps(i))) | ||
|
||
def test_sample_protocol_ref_material_protocol_ref_data_x2(self): | ||
i = Investigation() | ||
|
@@ -1710,7 +1713,7 @@ def test_isatab_preprocess_issue235(self): | |
test_isatab_str = b""""Sample Name" "Protocol REF" "Parameter Value[medium]" "Term Source REF" "Term Accession Number" "Parameter Value[serum]" "Term Source REF" "Term Accession Number" "Parameter Value[serum concentration]" "Unit" "Term Source REF" "Term Accession Number" "Parameter Value[medium volume]" "Unit" "Term Source REF" "Term Accession Number" "Parameter Value[migration modulator]" "Term Source REF" "Term Accession Number" "Parameter Value[modulator concentration]" "Unit" "Term Source REF" "Term Accession Number" "Parameter Value[modulator distribution]" "Term Source REF" "Term Accession Number" "Protocol REF" "Parameter Value[imaging technique]" "Term Source REF" "Term Accession Number" "Parameter Value[imaging technique temporal feature]" "Term Source REF" "Term Accession Number" "Parameter Value[acquisition duration]" "Unit" "Term Source REF" "Term Accession Number" "Parameter Value[time interval]" "Unit" "Term Source REF" "Term Accession Number" "Parameter Value[objective type]" "Term Source REF" "Term Accession Number" "Parameter Value[objective magnification]" "Term Source REF" "Term Accession Number" "Parameter Value[objective numerical aperture]" "Term Source REF" "Term Accession Number" "Parameter Value[acquisition channel count]" "Term Source REF" "Term Accession Number" "Parameter Value[reporter]" "Term Source REF" "Term Accession Number" "Parameter Value[voxel size]" "Unit" "Term Source REF" "Term Accession Number" "Assay Name" "Raw Data File" "Protocol REF" "Parameter Value[software]" "Term Source REF" "Term Accession Number" "Data Transformation Name" "Derived Data File" | ||
"culture1" "migration assay" "RPMI-1640" "" "" "Heat Inactivated Fetal Bovine Serum " "" "" "10" "%" "UO" "http://purl.obolibrary.org/obo/UO_0000165" "300" "microliter" "UO" "http://purl.obolibrary.org/obo/UO_0000101" "" "" "" "" "" "" "" "gradient" "" "" "imaging" "phase-contrast microscopy" "" "" "dynamic" "" "" "6" "hour" "UO" "http://purl.obolibrary.org/obo/UO_0000032" "15" "minute" "UO" "http://purl.obolibrary.org/obo/UO_0000031" "" "" "" "20" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "culture1" "" "data transformation" "CELLMIA" "" "" "" "" | ||
""" | ||
with tempfile.NamedTemporaryFile() as tmp: | ||
with tempfile.NamedTemporaryFile(delete=False) as tmp: | ||
tmp.write(test_isatab_str) | ||
tmp.seek(0) | ||
study_assay_parser = isatab_parser.StudyAssayParser('mock.txt') | ||
|
@@ -1719,6 +1722,7 @@ def test_isatab_preprocess_issue235(self): | |
if """Protocol REF\tData Transformation Name""" in header: | ||
self.fail('Incorrectly inserted Protocol REF before ' | ||
'Data Transformation Name') | ||
os.remove(tmp.name) | ||
|
||
def test_isatab_factor_value_parsing_issue270(self): | ||
with open(os.path.join(self._tab_data_dir, 'issue270', 'i_matteo.txt'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two DOIs were actually valid, this is why there's only 10 warnings left instead of 12