Hi
I have a file by STAR alignment, I supposed to get a bam file but I obtained Aligned.out.sam
Is there any command to check if this file is a .bam or .sam
file? A command to check this file sorted or unsorted
?
Thank you so much
Hi
I have a file by STAR alignment, I supposed to get a bam file but I obtained Aligned.out.sam
Is there any command to check if this file is a .bam or .sam
file? A command to check this file sorted or unsorted
?
Thank you so much
Check the error log if STAR had any memory issues, --outSAMtype BAM SortedByCoordinate
is supposed to sort the output.
Check the bam/sam file header line using samtools samtools view -H Aligned.out.sam |grep "@HD"
if you see SO:coordinate
is present, it means the output is sorted. For STAR sorted/unsorted output check the STAR aligner manual section 4.3 .
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Just to follow up on Arup's advice -- given that you seem to have generated a SAM file instead of a BAM file, it seems highly likely that the conversion and sorting failed [EDIT:], therefore it would be highly advisable to understand what caused STAR to not honor your parameter choices, i.e. read the log file(s) and see if you can pinpoint the error that must have occurred.
This command gave sorted bam using STAR
So it was a problem with the memory. It'd be great if you could accept the answer that suggested that so that other users in the future will be pointed to the right track immediately.