On Thu, 14 Mar 2019, Aengus Stewart wrote:

Our sequencer is now outputting header lines with the following format

@M02212:177:000000000-CBJHK:1:1101:11456:1264 1:N:0:AGGCAGAA+CTCTCTAT

If I use BWA with the -C flag then this header info gets sent to the .sam output 
file however in the sam->bam conversion I am
getting

[M::mem_pestat] skip orientation RR as there are not enough pairs
[M::mem_process_seqs] Processed 202164 reads in 14.429 CPU sec, 3.606 real sec
[E::sam_parse1] unrecognized type :
[W::sam_read1] Parse error at line 11

I am running modules for SAMtools/1.9-foss-2018b BWA/0.7.17-foss-2018b

my default commandline would look like

bwa mem -t 4 -M -B 2 -C -R
"@RG\tID:B-Zhejiang-Wuxin-113-2018_QFX\tLB:B-Zhejiang-Wuxin-113-2018_QFX\tSM:B-Zhejiang-Wuxin-113-2018_QFX\tPL:ILLUMINA"
 \
      
/camp/stp/babs/working/stewara/projects/asf/laura.cubitt/RN19003/reference/swH1N1
 \
      B-Zhejiang-Wuxin-113-2018_QFX.R1.trim.fastq \
      B-Zhejiang-Wuxin-113-2018_QFX.R2.trim.fastq | \
      samtools sort -@4 -O BAM -o B-Zhejiang-Wuxin-113-2018_QFX.swH1N1.test.bam 
-

Your fastq comments need to be valid SAM tags.  From the BWA manual page:

    -C        Append FASTA/Q comment to SAM output. This option  can
              be  used  to transfer read meta information (e.g. bar‐
              code) to the SAM output. Note that the FASTA/Q comment
              (the  string  after  a  space in the header line) must
              conform the SAM spec  (e.g.  BC:Z:CGTAC).  Malformated
              comments lead to incorrect SAM output.

So if you want to put a barcode sequence into the SAM BC tag, you would need something like this:

@M02212:177:000000000-CBJHK:1:1101:11456:1264 BC:Z:AGGCAGAA-CTCTCTAT


Rob Davies              r...@sanger.ac.uk
The Sanger Institute    http://www.sanger.ac.uk/
Hinxton, Cambs.,        Tel. +44 (1223) 834244
CB10 1SA, U.K.          Fax. +44 (1223) 494919


--
The Wellcome Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to