MikeAxtell / ShortStack

ShortStack: Comprehensive annotation and quantification of small RNA genes
MIT License
88 stars 29 forks source link

Multiple BAM files or merged BAM file not working #129

Closed somnya closed 1 year ago

somnya commented 1 year ago

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 commented 1 year ago

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

somnya commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Fixed in release 4.0.2.