Hello,
I am trying to convert some sam files to bam and I am facing some problems.
After having mapped my fq files using STAR aligner with this command:
/data/home/hhx037/STAR/STAR --genomeDir /share/panosscratch/REPOSITORY/Reference_genomes/GRCh37.75/STAR --readFilesIn /share/panosscratch/REPOSITORY/SEQUENCING/Stanislas/fastq/$sample.end1.fq /share/panosscratch/REPOSITORY/SEQUENCING/Stanislas/fastq/$sample.end2.fq --runThreadN 4 --outFileNamePrefix $sample --outSAMattributes Standard
I am trying to convert the SAM file I got to BAM files. The header of one of my samfile looks like:
@HD VN:1.4
@SQ SN:1 LN:249250621
@SQ SN:2 LN:243199373
@SQ SN:3 LN:198022430
@SQ SN:4 LN:191154276
@SQ SN:5 LN:180915260
@SQ SN:6 LN:171115067
@SQ SN:7 LN:159138663
@SQ SN:8 LN:146364022
@SQ SN:9 LN:141213431
@SQ SN:10 LN:135534747
@SQ SN:11 LN:135006516
@SQ SN:12 LN:133851895
@SQ SN:13 LN:115169878
@SQ SN:14 LN:107349540
@SQ SN:15 LN:102531392
@SQ SN:16 LN:90354753
@SQ SN:17 LN:81195210
@SQ SN:18 LN:78077248
@SQ SN:19 LN:59128983
@SQ SN:20 LN:63025520
@SQ SN:21 LN:48129895
@SQ SN:22 LN:51304566
@SQ SN:X LN:155270560
@SQ SN:Y LN:59373566
@SQ SN:MT LN:16569
@PG ID:STAR PN:STAR VN:STAR_2.4.0e CL:/data/home/hhx037/STAR/STAR --runThreadN 4 --genomeDir /share/panosscratch/REPOSITORY/Reference_genomes/GRCh37.75/STAR --readFilesIn /share/panosscratch/REPOSITORY/SEQUENCING/Stanislas/fastq/2660_stanislas.end1.fq /share/panosscratch/REPOSITORY/SEQUENCING/Stanislas/fastq/2660_stanislas.end2.fq --outFileNamePrefix 2660_stanislas --outSAMattributes Standard
@CO user command line: /data/home/hhx037/STAR/STAR --genomeDir /share/panosscratch/REPOSITORY/Reference_genomes/GRCh37.75/STAR --readFilesIn /share/panosscratch/REPOSITORY/SEQUENCING/Stanislas/fastq/2660_stanislas.end1.fq /share/panosscratch/REPOSITORY/SEQUENCING/Stanislas/fastq/2660_stanislas.end2.fq --runThreadN 4 --outFileNamePrefix 2660_stanislas --outSAMattributes Standard
The command I am for the conversion is
samtools view -bS samfile.sam > bamfile.bam
And the error message when I am trying to view the bamfile.bam is:
[W::sam_read1] parse error at line 1
[main_samview] truncated file.
Any thoughts?
Thank you in advance.