Hi everyone, I wanna prepare my alignment bam file for cufflinks running. I 've used samtools sort for converting sam to bam, next I gonna to run my script for sorting it, but it don't work. Do you have any recommendation or suggestion for correction of that? thanks so much for help me.
my scripts is here:
./samtools view -@ 4 /media/marziyeh/56F72A78084DABD5/RNA-seqdata/output_bowtie2_alignment_ref/sample33.sam > sample33.bam`
`
./samtools sort -n -l 9 -@ 4 -m 3G /media/marziyeh/56F72A78084DABD5/RNA-seqdata/viewed_samtools/sample32_sortedin22.bam >> /media/marziyeh/56F72A78084DABD5/RNA-seqdata/sorted.sample/sample.32
or another script as well as same result;
cd /media/marziyeh/56F72A78084DABD5/RNA-seqdata/viewed_samtools/;/home/marziyeh/Software/samtools-1.6/samtools sort -n -l 9 -@ 4 -m 3G -o /media/marziyeh/56F72A78084DABD5/RNA-seqdata/sorted.sample/sample32_sorted.bam -O bam -n -T /media/marziyeh/56F72A78084DABD5/RNA-seqdata/sorted_file -@ 4 /media/marziyeh/56F72A78084DABD5/RNA-seqdata/viewed_samtools/sample32_sortedin22.bam
Error is here: [E::sam_parse1] missing SAM header [W::sam_read1] Parse error at line 1 samtools sort: truncated file. Aborting
thanks, I'm run your suggestion now with this command line; ./samtools view -H /media/marziyeh/56F72A78084DABD5/RNA-seqdata/viewed_samtools/sample32_sortedin22.bam but gives anything.
To include header section to your output BAM run samtools command:
Here parameter indicates that
After performing this step, sort yourfile.bam using samtools sort command
Hope this works Best