1616 PROJECT_FULL_NAME_KEY , TUBECODE_KEY , SYNDNA_POOL_MASS_NG_KEY , \
1717 SYNDNA_POOL_NUM_KEY , ELUTION_VOL_KEY , EXTRACTED_GDNA_CONC_KEY , \
1818 LIB_CONSTRUCT_PROTOCOL_KEY , PM_WELL_ID_384_KEY , DESTINATION_WELL_384_KEY , \
19- BARCODE_ID_KEY , TWIST_ADAPTOR_ID_KEY , SYNDNA_IS_TWISTED_KEY
19+ BARCODE_ID_KEY , TWIST_ADAPTOR_ID_KEY , SYNDNA_IS_TWISTED_KEY , \
20+ CALC_MASS_SAMPLE_ALIQUOT_INPUT_G_KEY
2021from metapool .util import convert_to_bool
2122from metapool .metapool import (bcl_scrub_name , sequencer_i5_index )
2223from metapool .sequencers import is_i5_revcomp_sequencer , get_sequencer_type , \
@@ -1542,7 +1543,7 @@ def __init__(self, path=None, defer_validate=False):
15421543 self ._validate_on_load (path , defer_validate )
15431544
15441545
1545- class AbsQuantMixin (object ):
1546+ class AbsQuantMixinV1 (object ):
15461547 _ABSQUANT_SPECIFIC_COLUMNS = (
15471548 SYNDNA_POOL_MASS_NG_KEY , EXTRACTED_GDNA_CONC_KEY ,
15481549 ELUTION_VOL_KEY , SYNDNA_POOL_NUM_KEY )
@@ -1555,7 +1556,35 @@ class AbsQuantMixin(object):
15551556 })
15561557
15571558 # Reminder: the method of adding carried prep columns and data columns used
1558- # below ONLY works if the mixin is the last class in the inheritance list
1559+ # below ONLY works if the mixin is the leaf class in the inheritance
1560+ # (which, in python, is the *first* one listed in the class definition)
1561+ # and if the class that inherits from it does not explicitly set these
1562+ # attributes in its own __init__ method. Safest not to set these
1563+ # attributes in leaf classes at all (specific sheet versions) for leaf
1564+ # class that uses a mixin like this.
1565+ def __init__ (self , path = None , defer_validate = False ):
1566+ super ().__init__ (path = path , defer_validate = True )
1567+ self ._remapper = self ._extend_mapping_type (self ._ABSQUANT_REMAPPER )
1568+ self ._data_columns = \
1569+ self ._data_columns + self ._ABSQUANT_SPECIFIC_COLUMNS
1570+ if self ._CARRIED_PREP_COLUMNS is not None :
1571+ self ._CARRIED_PREP_COLUMNS = \
1572+ self ._CARRIED_PREP_COLUMNS + self ._ABSQUANT_SPECIFIC_COLUMNS
1573+ self ._validate_on_load (path , defer_validate )
1574+
1575+
1576+ class AbsQuantMixinV2 (object ):
1577+ _ABSQUANT_SPECIFIC_COLUMNS = AbsQuantMixinV1 ._ABSQUANT_SPECIFIC_COLUMNS + \
1578+ (CALC_MASS_SAMPLE_ALIQUOT_INPUT_G_KEY ,)
1579+ _ABSQUANT_REMAPPER = MappingProxyType (
1580+ AbsQuantMixinV1 ._ABSQUANT_REMAPPER |
1581+ {CALC_MASS_SAMPLE_ALIQUOT_INPUT_G_KEY :
1582+ CALC_MASS_SAMPLE_ALIQUOT_INPUT_G_KEY }
1583+ )
1584+
1585+ # Reminder: the method of adding carried prep columns and data columns used
1586+ # below ONLY works if the mixin is the leaf class in the inheritance
1587+ # (which, in python, is the *first* one listed in the class definition)
15591588 # and if the class that inherits from it does not explicitly set these
15601589 # attributes in its own __init__ method. Safest not to set these
15611590 # attributes in leaf classes at all (specific sheet versions) for leaf
@@ -1680,7 +1709,8 @@ class TellseqMetagSampleSheetv10(KLTellSeqSampleSheet):
16801709 _HEADER [_ASSAY_KEY ] = _METAGENOMIC
16811710
16821711
1683- class TellseqAbsquantMetagSampleSheetv10 (AbsQuantMixin , KLTellSeqSampleSheet ):
1712+ class TellseqAbsquantMetagSampleSheetv10 (
1713+ AbsQuantMixinV1 , KLTellSeqSampleSheet ):
16841714 _HEADER = KLSampleSheet ._HEADER .copy ()
16851715 _HEADER [_SHEET_TYPE_KEY ] = TELLSEQ_ABSQUANT_SHEET_TYPE
16861716 _HEADER [_SHEET_VERSION_KEY ] = '10'
@@ -1828,7 +1858,7 @@ class PacBioMetagSampleSheetv10(PacBioSampleSheet):
18281858 _HEADER [_ASSAY_KEY ] = _METAGENOMIC
18291859
18301860
1831- class PacBioAbsquantSampleSheetv10 (AbsQuantMixin , PacBioSampleSheet ):
1861+ class PacBioAbsquantSampleSheetv10 (AbsQuantMixinV1 , PacBioSampleSheet ):
18321862 _HEADER = PacBioSampleSheet ._HEADER .copy ()
18331863 _HEADER [_SHEET_TYPE_KEY ] = PACBIO_ABSQUANT_SHEET_TYPE
18341864 _HEADER [_SHEET_VERSION_KEY ] = '10'
@@ -1886,15 +1916,42 @@ class PacBioMetagSampleSheetv11(PacBioSampleSheetWithTwistAdapters):
18861916 _HEADER [_ASSAY_KEY ] = _METAGENOMIC
18871917
18881918
1889- class TwistAbsquantMixin (AbsQuantMixin ):
1919+ class TwistAbsquantMixinV1 (AbsQuantMixinV1 ):
1920+ _TWIST_ABSQUANT_SPECIFIC_COLUMNS = (SYNDNA_IS_TWISTED_KEY ,)
1921+
1922+ _TWIST_ABSQUANT_REMAPPER = MappingProxyType ({
1923+ SYNDNA_IS_TWISTED_KEY : SYNDNA_IS_TWISTED_KEY ,
1924+ })
1925+
1926+ # Reminder: the method of adding carried prep columns and data columns used
1927+ # below ONLY works if the mixin is the leaf class in the inheritance
1928+ # (which, in python, is the *first* one listed in the class definition)
1929+ # and if the class that inherits from it does not explicitly set these
1930+ # attributes in its own __init__ method. Safest not to set these
1931+ # attributes in leaf classes at all (specific sheet versions) for leaf
1932+ # class that uses a mixin like this.
1933+ def __init__ (self , path = None , defer_validate = False ):
1934+ super ().__init__ (path = path , defer_validate = True )
1935+ self ._remapper = self ._extend_mapping_type (
1936+ self ._TWIST_ABSQUANT_REMAPPER )
1937+ self ._data_columns = self ._data_columns + \
1938+ self ._TWIST_ABSQUANT_SPECIFIC_COLUMNS
1939+ if self ._CARRIED_PREP_COLUMNS is not None :
1940+ self ._CARRIED_PREP_COLUMNS = self ._CARRIED_PREP_COLUMNS + \
1941+ self ._TWIST_ABSQUANT_SPECIFIC_COLUMNS
1942+ self ._validate_on_load (path , defer_validate )
1943+
1944+
1945+ class TwistAbsquantMixinV2 (AbsQuantMixinV2 ):
18901946 _TWIST_ABSQUANT_SPECIFIC_COLUMNS = (SYNDNA_IS_TWISTED_KEY ,)
18911947
18921948 _TWIST_ABSQUANT_REMAPPER = MappingProxyType ({
18931949 SYNDNA_IS_TWISTED_KEY : SYNDNA_IS_TWISTED_KEY ,
18941950 })
18951951
18961952 # Reminder: the method of adding carried prep columns and data columns used
1897- # below ONLY works if the mixin is the last class in the inheritance list
1953+ # below ONLY works if the mixin is the leaf class in the inheritance
1954+ # (which, in python, is the *first* one listed in the class definition)
18981955 # and if the class that inherits from it does not explicitly set these
18991956 # attributes in its own __init__ method. Safest not to set these
19001957 # attributes in leaf classes at all (specific sheet versions) for leaf
@@ -1912,13 +1969,21 @@ def __init__(self, path=None, defer_validate=False):
19121969
19131970
19141971class PacBioAbsquantSampleSheetv11 (
1915- TwistAbsquantMixin , PacBioSampleSheetWithTwistAdapters ):
1972+ TwistAbsquantMixinV1 , PacBioSampleSheetWithTwistAdapters ):
19161973 _HEADER = PacBioSampleSheetWithTwistAdapters ._HEADER .copy ()
19171974 _HEADER [_SHEET_TYPE_KEY ] = PACBIO_ABSQUANT_SHEET_TYPE
19181975 _HEADER [_SHEET_VERSION_KEY ] = '11'
19191976 _HEADER [_ASSAY_KEY ] = _METAGENOMIC
19201977
19211978
1979+ class PacBioAbsquantSampleSheetv12 (
1980+ TwistAbsquantMixinV2 , PacBioSampleSheetWithTwistAdapters ):
1981+ _HEADER = PacBioSampleSheetWithTwistAdapters ._HEADER .copy ()
1982+ _HEADER [_SHEET_TYPE_KEY ] = PACBIO_ABSQUANT_SHEET_TYPE
1983+ _HEADER [_SHEET_VERSION_KEY ] = '12'
1984+ _HEADER [_ASSAY_KEY ] = _METAGENOMIC
1985+
1986+
19221987class MetagenomicSampleSheetv102 (
19231988 KatharoseqMixin , KLSampleSheetWithSampleContext ):
19241989 # Adds support for optional KATHAROSEQ columns in [Data] section.
@@ -2008,7 +2073,7 @@ def __init__(self, path=None, defer_validate=False):
20082073 self ._validate_on_load (path , defer_validate )
20092074
20102075
2011- class AbsQuantSampleSheetv10 (AbsQuantMixin , KLSampleSheetWithReplicates ):
2076+ class AbsQuantSampleSheetv10 (AbsQuantMixinV1 , KLSampleSheetWithReplicates ):
20122077 _HEADER = {
20132078 'IEMFileVersion' : '4' ,
20142079 _SHEET_TYPE_KEY : ABSQUANT_SHEET_TYPE ,
@@ -2024,7 +2089,7 @@ class AbsQuantSampleSheetv10(AbsQuantMixin, KLSampleSheetWithReplicates):
20242089 }
20252090
20262091
2027- class AbsQuantSampleSheetv11 (AbsQuantMixin , KLSampleSheetWithSampleContext ):
2092+ class AbsQuantSampleSheetv11 (AbsQuantMixinV1 , KLSampleSheetWithSampleContext ):
20282093 _HEADER = AbsQuantSampleSheetv10 ._HEADER .copy ()
20292094 _HEADER [_SHEET_TYPE_KEY ] = ABSQUANT_SHEET_TYPE
20302095 _HEADER [_SHEET_VERSION_KEY ] = '11'
@@ -2243,6 +2308,7 @@ def _id_sample_sheet_class(sheet_type, sheet_version, assay_type):
22432308 _METAGENOMIC : {
22442309 '10' : PacBioAbsquantSampleSheetv10 ,
22452310 '11' : PacBioAbsquantSampleSheetv11 ,
2311+ '12' : PacBioAbsquantSampleSheetv12 ,
22462312 },
22472313 }
22482314 }
0 commit comments