morinlab / GAMBLR

Set of standardized functions to operate with genomic data
MIT License
4 stars 2 forks source link

get_ssm_by_region should deal with chr-prefixes automatically based on the selected projection. #241

Closed mattssca closed 11 months ago

mattssca commented 1 year ago

Currently, get_ssm_by_region requires the chromosome in the provided region to be compatible with the selected projection. For example, if projection = "hg38" the chromosome in the provided region would have to be chr-prefixed. The function should automatically deal with chr-prefixes for the supplied region.

get_ssm_by_region("5",1295000,1295600,  projection = "hg38")
Error in methods::as(data[[i]], colClasses[i]) : 
  no method or default for coercing "character" to "l"
rdmorin commented 1 year ago

Any function that accepts a region should allow the region to specify the chromosomes with or without the prefix. This could be handled by another helper function along the lines of id_ease. I would prefer a new family of functions with intuitive names:

id_ease -> instead name it sanitize_sample_ids this new function -> sanitize_regions

mattssca commented 1 year ago

Nice, I like it! Let me work on this and I'll make the necessary updates.

mattssca commented 11 months ago

I will migrate this issue to the appropriate child repo.