Samtools 1.3 bam to fastq
1
2
Entering edit mode
8.1 years ago
skbrimer ▴ 740

Hi group,

Just a quick question, how to I properly use the fastq command in samtools 1.3? According to the documentation I should be doing this:

samtools fastq -On -s ion36_nohost.fastq ion36_nohost.bam

but the result is this:

[M::bam2fq_mainloop_singletontrack] discarded 0 singletons

[M::bam2fq_mainloop_singletontrack] processed 0 reads

I'm trying to get the unmapped reads. My bam file does contain the reads in question but I'm doing something wrong since they switched to fastq from bam2fq

Any idea?

software error • 27k views
ADD COMMENT
11
Entering edit mode
8.1 years ago
skbrimer ▴ 740

I must have misunderstood the docs becasue this was at the top and works

samtools fastq input.bam > output.fastq

but the detail doc is different here:

samtools fastq [options] in.bam samtools fasta [options] in.bam

Converts a BAM or CRAM into either FASTQ or FASTA format depending on the command invoked.

OPTIONS:

-n By default, either '/1' or '/2' is added to the end of read names where the corresponding BAM_READ1 or BAM_READ2 flag is set. Using -n causes read names to be left as they are.

-O Use quality values from OQ tags in preference to standard quality string if available.

-s FILE Write singleton reads in FASTQ format to FILE instead of outputting them.

-t Copy RG, BC and QT tags to the FASTQ header line, if they exist.

-1 FILE Write reads with the BAM_READ1 flag set to FILE instead of outputting them.

-2 FILE Write reads with the BAM_READ2 flag set to FILE instead of outputting them.

-0 FILE Write reads with both or neither of the BAM_READ1 and BAM_READ2 flags set to FILE instead of outputting them.

-f INT Only output alignments with all bits set in INT present in the FLAG field. INT can be specified in hex by beginning with 0x' (i.e. /^0x[0-9A-F]+/) or in octal by beginning with0' (i.e. /^0[0-7]+/) [0].

-F INT Do not output alignments with any bits set in INT present in the FLAG field. INT can be specified in hex by beginning with 0x' (i.e. /^0x[0-9A-F]+/) or in octal by beginning with0' (i.e. /^0[0-7]+/) [0].

ADD COMMENT
0
Entering edit mode

Can you get points for figuring out our own question?

ADD REPLY
1
Entering edit mode

Hell yeah you can - I just gave you an upvote for exactly that :)

ADD REPLY
0
Entering edit mode

That's great thanks John!

ADD REPLY

Login before adding your answer.

Traffic: 2065 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6