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

Multiple BAM files or merged BAM file not working #129

Closed
somnya opened this issue Apr 20, 2023 · 7 comments
Closed

Multiple BAM files or merged BAM file not working #129

somnya opened this issue Apr 20, 2023 · 7 comments
Assignees
Labels

Comments

@somnya
Copy link

somnya commented Apr 20, 2023

Hi,

I have bam files in two different directories. When I introduce them one by one after --bamfile, I receive an error message saying that samtools merge is not working:
No such file or directory: 'samtools merge -b dir/user_bamfiles.txt dir/merged.bam'

I have tried also merging the files manually (using samtools merge -r) but I think ShortStack is not reading the read groups because the Counts.txt file is not part of the output. The read groups do exist in the RG tag.

I checked the past Issues but it seems no one else has had the same problem.
I hope you may have an idea of what may be not working in my code!

Thanks.

@MikeAxtell
Copy link
Owner

Have you tried just putting your original 2 bam files in the same directory?

@somnya
Copy link
Author

somnya commented Apr 20, 2023

Yes!

Since the alignment was also done with ShortStack, in each directory there is a file called "merged_alignments.bam".
When I try the quantification with that file, it works.

Nevertheless, when I try inputting each of the bam files within the same directory (6 in each) I receive the same error message.
Maybe the list of bam files is not saved when ShortStack is doing the merging part?

Thanks!

@somnya
Copy link
Author

somnya commented Apr 20, 2023

I just found the error!

I was using an older version of samtools to merge. When I used the version required for ShortStack, it now reads the merged bam file.

It is anyway weird that I couldn't input each bam file independly.

@SficPan
Copy link

SficPan commented May 10, 2023

I got this error too.

When I try to input BAM files with paths separated by spaces, it gives:
No such file or directory: 'samtools merge -b ../../EVA_short_result2/user_bamfiles.txt ../../EVA_short_result2/merged.bam'

@MikeAxtell MikeAxtell self-assigned this May 10, 2023
@MikeAxtell MikeAxtell added the bug label May 10, 2023
@MikeAxtell
Copy link
Owner

Thank you, I have reproduced the bug and I am working on a fix now. In the meantime, you can merge your own bamfiles with samtools merge, then given ShortStack a single merged bam file.

@MikeAxtell
Copy link
Owner

This is fixed as of commit 23a886b. You can grab that commit or any subsequent commit and it will fix the bug.
This will be incorporated into the next release which I hope to have ready within the next week. I will leave this issue open until I get the next release out. Thanks for reporting the bug.

@MikeAxtell
Copy link
Owner

Fixed in release 4.0.2.

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

No branches or pull requests

3 participants