Monday, April 6, 2015

Converting sam to bam

In case getopt() is not provided arguments cannot be intermingled, thus the command:

samtools view -bS file.sam -o file.bam

would give some binary output and "random alignment retrieval only works for indexed BAM files".

Instead group arguments such that options are separated from filenames:

samtools view -bS -o Aligned.out Aligned.out.sam

Or use > to direct output to bam file

samtools view -bS Aligned.out.sam > Aligned.out.bam

No comments:

Post a Comment