wwood / CoverM

Read coverage calculator for metagenomics
GNU General Public License v3.0
309 stars 31 forks source link

Set galah/dereplication as a crate feature #50

Closed apcamargo closed 3 years ago

apcamargo commented 3 years ago

Hey Ben,

I know that CoverM isn't supposed to be used as a library and that implementing this would require some work, so feel free to ignore/close this issue if you think it is not worth it.

I just updated pyCoverM to use the latest release (0.6.0) and I noticed that I can't compile the wheel on Windows because of Galah:

error[E0433]: failed to resolve: could not find `unix` in `os`
   --> C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\galah-0.3.0\src\cluster_argument_parsing.rs:385:22
    |
385 |             std::os::unix::fs::symlink(link, std::path::Path::new(&current_stab)).expect(&format!(
    |                      ^^^^ could not find `unix` in `os`

Because dereplication is not something that most people would expect in a tool to estimate contig/genome coverage, maybe it could be moved to the [features] section of the Cargo.toml file and then Galah could be marked as an optional requirement. This way, CoverM could be compiled on Windows.

wwood commented 3 years ago

Hey,

Can this be fixed by making the code use different symlink methods depending on platform?

wwood commented 3 years ago

e.g. with https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-macro

i'll have a crack at this when i dont have a baby in hand.

wwood commented 3 years ago

Hey fixed this by conditional compilation. You'll have to adjust the Cargo.toml of coverm to use the bleeding edge galah I suppose.

I've never tested this stuff on windows - let me know if you come across problems. Thanks.

apcamargo commented 3 years ago

I think this was a better solution, thanks!

I still can't compile on Windows because CoverM depends on Galah 0.3.0, but I can wait for the next CoverM/Galah releases. I could build with a local fork of CoverM, but that's not something I'd like to do for now. There's no hurry to support Windows.