Closed iferres closed 2 years ago
Ha, I'm somewhat surprised the first one works ;). Internally, all IDs are converted to characters because otherwise, I get issues when joining across tables (seqs, genes, ...).
That said, I agree, it would be more intuitive if the order of loci would follow the order of the input sequences. I will modify the code to get that behavior as soon as I have time.
In the meantime, you could reorder your sequences after focus
p %>% focus() %>% pick_seqs_within(B2_lc1, B1_lc1)
should do the trick
Thanks! Another question, what does "_lc1", "_lc2", etc, means or how are they set? Just to automate the pick_seqs_within process. In other words: I'm not sure how the 1 or 2 suffixes are chosen.
EDIT: In this example there aren't _lc2, but there're in my real example.
Ah, I see, makes sense. Yes, might not be trivial to automate pick_seqs_within
...
"B2_lc1" is short for "locus #1 on sequence B2". Each locus needs a unique ID, so I just count them per sequence. You can change that, the default pattern is focus(..., .locus_id = str_glue("{seq_id}_lc{row_number()}"
. You can also play with focus(..., .locus_id_group=1)
to count loci not per sequence.
But, anyway. I have a few minutes. Let me see if II can push a fix for the order right away!
p %>% focus(.locus_id = str_glue("{seq_id}#{row_number()}"))
p %>% focus(.locus_id_group=1, .locus_id = str_glue("locus{row_number()}"))
with the latest version
p %>% focus()
Genius! Worked like a charm. Thanks again Bests!
Hi, I noticed that the order of sequences (i.e. contigs) get lost when applying
focus
. For instance:Any way of keeping that order? Thanks!