Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Results depend on the ordering of the input fasta #160

Open
jchorl opened this issue Apr 6, 2024 · 1 comment
Open

Results depend on the ordering of the input fasta #160

jchorl opened this issue Apr 6, 2024 · 1 comment

Comments

@jchorl
Copy link
Contributor

jchorl commented Apr 6, 2024

Thanks for the great tool!

#159 addresses unstable ordering when sorting contig-link counts.

When assigning contigs to clusters, it feels the priority should be correctness, and then stability. One option is to always sort the fasta before processing begins. While that would provide stability across different-ordered-fastas, it doesn't necessarily provide correctness (what's to say whether ascending or descending sort would yield more correct results). Therefore it seems that for each method of assigning contigs to clusters, the correct ordering might be subtly different. For low linkage contigs, I think it makes sense to prioritize lower link count and use cluster score as a tie-breaker.

In the case of assigning based on high-confidence references, there can also be ties for the reference scores, which can impact cluster assignment. Here are some example reference scores:

             ('JX627737', 103233.0),                                                                                           
             ('NC_019424', 103233.0),
...
             ('JX981514', 52572.0),                            
             ('NC_022105', 52572.0),       
             ('CP011290', 52532.0), 
             ('CP011293', 52532.0),

assign_contigs_to_clusters is fairly complex, assigning contigs to clusters based on many different criteria. I'm curious if you've given thought to make assignment correct/stable, regardless of the order of the input fasta. Happy to help here!

@kbessonov1984
Copy link
Collaborator

kbessonov1984 commented May 23, 2024

Hello,
I am currently working on this issue and contig ordering in the input fasta file has indeed impact on final results such as different number of contigs assigned to the same cluster as the contig assignment to plasmid clusters is iterative and order of contigs matters. The simplest solution is indeed resolve ties by an alphabetical ordering but this rather a simplistic solution
but would not necessarily capitalize on optimal (i.e. "correctness") of the final reconstructed plasmid. Instead we are testing now trying to order input contigs by lengths (from longest to shortest) before contig assignment to clusters. Sorry for delay as I was on vacation and it took some time to figure out the assign_contigs_to_clusters logic and write unit test functions for testing and debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants