@@ -1406,33 +1406,11 @@ def flatten(l): return [item for sublist in l for item in sublist]
14061406 protrefcount += 1
14071407 columns += flatten (map (lambda x : get_pv_columns (olabel , x ),
14081408 node .parameter_values ))
1409- oname_label = None
14101409 if node .executes_protocol .protocol_type :
1411- if node .executes_protocol .protocol_type .term .lower () in \
1412- protocol_types_dict ["nucleic acid sequencing" ][SYNONYMS ] \
1413- + protocol_types_dict ["phenotyping" ][SYNONYMS ]:
1414- oname_label = "Assay Name"
1415- elif node .executes_protocol .protocol_type .term .lower () in \
1416- protocol_types_dict ["data collection" ][SYNONYMS ]:
1417- oname_label = "Scan Name"
1418- elif node .executes_protocol .protocol_type .term .lower () in \
1419- protocol_types_dict ["mass spectrometry" ][SYNONYMS ]:
1420- oname_label = "MS Assay Name"
1421- elif node .executes_protocol .protocol_type .term .lower () in \
1422- protocol_types_dict ["nmr spectroscopy" ][SYNONYMS ]:
1423- oname_label = "NMR Assay Name"
1424- elif node .executes_protocol .protocol_type .term .lower () in \
1425- protocol_types_dict ["data transformation" ][SYNONYMS ]:
1426- oname_label = "Data Transformation Name"
1427- elif node .executes_protocol .protocol_type .term .lower () in \
1428- protocol_types_dict ["sequence analysis data transformation" ][SYNONYMS ]:
1429- oname_label = "Normalization Name"
1430- elif node .executes_protocol .protocol_type .term .lower () in \
1431- protocol_types_dict ["normalization" ][SYNONYMS ]:
1432- oname_label = "Normalization Name"
1433- if node .executes_protocol .protocol_type .term .lower () \
1434- == "unknown protocol" :
1435- oname_label = "Unknown Protocol Name"
1410+ oname_label = get_column_header (
1411+ node .executes_protocol .protocol_type .term ,
1412+ protocol_types_dict
1413+ )
14361414 if oname_label is not None :
14371415 columns .append (oname_label )
14381416 elif node .executes_protocol .protocol_type .term .lower () \
@@ -1492,32 +1470,11 @@ def pbar(x): return x
14921470 node .executes_protocol .name
14931471 )
14941472 df_dict [olabel ][- 1 ] = node .executes_protocol .name
1495- oname_label = None
14961473 if node .executes_protocol .protocol_type :
1497- if node .executes_protocol .protocol_type .term .lower () in \
1498- protocol_types_dict ["nucleic acid sequencing" ][SYNONYMS ]:
1499- oname_label = "Assay Name"
1500- elif node .executes_protocol .protocol_type .term .lower () in \
1501- protocol_types_dict ["data collection" ][SYNONYMS ]:
1502- oname_label = "Scan Name"
1503- elif node .executes_protocol .protocol_type .term .lower () in \
1504- protocol_types_dict ["mass spectrometry" ][SYNONYMS ]:
1505- oname_label = "MS Assay Name"
1506- elif node .executes_protocol .protocol_type .term .lower () in \
1507- protocol_types_dict ["nmr spectroscopy" ][SYNONYMS ]:
1508- oname_label = "NMR Assay Name"
1509- elif node .executes_protocol .protocol_type .term .lower () in \
1510- protocol_types_dict ["data transformation" ][SYNONYMS ]:
1511- oname_label = "Data Transformation Name"
1512- elif node .executes_protocol .protocol_type .term .lower () in \
1513- protocol_types_dict ["sequence analysis data transformation" ][SYNONYMS ]:
1514- oname_label = "Data Transformation Name"
1515- elif node .executes_protocol .protocol_type .term .lower () in \
1516- protocol_types_dict ["normalization" ][SYNONYMS ]:
1517- oname_label = "Normalization Name"
1518- if node .executes_protocol .protocol_type .term .lower () == \
1519- "unknown protocol" :
1520- oname_label = "Unknown Protocol Name"
1474+ oname_label = get_column_header (
1475+ node .executes_protocol .protocol_type .term ,
1476+ protocol_types_dict
1477+ )
15211478 if oname_label is not None :
15221479 df_dict [oname_label ][- 1 ] = node .name
15231480 elif node .executes_protocol .protocol_type .term .lower () in \
@@ -1643,6 +1600,37 @@ def pbar(x): return x
16431600 encoding = 'utf-8' )
16441601
16451602
1603+ def get_column_header (protocol_type_term , protocol_types_dict ):
1604+ column_header = None
1605+ if protocol_type_term .lower () in \
1606+ protocol_types_dict ["nucleic acid sequencing" ][SYNONYMS ] \
1607+ + protocol_types_dict ["phenotyping" ][SYNONYMS ] \
1608+ + protocol_types_dict ["data acquisition" ][SYNONYMS ]:
1609+ column_header = "Assay Name"
1610+ elif protocol_type_term .lower () in \
1611+ protocol_types_dict ["data collection" ][SYNONYMS ]:
1612+ column_header = "Scan Name"
1613+ elif protocol_type_term .lower () in \
1614+ protocol_types_dict ["mass spectrometry" ][SYNONYMS ]:
1615+ column_header = "MS Assay Name"
1616+ elif protocol_type_term .lower () in \
1617+ protocol_types_dict ["nmr spectroscopy" ][SYNONYMS ]:
1618+ column_header = "NMR Assay Name"
1619+ elif protocol_type_term .lower () in \
1620+ protocol_types_dict ["data transformation" ][SYNONYMS ] \
1621+ + protocol_types_dict ["sequence analysis data transformation" ][SYNONYMS ] \
1622+ + protocol_types_dict ["metabolite identification" ][SYNONYMS ] \
1623+ + protocol_types_dict ["protein identification" ][SYNONYMS ]:
1624+ column_header = "Data Transformation Name"
1625+ elif protocol_type_term .lower () in \
1626+ protocol_types_dict ["normalization" ][SYNONYMS ]:
1627+ column_header = "Normalization Name"
1628+ if protocol_type_term .lower () \
1629+ == "unknown protocol" :
1630+ column_header = "Unknown Protocol Name"
1631+ return column_header
1632+
1633+
16461634def get_value_columns (label , x ):
16471635 """Generates the appropriate columns based on the value of the object.
16481636 For example, if the object's .value value is an OntologyAnnotation,
0 commit comments