Skip to content

Commit 07f86e8

Browse files
authored
Merge pull request #295 from chuan-wang/master
Change the way how samples are sorted
2 parents 084da7f + cdb0aee commit 07f86e8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

taca/illumina/HiSeqX_Runs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ def _generate_clean_samplesheet(ssparser, indexfile, fields_to_remove=None, rena
374374
sample['index2'] = index_dict_smartseq[smartseq_index][x][1]
375375

376376
# Sort to get the added indicies from 10x in the right place
377-
# Python 3 doesn't support sorting a list of dicts implicitly. Sort by lane and then index
378-
ssparser.data.sort(key=lambda item: (item.get('Lane'), item.get('index')))
377+
# Python 3 doesn't support sorting a list of dicts implicitly. Sort by lane and then Sample_ID
378+
ssparser.data.sort(key=lambda item: (item.get('Lane'), item.get('Sample_ID')))
379379

380380
if not fields_to_remove:
381381
fields_to_remove = []

tests/data/2014/FCIDXX.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Experiment Name,CIDXX
66
151
77
151
88
[Data]
9-
Lane,SampleID,SampleName,SamplePlate,SampleWell,index,index2,Project,Description
9+
Lane,Sample_ID,Sample_Name,Sample_Plate,Sample_Well,index,index2,Project,Description
1010
1,Sample_P10000_1001,P10000_1001,CIDXX,1:1,SI-GA-A1,,A_Test_18_01,
1111
2,Sample_P10000_1005,P10000_1005,CIDXX,2:1,AGGTACC,,A_Test_18_01,
1212
3,Sample_P10000_1006,P10000_1006,CIDXX,3:1,SMARTSEQ-1A,,A_Test_18_01,

tests/test_illumina.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -731,16 +731,16 @@ def test_generate_clean_samplesheet(self):
731731
Experiment Name,CIDXX
732732
Investigator Name,Test
733733
[Data]
734-
Lane,SampleID,SampleName,SamplePlate,SampleWell,index,index2,Project,Description
734+
Lane,Sample_ID,Sample_Name,Sample_Plate,Sample_Well,index,index2,Project,Description
735735
1,Sample_P10000_1001,P10000_1001,CIDXX,1:1,AACCGTAA,,A_Test_18_01,
736-
1,Sample_P10000_1001,P10000_1001,CIDXX,1:1,CTAAACGG,,A_Test_18_01,
737736
1,Sample_P10000_1001,P10000_1001,CIDXX,1:1,GGTTTACT,,A_Test_18_01,
737+
1,Sample_P10000_1001,P10000_1001,CIDXX,1:1,CTAAACGG,,A_Test_18_01,
738738
1,Sample_P10000_1001,P10000_1001,CIDXX,1:1,TCGGCGTC,,A_Test_18_01,
739739
2,Sample_P10000_1005,P10000_1005,CIDXX,2:1,AGGTACC,,A_Test_18_01,
740+
3,Sample_P10000_1006,P10000_1006,CIDXX,3:1,TGTATCCGAA,CACAGGTGAA,A_Test_18_01,
740741
3,Sample_P10000_1006,P10000_1006,CIDXX,3:1,GAGCGCCTAT,TTGGTACGCG,A_Test_18_01,
741-
3,Sample_P10000_1006,P10000_1006,CIDXX,3:1,GCTAGGTCAA,CACAGGTGAA,A_Test_18_01,
742742
3,Sample_P10000_1006,P10000_1006,CIDXX,3:1,TAAGACGGTG,TTGGTACGCG,A_Test_18_01,
743-
3,Sample_P10000_1006,P10000_1006,CIDXX,3:1,TGTATCCGAA,CACAGGTGAA,A_Test_18_01,
743+
3,Sample_P10000_1006,P10000_1006,CIDXX,3:1,GCTAGGTCAA,CACAGGTGAA,A_Test_18_01,
744744
4,Sample_P10000_1007,P10000_1007,CIDXX,4:1,GTAACATGCG,AGTGTTACCT,A_Test_18_01,
745745
'''
746746
got_samplesheet = _generate_clean_samplesheet(ssparser, indexfile, rename_samples=True, rename_qPCR_suffix = True, fields_qPCR=[ssparser.dfield_snm])
@@ -893,7 +893,7 @@ def test_generate_samplesheet_subset(self):
893893
Experiment Name,CIDXX
894894
Investigator Name,Test
895895
[Data]
896-
Lane,SampleID,SampleName,SamplePlate,SampleWell,index,index2,Project,Description
896+
Lane,Sample_ID,Sample_Name,Sample_Plate,Sample_Well,index,index2,Project,Description
897897
1,Sample_P10000_1001,P10000_1001,CIDXX,1:1,SI-GA-A1,,A_Test_18_01,
898898
'''
899899
self.assertEqual(got_data, expected_data)

0 commit comments

Comments
 (0)