@@ -70,7 +70,7 @@ def check_samplesheet(file_in, file_out):
7070 line ,
7171 )
7272
73- num_cols = len ([x for x in lspl if x ])
73+ num_cols = len ([x for x in lspl [: len ( HEADER )] if x ])
7474 if num_cols < MIN_COLS :
7575 print_error (
7676 f"Invalid number of populated columns (minimum = { MIN_COLS } )!" ,
@@ -124,6 +124,7 @@ def check_samplesheet(file_in, file_out):
124124 print_error ("Invalid combination of columns provided!" , "Line" , line )
125125
126126 ## Create sample mapping dictionary = {sample: [[ single_end, fastq_1, fastq_2, strandedness ]]}
127+ sample_info = sample_info + lspl [len (HEADER ):]
127128 if sample not in sample_mapping_dict :
128129 sample_mapping_dict [sample ] = [sample_info ]
129130 else :
@@ -137,7 +138,7 @@ def check_samplesheet(file_in, file_out):
137138 out_dir = os .path .dirname (file_out )
138139 make_dir (out_dir )
139140 with open (file_out , "w" ) as fout :
140- fout .write ("," .join (["sample" , "single_end" , "fastq_1" , "fastq_2" , "strandedness" ]) + "\n " )
141+ fout .write ("," .join (["sample" , "single_end" , "fastq_1" , "fastq_2" , "strandedness" ] + header [ len ( HEADER ):] ) + "\n " )
141142 for sample in sorted (sample_mapping_dict .keys ()):
142143
143144 ## Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end
@@ -149,7 +150,7 @@ def check_samplesheet(file_in, file_out):
149150 )
150151
151152 ## Check that multiple runs of the same sample are of the same strandedness
152- if not all (x [- 1 ] == sample_mapping_dict [sample ][0 ][- 1 ] for x in sample_mapping_dict [sample ]):
153+ if not all (x [3 ] == sample_mapping_dict [sample ][0 ][3 ] for x in sample_mapping_dict [sample ]):
153154 print_error (
154155 f"Multiple runs of a sample must have the same strandedness!" ,
155156 "Sample" ,
0 commit comments