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

Allow writing chrom names with . in the name #90

Closed
donaldcampbelljr opened this issue Feb 14, 2025 · 5 comments · Fixed by #92
Closed

Allow writing chrom names with . in the name #90

donaldcampbelljr opened this issue Feb 14, 2025 · 5 comments · Fixed by #92

Comments

@donaldcampbelljr
Copy link
Member

Ok, I was able to reproduce (was still using a smaller subset of chroms).

Added a print function immediately before opening each input file for the merge.

/home/drc/Downloads/gtars_74_issue/output/testchrY_NC_051844.1_shift.bed
thread 'main' panicked at src/uniwig/writing.rs:84:49:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

Checking the folder, I see a file: testchrY_NC_051844.bed. Checking chrom.sizes:

chrX	124992030
chrY_NC_051844.1	3937623
chrY_unplaced_NW_024010443.1	1569522

So, it appears to me that it is dropping the .1 when writing that particular chromosome to file.

Similar issue for the following chromosome: chrY_unplaced_NW_024010443.bed exists without the .1.

Originally posted by @donaldcampbelljr in #74

@nsheff
Copy link
Member

nsheff commented Feb 14, 2025

You just need to make sure it follows the SAM spec for what's allowed in a chrom name. periods are allowed.

@donaldcampbelljr
Copy link
Member Author

donaldcampbelljr commented Feb 17, 2025

This was the simple fix I suspected it to be. While I was investigating, I also confirmed the code works for many other chromosome names with various symbols per the SAM spec.

Examples:
chr22.1 17820380
chr22#1 17820380
chr22$1 17820380
chr22%1 17820380
chr22&1 17820380
chr22+1 17820380
chr22_1 17820380
chr22^1 17820380
chr22~1 17820380
chr22-1 17820380

@donaldcampbelljr
Copy link
Member Author

One issue:
SAM allows / but this currently causes issues when attempting to create temp files before merging.

@nleroy917
Copy link
Member

I think slashes are very strictly forbidden in file names/systems

@nsheff
Copy link
Member

nsheff commented Feb 17, 2025

yes, you will probably need to accommodate that, then.

donaldcampbelljr added a commit that referenced this issue Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants