Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions misopy/sam_to_bam.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def sam_to_bam(sam_filename, output_dir,

# Sort
print "Sorting BAM file..."
sorted_filename = "%s.sorted" %(bam_filename.split(".bam")[0])
cmd = "samtools sort %s %s" %(bam_filename,
sorted_filename)
sorted_filename = "%s.sorted.bam" %(bam_filename.split(".bam")[0])
cmd = "samtools sort -o %s %s" %(sorted_filename,
bam_filename)
print " - Executing: %s" %(cmd)
os.system(cmd)

# Index
final_filename = "%s.bam" %(sorted_filename)
final_filename = "%s" %(sorted_filename)
print "Indexing BAM..."
cmd = "samtools index %s" %(final_filename)
print " - Executing: %s" %(cmd)
Expand Down