Question: Errors with Picard CollectRnaSeqMetrics
gravatar for bertb
4 weeks ago by
bertb10 wrote:


I'm trying to run a QC on my bam files for an RNAseq, but when I run the command:

find *U*.bam -exec echo java -jar ~/path/picard.jar CollectRnaSeqMetrics I={} O=picard/{}.RNA_Metrics REF_FLAT=$RNA_HOME/refs/sacCer3.ncbiRefSeq.ref_flat.txt STRAND=SECOND_READ_TRANSCRIPTION_STRAND RIBOSOMAL_INTERVALS=$RNA_HOME/refs/ref_ribosome.interval_list \; | sh

I receive an error about missing an SM tag:

Exception in thread "main" htsjdk.samtools.SAMFormatException: Error parsing SAM header. @RG line missing SM tag. Line:
@RG ID:UMH; File /home/path/to/file/UMH.bam; Line number 19
    at htsjdk.samtools.SAMTextHeaderCodec.reportErrorParsingLine(
    at htsjdk.samtools.SAMTextHeaderCodec.access$200(
    at htsjdk.samtools.SAMTextHeaderCodec$ParsedHeaderLine.requireTag(
    at htsjdk.samtools.SAMTextHeaderCodec.parseRGLine(
    at htsjdk.samtools.SAMTextHeaderCodec.decode(
    at htsjdk.samtools.BAMFileReader.readHeader(
    at htsjdk.samtools.BAMFileReader.<init>(
    at htsjdk.samtools.BAMFileReader.<init>(
    at htsjdk.samtools.SamReaderFactory$
    at htsjdk.samtools.SamReaderFactory$
    at picard.analysis.SinglePassSamProgram.makeItSo(
    at picard.analysis.SinglePassSamProgram.doWork(
    at picard.cmdline.CommandLineProgram.instanceMain(
    at picard.cmdline.PicardCommandLine.instanceMain(
    at picard.cmdline.PicardCommandLine.main(

I found some posts that talked about removing the SM tag, and whether or not that was possible/required, but didn't know how I might apply that here. I'm also not sure how to view the BAM file to inspect the @RG line.

Any help would be appreciated!


ADD COMMENTlink modified 4 weeks ago by Pierre Lindenbaum131k • written 4 weeks ago by bertb10
gravatar for Pierre Lindenbaum
4 weeks ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum131k wrote:

Your SAM header has a @RG line without the SM: (sample) attribute.

See :

. I'm also not sure how to view the BAM file to inspect the @RG line.

samtools view -H UMH.bam | grep '^@RG'
ADD COMMENTlink modified 4 weeks ago • written 4 weeks ago by Pierre Lindenbaum131k

Ok, I'm going to try that next. Thanks!

ADD REPLYlink written 4 weeks ago by bertb10
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1268 users visited in the last hour