static VALUE t_get_edit_dist(VALUE self){ int retval; VALUE rubyVar1; VALUE rubyVar2; VALUE rubyString1; VALUE rubyString2; char *cString1; char *cString2; int length1; int length2; rubyVar1 = rb_iv_get(self, "@string1"); rubyVar2 = rb_iv_get(self, "@string2"); rubyString1 = StringValue(rubyVar1); rubyString2 = StringValue(rubyVar2); cString1 = RSTRING_PTR(rubyString1); cString2 = RSTRING_PTR(rubyString2); length1 = RSTRING_LEN(rubyString1); length2 = RSTRING_LEN(rubyString2); retval = calculateEditDistance(cString1,length1,cString2,length2); return INT2NUM(retval); }
TEST_F(RaconPolishingTest, ConsensusWithQualities) { SetUp(racon_test_data_path + "sample_reads.fastq.gz", racon_test_data_path + "sample_overlaps.paf.gz", racon_test_data_path + "sample_layout.fasta.gz", racon::PolisherType::kC, 500, 10, 0.3, 5, -4, -8); initialize(); std::vector<std::unique_ptr<racon::Sequence>> polished_sequences; polish(polished_sequences, true); EXPECT_EQ(polished_sequences.size(), 1); polished_sequences[0]->create_reverse_complement(); auto parser = bioparser::createParser<bioparser::FastaParser, racon::Sequence>( racon_test_data_path + "sample_reference.fasta.gz"); parser->parse_objects(polished_sequences, -1); EXPECT_EQ(polished_sequences.size(), 2); EXPECT_EQ(calculateEditDistance(polished_sequences[0]->reverse_complement(), polished_sequences[1]->data()), 1312); }