csort modifies input file
See original GitHub issueI am trying to use cooler csort
(version cooler==0.5.3
) without much success. My pairs file pairs.txt
has the following format:
chr12 74054834 + chr17 37101300 -
chr10 107716614 + chr8 74236985 +
...
and the chromosome size file (hg19_chromsizes.txt
):
chr1 249250621
chr10 135534747
...
When I run cooler csort hg19_chromsizes.txt pairs.txt
I get the following output:
Enumerating chroms...
chr1 1
chr10 2
chr11 3
chr12 4
chr13 5
chr14 6
chr15 7
chr16 8
chr17 9
chr18 10
chr19 11
chr2 12
chr20 13
chr21 14
chr22 15
chr3 16
chr4 17
chr5 18
chr6 19
chr7 20
chr8 21
chr9 22
chrM 23
chrX 24
chrY 25
and after a few seconds my 14GB contact pairs file is converted into a useless 28 byte binary file, along with a new file pairs.txt.tbi
, which I guess it’s the failed attempt to index the former with tabix.
Did I misunderstand the usage of cooler csort
? Why does it modify the input file?
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to sort a file in-place? - Stack Overflow
You can use the -o , --output=FILE option of sort to indicate the same input and output file: sort -o file file.
Read more >sorting a file using the sort command and overwrite it
This happens because the input / output file is truncated before its content is actually read, so sort ends up reading an already...
Read more >cooler/csort.py at master · open2c/cooler - GitHub
cooler/cooler/cli/csort.py. Go to file · Go to file T; Go to line L ... If input file appears gzipped based its extension, read...
Read more >sort directories by last modified content (recursive)
The last modification time of a directory (think like phone directory, not folder) is the time it was last modified, like when an...
Read more >Start the sort-merge utility - IBM
-c: Checks input files to ensure that they are correctly ordered according to the key position and sort ordering options that are specified,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The last version in
develop
works smoothly. I tried the last commit inmaster
and I wasn’t able to reproduce the input replacement either – the buggy version was the one provided bypip install
.btw, It would be useful to give
cooler
a version argument in order to ease the debugging process.Thanks
Eduard
Indeed 😃
Thanks!