I have a problem converting a gz file into a bam file. How can I do this using the samtools library.
Brief Reminder On How To Ask A Good Question
Please spend some time reading/searching this forum. If you still need assistance then improve your question by putting some effort into it and showing us what you have tried to achieve your goal.
gz is a common file extension used for files that are either gzip-compressed or bgzip-compressed. As such, it denotes a file format. bam is a file format (and also a file extension, but a file format first) that stores reference-aligned or unaligned reads. You can get from one level of information content to another, but you cannot "convert" between two different paradigms without an understanding of the fundamentals.
I have several gz files. And I want to compress them in bam with C code.
This is like saying "I have several edible items. And I want to compress them to sandwich using metal".
Not all edible items can be made into a sandwich and you don't need to start from metal to get to a tool that can make a sandwich from specific, compatible edible items.
can you post one entire file name here? what comes before the .gz?
Please use ADD COMMENT/ADD REPLY when responding to existing posts to keep threads logically organized.
SUBMIT ANSWER is for new answers to original question.
ADD COMMENT/ADD REPLY
Is this a homework/assignment question? If it is you should clarify that. Are these sequence data files or something else?
Please check what @RamRS posted above for reference.
Why do you want to use C?
Friederike . For example chr1.gz
i use the sametools library
Please stop adding answers unless you're answering the top level question.
What does chr1.gz contain? Please edit your question and add a significant amount of relevant detail so your question can be reopened.
We believe that this post does not fit the main topic of this site.
OP keeps adding answers. Also, question too vague
For this reason we have closed your question. This allows us to keep the site focused
on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.