Sort BAM preserving headers

Annotation: Sort by chromosome and start. Derivation of Jeremy's workflow 'Sort SAM for Cufflinks'

StepAnnotation
Step 1: Input dataset
select at runtime
BAM file to be sorted
Step 2: BAM-to-SAM
Output dataset 'output' from step 1
False
Convert BAM to SAM format
Step 3: Select
Output dataset 'output1' from step 2
Matching
^@
Save SAM header
Step 4: Select
Output dataset 'output1' from step 2
NOT Matching
^@
Delete SAM header
Step 5: Sort
Output dataset 'out_file1' from step 4
3
Alphabetical sort
Ascending order
Column selections
Column selection 1
4
Numerical sort
Ascending order
0

No value found for 'Number of header lines to skip'. Using default: '0'.

Sort mapping data lines by chromosome then start coordinate
Step 6: Concatenate datasets
Output dataset 'out_file1' from step 3
Datasets
Dataset 1
Output dataset 'out_file1' from step 5
Concantenate header and sorted mapping data
Step 7: SAM-to-BAM
Use a built-in genome
Output dataset 'out_file1' from step 6
None
Use default job resource parameters
Convert SAM to BAM format. Final sorted output