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

Editing FASTA files sporadically does not have effect. #110

Closed
sfbrunner opened this issue Apr 18, 2017 · 6 comments
Closed

Editing FASTA files sporadically does not have effect. #110

sfbrunner opened this issue Apr 18, 2017 · 6 comments

Comments

@sfbrunner
Copy link

Hi there,
First of, thanks for writing pyfaidx, it's really useful to my work.
I am currently experiencing an issue where I try to replace a sequence fragment of a FASTA file and the replacement only takes place sporadically. Ie. I do the following:

fasta_connxn = pyfaidx.Fasta(fasta_path, mutable=True)
fasta_connxn[chrom][start:end] = 'NNNNNNNNNN'

Now if I check the file on disk, it does not contain the 'N's. If I then execute the same command again, it now does. Just appears as if the changes do not always take effect. Have you ever seen a similar error? Do you know a fix for this?
I am using bioconda pyfaidx version 0.4.8.1 py27_0.

Thanks!

@mdshw5
Copy link
Owner

mdshw5 commented Apr 18, 2017

This is expected behavior for the current version, since writes are not immediately flushed to disk and instead may be buffered. There shouldn't be much of a performance penalty to change this and make MutableFastaRecord flush writes. I'll make the change and release 0.4.8.4 shortly.

@mdshw5 mdshw5 closed this as completed in 17069c1 Apr 18, 2017
@mdshw5
Copy link
Owner

mdshw5 commented Apr 18, 2017

Thanks for reporting this, by the way!

@mdshw5
Copy link
Owner

mdshw5 commented Apr 18, 2017

The new version is available and hopefully meets your needs: https://pypi.python.org/pypi/pyfaidx

@sfbrunner
Copy link
Author

Thanks for the rapid response, I'll give the new version a try!

@sfbrunner
Copy link
Author

Btw: are you going to attend the Abcam Mutational Signatures conference in Boston this week?

@mdshw5
Copy link
Owner

mdshw5 commented Apr 19, 2017

No, but that looks like a worthwhile conference. I'll have to check it out for next year!

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