blobtools icon indicating copy to clipboard operation
blobtools copied to clipboard

Bamfilter outputting .fa instead of .fq

Open theo-llewellyn opened this issue 4 years ago • 3 comments

Hello, Thanks for blobTools, it's a really wonderful piece of software. I'm using the bamfilter module to extract all sequences mapping to contigs of a particular taxon and though the original sequences were pe .fq files, bamfilter outputs .fa files. Do you know why this is and how to ensure .fq as the output format? My bam file was produced using bwa mem and then gatk. Cheers, Theo

theo-llewellyn avatar Apr 09 '20 09:04 theo-llewellyn

I'm also running into this issue.

bjreisman avatar Aug 14 '20 18:08 bjreisman

It's not in the web documentation on the site (https://blobtools.readme.io/docs/bamfilter), but you can output fastq using the -f fq flag of blobtools bamfilter. Just tested and it works. Fasta is the default.

(blobtools) [user@server blobtools]$ blobtools bamfilter -h usage: blobtools bamfilter -b FILE [-i FILE] [-e FILE] [-U] [-n] [-o PREFIX] [-f FORMAT] [-h|--help]

Options:
    -h --help                   show this
    -b, --bam FILE              BAM file (sorted by name)
    -i, --include FILE          List of contigs whose reads are included
                                - writes FASTAs of pairs where at least
                                    one read maps sequences in list
                                    (InUn.fq, InIn.fq, ExIn.fq)
    -e, --exclude FILE          List of contigs whose reads are excluded (outputs reads that do not map to sequences in list)
                                - writes FASTAs of pairs where at least
                                    one read does not maps to sequences in list
                                    (InUn.fq, InIn.fq, ExIn.fq)
    -U, --exclude_unmapped      Exclude pairs where both reads are unmapped
    -n, --noninterleaved        Use if fw and rev reads should be in separate files
    -f, --read_format FORMAT    FASTQ = fq, FASTA = fa [default: fa]
    -o, --out PREFIX            Output prefix

margaretc-ho avatar May 23 '23 15:05 margaretc-ho

great thanks for your help!

theo-llewellyn avatar May 23 '23 16:05 theo-llewellyn