def test_run_hisat2_sampleset_ok(self): res = self.get_impl().run_hisat2(self.get_context(), { "ws_name": self.ws_name, "sampleset_ref": self.single_end_sampleset, "genome_ref": self.genome_ref, "alignmentset_suffix": "_sampleset_alignments", "alignment_suffix": "_sampleset_alignment", "num_threads": 2, "quality_score": "phred33", "skip": 0, "trim3": 0, "trim5": 0, "np": 1, "min_intron_length": 20, "max_intron_length": 500000, "no_spliced_alignment": 0, "transcriptome_mapping_only": 0, "build_report": 1 })[0] self.assertIsNotNone(res) print("Done with HISAT2 run! {}".format(res)) self.assertIn("report_ref", res) self.assertTrue(check_reference(res["report_ref"])) self.assertIn("report_name", res) self.assertIn("alignmentset_ref", res) self.assertTrue(check_reference(res["alignmentset_ref"])) self.assertTrue(get_object_names([res["alignmentset_ref"]], self.wsURL)[res["alignmentset_ref"]].endswith("_sampleset_alignments")) self.assertIn("alignment_objs", res) self.assertTrue(len(res["alignment_objs"].keys()) == 2) for reads_ref in res["alignment_objs"]: ref_from_refpath = reads_ref.split(';')[-1] self.assertIn(ref_from_refpath, self.reads_refs) self.assertTrue(res["alignment_objs"][reads_ref]["name"].endswith("_sampleset_alignment")) self.assertTrue(check_reference(res["alignment_objs"][reads_ref]["ref"]))
def test_run_hisat2_single_end_lib_ok(self): res = self.get_impl().run_hisat2( self.get_context(), { "ws_name": self.ws_name, "sampleset_ref": self.single_end_ref_wt_1, "condition": "wt", "genome_ref": self.genome_ref, "alignmentset_suffix": "_alignment_set", "alignment_suffix": "_alignment", "num_threads": 2, "quality_score": "phred33", "skip": 0, "trim3": 0, "trim5": 0, "np": 1, "min_intron_length": 20, "max_intron_length": 500000, "no_spliced_alignment": 0, "build_report": 1 })[0] self.assertIsNotNone(res) print("Done with HISAT2 run! {}".format(res)) self.assertIn("report_ref", res) self.assertTrue(check_reference(res["report_ref"])) self.assertIn("report_name", res) self.assertIn("alignmentset_ref", res) self.assertIsNone(res["alignmentset_ref"]) self.assertIn("alignment_objs", res) self.assertTrue(len(res["alignment_objs"].keys()) == 1) for reads_ref in res["alignment_objs"]: ref_from_refpath = reads_ref.split(';')[-1] self.assertIn(ref_from_refpath, self.reads_refs) self.assertTrue(res["alignment_objs"][reads_ref]["name"].endswith( "_alignment")) alignment_ref = res["alignment_objs"][reads_ref]["ref"] self.assertTrue(check_reference(alignment_ref)) alignment_data = self.dfu.get_objects( {"object_refs": [alignment_ref]})['data'][0]['data'] align_stats = alignment_data.get('alignment_stats') self.assertEqual(align_stats.get('total_reads'), 15254) self.assertEqual(align_stats.get('mapped_reads'), 15081) self.assertEqual(align_stats.get('unmapped_reads'), 173) self.assertEqual(align_stats.get('singletons'), 11044) self.assertEqual(align_stats.get('multiple_alignments'), 4037)