Skip to content

Instantly share code, notes, and snippets.

@Colelyman
Last active October 17, 2018 03:34
Show Gist options
  • Save Colelyman/1fe2a92fb221c3302158612aa17bbd15 to your computer and use it in GitHub Desktop.
Save Colelyman/1fe2a92fb221c3302158612aa17bbd15 to your computer and use it in GitHub Desktop.
This gist is a mini tutorial on how to view aligned reads in the command line using samtools tview.
# Convert .sam file to .bam file
$ samtools view -b -S -o [outputted bam file] [inputted sam file]
# Sort and index the .bam file
$ samtools sort [inputted bam file] > [output prefix of bam file].sorted
$ samtools index [inputted bam file].sorted.bam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment