You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the underlying fasta file is changed and the .fai index file is left in place, getfasta will retrieve wrong results. I had a fasta file replaced by a co-worker (who shall remain nameless). This led to getfasta generating incorrect sequence due to differing sequence offsets (headers differed, sequence was the same). This is obviously an edge case but has the potential to corrupt all sequence from that point on.
Perhaps at the minimum an mtime comparison could be done to see if the fasta file is newer than it's index file? Anything more would involve including sanity check offsets in the .fai file which is a samtools spec issue. Checking for illegal characters in the output is unlikely to work since the query coordinates would have to be near a header line to output illegal sequence characters.
Could you possibly create a pull request with just the getfasta changes? I would like to look more closely at the changes to the other files before merging, but this seems clean and a nice improvement!
If the underlying fasta file is changed and the .fai index file is left in place, getfasta will retrieve wrong results. I had a fasta file replaced by a co-worker (who shall remain nameless). This led to getfasta generating incorrect sequence due to differing sequence offsets (headers differed, sequence was the same). This is obviously an edge case but has the potential to corrupt all sequence from that point on.
Perhaps at the minimum an mtime comparison could be done to see if the fasta file is newer than it's index file? Anything more would involve including sanity check offsets in the .fai file which is a samtools spec issue. Checking for illegal characters in the output is unlikely to work since the query coordinates would have to be near a header line to output illegal sequence characters.
To reproduce the error case (tested with 2.23.0):
The text was updated successfully, but these errors were encountered: