I have raw data fastq.gz files for some samples. Using Hisat2 for aligning reads to genome and used samtools converted sam to bam format. Also used samtools sort for sorting the bam file. For all the samples I used following command:
hisat2 -p 8 --dta --rna-strandness RF --trim3 3 -x genome_snp_tran -1 /A.1.fastq.gz -2 /A.2.fastq.gz | samtools view -Sb - > A.bam
samtools sort -T /tmp/A.sorted -o A.sorted.bam A.bam
A.1.fastq.gz 8.9G
A.2.fastq.gz 9.7G
For most of the samples this worked. For one sample I got an error at sorting step. I got the A.bam file (40G) but got an error for sorting.
[E::bgzf_flush] hwrite error (wrong size)
[E::bgzf_close] file write error
[bam_sort_core] failed to create temporary file "/tmp/A.sorted.0468.bam": No space left on device
What I have to do now?
What I should do now for sorting step?
You'll additionally want to set a temporary directory with the
-T
option, like-T /some/place/with/space/FileName
.Bioinfo : Add this option to the command @Wouter provided above.
As you can see I added the sorting step to the end of the hisat command.
Thank you very much for the answers !!