Notice:
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra


Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.
Attention:
We will be out of the office on November 11th and 13th 2019, due to the U.S. holiday(Veteran's day) and due to a team event(Nov 13th). We will return to monitoring the GATK forum on November 12th and 14th respectively. Thank you for your patience.

Picard FilterSamReads not working

Hello,

I am using FilterSamReads in Picard to remove reads from a BAM file that are 1) marked as either both first/second of pair and 2) do not have a mate pair. I am supplying the program with a .txt file containing a list of the reads that I wish to exclude.

Unfortunately, when I run ValidateSamFile, the new BAM file from FilterSamReads still has all the reads I thought it had deleted.

Here is the command I'm using.

java -jar FilterSamReads.jar I=example.bam EXCLUDE_READS=reads_to_remove.txt O=GG_example_filtered.bam

Any help would be greatly appreciated.

Answers

  • shleeshlee CambridgeMember, Broadie ✭✭✭✭✭

    Hi @freuv,

    I'm just about to run FilterSamReads myself. The tool expects you to define a FILTER mode for the reads in the list, e.g. FILTER=includeReadList to pick them out or FILTER=excludeReadList to remove them.

    Here's an example command:

    java -jar /home/shlee/picard-2.11.0/picard.jar FilterSamReads \
        INPUT=hcc1143_N_clean_querysort.bam \
        OUTPUT=mates_N_chr17.bam \
        FILTER=includeReadList \
        READ_LIST_FILE=f1_N_chr17.txt \
        SORT_ORDER=coordinate \
        CREATE_INDEX=true \
        TMP_DIR=/tmp
    
Sign In or Register to comment.