def test_slideseq2(self): bam_fp = pipeline.convert_fastqs_to_unmapped_bam( self.fastq_slideseq2_fps, "slideseq2", tempfile.mkdtemp(), name="test", ) with pysam.AlignmentFile(bam_fp, "rb", check_sq=False) as f: alignments = list(f.fetch(until_eof=True)) self.assertEqual(2, len(alignments)) self.assertEqual( [ "NB501583:801:H7JLTBGXH:1:11101:20912:1050", "NB501583:801:H7JLTBGXH:1:11101:8670:1050", ], [al.query_name for al in alignments], ) self.assertEqual( [ read.sequence for read in ngs.fastq.Fastq(self.fastq_slideseq2_fps[1]) ], [al.query_sequence for al in alignments], ) self.assertEqual( [ read.qualities.string for read in ngs.fastq.Fastq(self.fastq_slideseq2_fps[1]) ], [ pysam.array_to_qualitystring(al.query_qualities) for al in alignments ], ) self.assertEqual( { ("UR", "TTTTTTTTT"), ("UY", "EEEEEEEEE"), ("CR", "CTTTGNTCAATGTT"), ("CY", "AAAAA#EEAEEEEE"), ("RG", "test"), }, set(alignments[0].get_tags()), ) self.assertEqual( { ("UR", "AGTGTCTCA"), ("UY", "EAEAEAEEE"), ("CR", "CTCTTNATCCTCAT"), ("CY", "AAAAA#EEE/EAE/"), ("RG", "test"), }, set(alignments[1].get_tags()), )
def test_indropsv3(self): bam_fp = pipeline.convert_fastqs_to_unmapped_bam( self.fastq_indropsv3_fps, "indropsv3", tempfile.mkdtemp(), name="test", ) with pysam.AlignmentFile(bam_fp, "rb", check_sq=False) as f: alignments = list(f.fetch(until_eof=True)) self.assertEqual(2, len(alignments)) self.assertEqual( [ "M03718:773:000000000-JKHP3:1:1101:18272:1693", "M03718:773:000000000-JKHP3:1:1101:17963:1710", ], [al.query_name for al in alignments], ) self.assertEqual( [ read.sequence for read in ngs.fastq.Fastq(self.fastq_10xv3_fps[1]) ], [al.query_sequence for al in alignments], ) self.assertEqual( [ read.qualities.string for read in ngs.fastq.Fastq(self.fastq_10xv3_fps[1]) ], [ pysam.array_to_qualitystring(al.query_qualities) for al in alignments ], ) self.assertEqual( { ("UR", "CCAAAA"), ("UY", "FFBFGG"), ("CR", "TACGTCATCTCCTACG"), ("CY", "1111AFAF1111AFAF"), ("RG", "test"), }, set(alignments[0].get_tags()), ) self.assertEqual( { ("UR", "TTAGAA"), ("UY", "FAAAFF"), ("CR", "TTAGATCGTTAGATCG"), ("CY", "1>>11DFA1>>11DFA"), ("RG", "test"), }, set(alignments[1].get_tags()), )