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

More changes for 'samtools depad' #6

Closed
wants to merge 17 commits into from
Closed

Conversation

peterjc
Copy link
Contributor

@peterjc peterjc commented Apr 2, 2012

Hi Heng,

I've worked on the handling of superfluous CIGAR P operators
in 'samtools depad', and found and fixed a buffer overflow when
CIGAR D operators are used.

I also realized you were right originally not to accept CIGAR P
operators in the input padded reference BAM file (much like it
does not make sense to use CIGAR I in this case either), and
restored that check.

Peter

@peterjc
Copy link
Contributor Author

peterjc commented Apr 3, 2012

The latest commits add command line switches for SAM support as well as BAM support in 'samtools depad'.

Currently I have left the default as BAM to BAM, and used -s and -S for switching the output and input to SAM (following the case convention used in 'samtools view'). I don't mind changing this is you prefer something different.

@peterjc
Copy link
Contributor Author

peterjc commented Apr 4, 2012

The next batch of commits supports a (padded) FASTA reference file being given via the command line switch -T

Making this mandatory would allow us to fix the reference lengths in the headers, otherwise that would require two passes over the SAM/BAM file, the first just to get and correct the padded to unpadded reference lengths.

@peterjc
Copy link
Contributor Author

peterjc commented Jun 12, 2012

I have code working now to calculate the unpadded reference lengths using the padded FASTA reference file (on a new branch, depad2).

Without this, as noted above, we could use two passes over the SAM/BAM file is there is an embedded reference. The proposed BAI extension to make finding the embedded reference from the index would make this much easier.

The next step is to update the plain text SAM header (changing the @sq lines to edit the LN entry and if present the MD5 checksum).

@peterjc
Copy link
Contributor Author

peterjc commented Jun 19, 2012

I've got the basic functionality working now for correcting the @sq lines, and opted to rebase this as a new branch which I will use for a new pull request.

See #11

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

Successfully merging this pull request may close these issues.

None yet

1 participant