Missing SAM header?
1
0
Entering edit mode
Chris Fenton ▴ 80
@chris-fenton-3854
Last seen 8.0 years ago
Norway

Trying to follow the following recommended procedure ""http://www.nimblegen.com/products/lit/07187009001_NG_SeqCap_TechNote_EvalEZdata.pdf"
Have seen a lot of similar posts on bioconductor about sam headers, unfortunately none that sheds light on this problem. 
Anyone have a clue? 

Thanks, Chris 

Background: 

>>> java -jar ../apps/trimmomatic/trimmomatic-0.32.jar PE -phred33 sample_R1_001.fastq sample_R2_001.fastq sample_R1_001_trimmed.fq sample_R1_001_unpaired.fq sample_R2_001_trimmed.fq sample_R2_001_unpaired.fq ILLUMINACLIP:../apps/trimmomatic/adapters/TruSeq3-PE.fa:2:30:10 LEADING:20 TRAILING:20 SLIDINGWINDOW:5:20 MINLEN:75

TrimmomaticPE: Started with arguments: -phred33 sample_R1_001.fastq sample_R2_001.fastq sample_R1_001_trimmed.fq sample_R1_001_unpaired.fq sample_R2_001_trimmed.fq sample_R2_001_unpaired.fq ILLUMINACLIP:../apps/trimmomatic/adapters/TruSeq3-PE.fa:2:30:10 LEADING:20 TRAILING:20 SLIDINGWINDOW:5:20 MINLEN:75

Multiple cores found: Using 2 threads

Using PrefixPair: 'TACACTCTTTCCCTACACGACGCTCTTCCGATCT' and 'GTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT'
ILLUMINACLIP: Using 1 prefix pairs, 0 forward/reverse sequences, 0 forward only sequences, 0 reverse only sequences
Input Read Pairs: 65290734 Both Surviving: 45006507 (68.93%) Forward Only Surviving: 12263552 (18.78%) Reverse Only Surviving: 2683491 (4.11%) Dropped: 5337184 (8.17%)
TrimmomaticPE: Completed successfully

>>> /path/to/bwa mem -R "@RG\tID:TEST_SAMPLE\tPL:illumina\tLB:TEST_SAMPLE\tSM:TEST_SAMPLE" /path/to/ref.fa –t 4 -M SAMPLE_R1_trimmed.fq SAMPLE_R2_trimmed.fq | /path/to/samtools view -Sb - > SAMPLE_unsorted.bam

>>>head -n1 Sample_unsorted.bam  gives 

HWI-ST1337:134:C41YMACXX:8:1101:1239:1466       99      chr10   46233512        55      101M    =       46233685        274     TCTTAGCTGAGTTTCTGACTTTGAAAAGTGTGGTGGAGATCGATGTGTTATGTGGGAACTGGGGGATGGTGGGTGGGGTTGGGAAAGGGAGGGACTGCTCC   @CCFFFFFFFHHHIHIIGGIJJIBHHIGEHCHHFHGFHGHIGGEIHIGHHIIIIDHBFGFHIIJJBBBD;A?B9>BBB<9BBD+388ABABDD@8?<AA@:   NM:i:0  MD:Z:101        AS:i:101        XS:i:91 RG:Z:TEST_SAMPLE XA:Z:chr10,+47894653,101M,2;chr10,+51838516,101M,2;

>>> ../samtools sort SAMPLE_unsorted.bam SAMPLE_sorted

output: 
[E::sam_parse1] missing SAM header
[W::sam_read1] parse error at line 1
[bam_sort_core] truncated file. Continue anyway.

Info: 

bwa-0.7.10
picard-tools-1.121
samtools-1.1
Trimmomatic-0.32

sequencing • 5.4k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 5 hours ago
United States

There are at least three problems here.

1.) This is the wrong list. Try seqanswers.com or maybe biostars.org.

2.) You aren't showing what you actually did. Instead you are cutting and pasting generalized code. If you don't show what you did, how can anybody help you? When you repost elsewhere, make sure to show what you did.

3.) If you do head -n 1 Sample_unsorted.bam and get ASCII text returned, then you don't have a BAM file (which are binary). In addition, if the first line is a read, then you don't really have a SAM file either, because there isn't a header. Hence the errors about a missing SAM header and truncated file (which is because samtools is expecting a binary file and you are giving it a text file)

ADD COMMENT

Login before adding your answer.

Traffic: 273 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6