Skip to content

Suggested parameters for bam filtering #76

@atfields

Description

@atfields

Hey,

I have been experimenting with some of my datasets and I have found that filtering the bam files prior to SNP calling not only reduces the number of SNPs which come out of freebayes, but also reduces the filtering needed to remove artifacts from my data. Using bamtools filter I remove

  • reads not properly paired
  • reads on secondary alignments
  • Mapping quality less than a given value

I think if you added this as a module before freebayes, then people could add the filters they wanted in a filter script if they wanted to use it.

Something like:

if [[ $FILTER = "yes" ]]; then
    if [ -z filter.txt ]; then
        echo "Please provide the bam filters"
        exit 1
    fi
    bamtools filter -script filter.txt -in cat-RRG.bam -out cat-RRG_filter.bam;
    mv cat-RRG_filter.bam cat-RRG.bam
fi

Then filter.txt scripts could be something like this:

{
"isPrimaryAlignment" : "true",
"isProperPair" : "true",
"mapQuality" : ">=40"
}

according to the bamtools filter manual.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions