Hi all,
I am using samtools collate to convert my bam files to paired end fastq files. here is the command that I am using
samtools view -h -T mm10.fa {input.bam} | samtools collate -O -u -@ {threads} - | samtools fastq -1 output_paired1.fq.gz -2 output_paired2.fq.gz -0 /dev/null -s /dev/null - 2>>{log}
but when I am running it shows me the usage of samtools collate is not correct
Usage: samtools collate [-Ou] [-n nFiles] [-l cLevel] <in.bam> <out.prefix>
Options:
-O output to stdout
-u uncompressed BAM output
-l INT compression level [1]
-n INT number of temporary files [64]
--input-fmt-option OPT[=VAL]
Specify a single input file format option in the form
of OPTION or OPTION=VALUE
--output-fmt FORMAT[,OPT[=VAL]]...
Specify output format (SAM, BAM, CRAM)
--output-fmt-option OPT[=VAL]
Specify a single output file format option in the form
of OPTION or OPTION=VALUE
--reference FILE
Reference sequence FASTA FILE [null]
-@, --threads INT
Number of additional threads to use [0]
I could not realize how to correct my command line. is the prefix is matter? but it is optional I would be grateful if anyone can help me.
Thank you in advance!
What is the exact error message?
there is no error massage it just give me
What is the output to
samtools view {input.bam} | head
?it displays a few lines of bam files
Try adding STDOUT at the end to the collate command like so:
Any string will do, it just needs something to prefix tmp files. Also, you don't need the view command at all.
The usage doc needs to be better then - the angle brackets around the out prefix param is the only hint that points to the possibility that it could be required even when common sense says it's not. One would expect a tool built by lh3 to either specify this explicitly or use a default prefix when not provided one.
what does - STDOUT do? (which @Ram mentioned) is it like to do the prefix tmp files? and how and when do I have to realize to use STDOUT? for the view command, I wanted to use the ref.fa for proper interpretation of the alignment positions, isn't that necessary?
Reference is only needed with
.cram
format files.what is 'proper interpretation of alignment positions'? no not necessary.
the first
samtools view
is useless