Hello NGLess develope team,
I have been trying to play around with the "min_match_size" argument in the mapping step of this script:
igc_mapped_post = select(igc_mapped) using |mr|:
mr = mr.filter(min_match_size=45, min_identity_pc=95, action={drop})
if not mr.flag({mapped}):
discard
My goal is to make this argument obey a percentage instead a fixed number to make it fair for all the reads, no matter their size, as well as make it comparable with other software I am using. I have tried it first in this way:
igc_mapped = map(input, reference='igc', mode_all=True)
igc_mapped_post = select(igc_mapped) using |mr|:
read = as_reads(mr)
coverage_needed = len(read) * 0.9
mr = mr.filter(min_match_size=coverage_needed, min_identity_pc=95, action={drop})
if not mr.flag({mapped}):
discard
But these errors jumped out:
Bad type in function call (function 'as_reads' expects NGLMappedReadSet got NGLMappedRead). for "read = as_reads(mr)"
List expected. Type Just NGLReadSet provided. for "len(read)"
variable "min_match_size". Expected NGLInteger got NGLDouble. for "min_match_size=coverage_needed" because coverage_needed is a float number instead of integer (I guess)
I have tried many possibilities but all of them ended up with similar errors about the variable type required. I run out of ideas to try so, before start learning bash to create a module, I wanted to ask you if you know any way implemented in NGLess to do this.
Thank you very much, best regards.
Iñigo.