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

bam2 juicer erases my bam file #4

Open
eoziolor opened this issue Dec 21, 2018 · 6 comments
Open

bam2 juicer erases my bam file #4

eoziolor opened this issue Dec 21, 2018 · 6 comments

Comments

@eoziolor
Copy link

Hello,

I am trying to run matlock to convert a filtered .bam file from hic alignments into a juicer format. I am running this on a Ubuntu 18.04 cluster.

matlock bam2 juicer -i ph_supernova_filtered.bam -o ph_super_filter_format

The error I get is:
INFO: converting bam to juicer on -i
[E::hts_open_format] Failed to open file -i
INFO: detected ? filetype
[E::hts_open_format] Failed to open file -i
FATAL: failed to open "-i" for reading
Segmentation fault

And then I find that my .bam file has been erased. Do you know why this could be?

Thank you!

-Elias

@macmanes
Copy link

this just happened to me as well. Seriously bad...

@eoziolor
Copy link
Author

@macmanes matlock bam2 juicer works for me for the original alignments file by the way, so I'd give it a shot if you want to move forward. I've been using that to plug in with juicer. I think alignment score is in the output, so it shouldn't be a problem for downstream processes, but it would definitely take less time with filtered .bam

@shawnpg
Copy link
Contributor

shawnpg commented Dec 21, 2018

I believe this is because of the "-i" and "-o" flags. The usage is just "matlock bam2 juicer [input] [output]" without flags, so it is looking for a file named "-i" and writing its results to the file with your original BAM name.

It is of course unacceptable behavior to overwrite the file in this case and we will change that, but can you confirm whether removing the "-i" and "-o" flags fixes it?

@eoziolor
Copy link
Author

Shawn,

Thanks for the answer! I am currently filtering the file after another loss (I forgot to re-create it yesterday), I will check in about 1 hour after it's done. The strange part is that it works just fine for me with -i and -o on the aligned.bam file, but not on the filtered.bam. In addition, when I run matlock for filtering, the -i and -o notation is required, correct?

-Elias

@macmanes
Copy link

macmanes commented Dec 22, 2018 via email

@shawnpg
Copy link
Contributor

shawnpg commented Dec 22, 2018

Thanks for confirming. I agree, this is a confusing interface. We will make a change both so that it won't overwrite files accidentally when the arguments are wrong, and will also unify the interfaces so they all use the -i and -o flags.

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

3 participants