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

Writing alignments to file #10

Open
gusevfe opened this issue Feb 15, 2012 · 3 comments
Open

Writing alignments to file #10

gusevfe opened this issue Feb 15, 2012 · 3 comments

Comments

@gusevfe
Copy link
Contributor

gusevfe commented Feb 15, 2012

Is it possible to write alignments to file?

E.g. I want to process an existing .bam file by removing a part of the sequence. How do I do that?

@danmaclean
Copy link
Collaborator

Hi, can you clarify what you require. I guess you want to process an alignment, removing some of the sequence, create a new Bio::DB::Alignment object and write that to a new BAM file? Or are you trying to do something more complicated?

cheers

@gusevfe
Copy link
Contributor Author

gusevfe commented Feb 16, 2012

That's exactly what I want.

On Thu, Feb 16, 2012 at 2:13 PM, danmaclean <
[email protected]

wrote:

Hi, can you clarify what you require. I guess you want to process an
alignment, removing some of the sequence, create a new Bio::DB::Alignment
object and write that to a new BAM file? Or are you trying to do something
more complicated?

cheers


Reply to this email directly or view it on GitHub:
#10 (comment)

Kind regards,
Fedor Gusev.

@danmaclean
Copy link
Collaborator

The official samtools C API function for writing to BAM isn't implemented yet, as it is a bit complicated and we considered most users would want to use BAM as a datasource much more than as a sink. The workaround is to use the Bio::DB::Alignment#to_s method that writes the alignment object in SAM, which you can convert to BAM the old fashioned way. We are working on making BAM writable.

cheers

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

2 participants