1313from isatools .model import *
1414from isatools .tests .utils import assert_tab_content_equal
1515from isatools .tests import utils
16+ from isatools .isatab import IsaTabDataFrame
1617
1718
1819def setUpModule ():
@@ -911,8 +912,7 @@ def test_source_protocol_ref_sample(self):
911912 factory = ProcessSequenceFactory (study_protocols = [Protocol (name = "sample collection" )])
912913 table_to_load = """Source Name\t Protocol REF\t Sample Name
913914source1\t sample collection\t sample1"""
914- DF = pd .read_csv (StringIO (table_to_load ), sep = '\t ' )
915- DF .isatab_header = ["Source Name" , "Protocol REF" , "Sample Name" ]
915+ DF = IsaTabDataFrame (pd .read_csv (StringIO (table_to_load ), sep = '\t ' ))
916916 so , sa , om , d , pr , _ , __ = factory .create_from_df (DF )
917917 self .assertEqual (len (so ), 1 )
918918 self .assertEqual (len (sa ), 1 )
@@ -925,8 +925,7 @@ def test_source_protocol_ref_sample_x2(self):
925925 table_to_load = """Source Name\t Protocol REF\t Sample Name
926926source1\t sample collection\t sample1
927927source2\t sample collection\t sample2"""
928- DF = pd .read_csv (StringIO (table_to_load ), sep = '\t ' )
929- DF .isatab_header = ["Source Name" , "Protocol REF" , "Sample Name" ]
928+ DF = IsaTabDataFrame (pd .read_csv (StringIO (table_to_load ), sep = '\t ' ))
930929 so , sa , om , d , pr , _ , __ = factory .create_from_df (DF )
931930 self .assertEqual (len (so ), 2 )
932931 self .assertEqual (len (sa ), 2 )
@@ -939,8 +938,7 @@ def test_source_protocol_ref_split_sample(self):
939938 table_to_load = """Source Name\t Protocol REF\t Sample Name
940939source1\t sample collection\t sample1
941940source1\t sample collection\t sample2"""
942- DF = pd .read_csv (StringIO (table_to_load ), sep = '\t ' )
943- DF .isatab_header = ["Source Name" , "Protocol REF" , "Sample Name" ]
941+ DF = IsaTabDataFrame (pd .read_csv (StringIO (table_to_load ), sep = '\t ' ))
944942 so , sa , om , d , pr , _ , __ = factory .create_from_df (DF )
945943 self .assertEqual (len (so ), 1 )
946944 self .assertEqual (len (sa ), 2 )
@@ -953,8 +951,7 @@ def test_source_protocol_ref_pool_sample(self):
953951 table_to_load = """Source Name\t Protocol REF\t Sample Name
954952source1\t sample collection\t sample1
955953source2\t sample collection\t sample1"""
956- DF = pd .read_csv (StringIO (table_to_load ), sep = '\t ' )
957- DF .isatab_header = ["Source Name" , "Protocol REF" , "Sample Name" ]
954+ DF = IsaTabDataFrame (pd .read_csv (StringIO (table_to_load ), sep = '\t ' ))
958955 so , sa , om , d , pr , _ , __ = factory .create_from_df (DF )
959956 self .assertEqual (len (so ), 2 )
960957 self .assertEqual (len (sa ), 1 )
@@ -969,8 +966,7 @@ def test_sample_protocol_ref_split_extract_protocol_ref_data(self):
969966 table_to_load = """Sample Name\t Protocol REF\t Extract Name\t Protocol REF\t Raw Data File
970967sample1\t extraction\t e1\t scanning\t d1
971968sample1\t extraction\t e2\t scanning\t d2"""
972- DF = pd .read_csv (StringIO (table_to_load ), sep = '\t ' )
973- DF .isatab_header = ["Source Name" , "Protocol REF" , "Extract Name" , "Protocol REF" , "Raw Data File" ]
969+ DF = IsaTabDataFrame (pd .read_csv (StringIO (table_to_load ), sep = '\t ' ))
974970 so , sa , om , d , pr , _ , __ = factory .create_from_df (DF )
975971 self .assertEqual (len (so ), 0 )
976972 self .assertEqual (len (sa ), 1 )
0 commit comments