Daniel:Notebook/GenomeMiner/2013-7-26

From ZhangLabWiki
Jump to navigation Jump to search

HL155[edit]

Back to Calendar

Yesterday's SAM to BAM didn't work, so I did it again.

Converting SAM to BAM

samtools view -bS hrcp_fullindex_samout.sam > hrcp_hl155.bam

Sorting BAM file

samtools sort hrcp_hl155.bam hrcp_sorted_hl155

Create BAM index file

samtools index hrcp_sorted_hl155.bam hrcp_sorted_hl155.bai

Create SAMfile of only mapped reads

samtools view -h -F 4 hrcp_sorted_hl155.bam > hrcp_onlymapped_hl155.sam

This last file ("hrcp_onlymapped_hl155.sam") should only contain mapped reads and is 1/4 the size of the original samfile, which should make it considerably easier to loop through.