The current GATK version is 3.7-0
Examples: Monday, today, last week, Mar 26, 3/26/04

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Did you remember to?


1. Search using the upper-right search box, e.g. using the error message.
2. Try the latest version of tools.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

Did we ask for a bug report?


Then follow instructions in Article#1894.

Formatting tip!


Surround blocks of code, error messages and BAM/VCF snippets--especially content with hashes (#)--with lines with three backticks ( ``` ) each to make a code block.
Powered by Vanilla. Made with Bootstrap.
Picard 2.9.0 is now available. Download and read release notes here.
GATK 3.7 is here! Be sure to read the Version Highlights and optionally the full Release Notes.

FilterSamReads

vmicrobiovmicrobio ParisMember Posts: 3

Hello,
I have a problem to run FilterSamReads and I don't know exactly how to resolve it:
I have an input bam file (inputsorted.bam) and I want to filter it using this command:
java -jar picard.jar FilterSamReads I="inputsorted.bam", O="output.bam", READ_LIST_FILE="read_names.txt", FILTER="includeAligned"

However this message appear:
[Tue Nov 22 09:41:53 CET 2016] picard.sam.FilterSamReads INPUT=inputsorted.bam, FILTER=includeAligned [OUTPUT SAM/BAM will contain aligned reads only. INPUT SAM/BAM must be in queryname SortOrder. (Note that both first and second of paired reads must be aligned to be included in the OUTPUT SAM or BAM)] READ_LIST_FILE=read_names.txt, OUTPUT=output.bam, WRITE_READS_FILES=true VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json
[Tue Nov 22 09:41:53 CET 2016] Executing as admin_viro@OptiPlex-390 on Linux 3.13.0-101-generic amd64; Java HotSpot(TM) 64-Bit Server VM 1.8.0_111-b14; Picard version: unspecified-SNAPSHOT
ERROR 2016-11-22 09:41:53 FilterSamReads Failed to filter inputsorted.bam,
htsjdk.samtools.SAMException: Cannot read non-existent file: /home/admin/Bureau/e/inputsorted.bam,
at htsjdk.samtools.util.IOUtil.assertFileIsReadable(IOUtil.java:338)
at htsjdk.samtools.util.IOUtil.assertFileIsReadable(IOUtil.java:325)
at picard.sam.FilterSamReads.doWork(FilterSamReads.java:210)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:208)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105)
[Tue Nov 22 09:41:53 CET 2016] picard.sam.FilterSamReads done. Elapsed time: 0,00 minutes.
Runtime.totalMemory()=62390272
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp

I don't understand because I generated my bam and sorted it as usual.

To check what could be the problem:

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

java -jar picard.jar ValidateSamFile I=inputsorted.bam,MODE=SUMMARY

[Tue Nov 22 09:43:57 CET 2016] picard.sam.ValidateSamFile INPUT=sel3ul54sorted.bam,MODE=SUMMARY MODE=VERBOSE MAX_OUTPUT=100 IGNORE_WARNINGS=false VALIDATE_INDEX=true INDEX_VALIDATION_STRINGENCY=EXHAUSTIVE IS_BISULFITE_SEQUENCED=false MAX_OPEN_TEMP_FILES=8000 VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json
[Tue Nov 22 09:43:57 CET 2016] Executing as admin@OptiPlex-390 on Linux 3.13.0-101-generic amd64; Java HotSpot(TM) 64-Bit Server VM 1.8.0_111-b14; Picard version: unspecified-SNAPSHOT
[Tue Nov 22 09:43:57 CET 2016] picard.sam.ValidateSamFile done. Elapsed time: 0,00 minutes.
Runtime.totalMemory()=62390272
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp

Thank you very much for your help

Arnaud

Best Answer

Answers

  • vmicrobiovmicrobio ParisMember Posts: 3
    edited November 2016

    using the correct path and command line: java -jar picard.jar FilterSamReads I=inputsorted.bam O=output.bam READ_LIST_FILE=read_names.txt FILTER="includeAligned"

    INFO 2016-11-22 17:10:03 FilterSamReads Filtering [presorted=true] inputsorted.bam -> OUTPUT=output.bam [sortorder=coordinate]
    ERROR 2016-11-22 17:10:03 FilterSamReads Failed to filter inputsorted.bam
    java.lang.IllegalStateException: Records ZUXCF:09931:13729 (AA_AD169:43) should come after ZUXCF:04851:08815 (AA_AD169:43) when sorting with htsjdk.samtools.SAMRecordQueryNameComparator
    at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:549)
    at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:519)
    at htsjdk.samtools.util.PeekableIterator.advance(PeekableIterator.java:68)
    at htsjdk.samtools.util.PeekableIterator.next(PeekableIterator.java:54)
    at htsjdk.samtools.filter.FilteringSamIterator.getNextRecord(FilteringSamIterator.java:131)
    at htsjdk.samtools.filter.FilteringSamIterator.next(FilteringSamIterator.java:106)
    at picard.sam.FilterSamReads.filterReads(FilterSamReads.java:169)
    at picard.sam.FilterSamReads.doWork(FilterSamReads.java:254)
    at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:208)
    at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95)
    at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105)
    [Tue Nov 22 17:10:03 CET 2016] picard.sam.FilterSamReads done. Elapsed time: 0,00 minutes.
    Runtime.totalMemory()=62390272
    To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp

  • vmicrobiovmicrobio ParisMember Posts: 3
Sign In or Register to comment.