## Filter and trim BAM

### Description

This Drop-seq tool removes reads where the cell or molecular barcode has low quality bases, trims adapters and polyA tails.

This tool is a combination of three Drop-seq tools: FilterBAM, TrimStartingSequence and PolyATrimmer.
First, the information added to the XQ tag in Tag BAM tool is used to filter out reads where more than one (1) base have quality below the threshold used in this Tag BAM tool (default: 10).
Next, any user determined sequences are trimmed away. User can determine how many mismatches are allowed in these sequences (default: 0), and how long stretch of the sequence there has to be in the read at least (default: 5 bases). The SMART Adapter sequence is offered as a default.
Lastly, trailing polyA tails are hard clipped from the reads. The tools searches for contiguous A's from the end of the read. User is again allowed to determine the number of mismatches allowed (default: 0) and how many A's there at least need to be for the clipping to happen (default: 6).

Please note that after this tool, you might end up having some rather short reads in your BAM file. It might be advisable to remove those, as this makes the alignment step faster. For this purpose you can use for example the Trimmomatic tool.

For more details, please check the Drop-seq manual.

### Parameters

- Adapter sequence [AAGCAGTGGTATCAACGCAGAGTGAATGGG]
- Mismatches in adapter [0]
- Number of bases to check in adapter [5]
- Mismatches in polyA [0]
- Number of bases to check in polyA [6]

### Output

- unaligned_tagged_polyA_filtered.bam : Filtered BAM
- adapter_trim_summary.txt : Summary of the adapter trimming step
- polyA_trimming_report.txt : Summary of the polyA trimmming step