The samtools "Working on a stream" page (http://samtools.sourceforge.net/pipe.shtml) says:
"In fact, most of samtools commands, except indexing and external sorting, recognize an input file `-' as stdin and an output file `-' as stdout."
I suppose the rationale is if you're sorting an input list, you can't send items away before you know which position in the output list they will have, making working on the stream trickier.
Seqanswers Leaderboard Ad
Collapse
Announcement
Collapse
No announcement yet.
X
-
Try providing an output prefix anyway. Even if you specify -o, I think samtools will use that prefix to create temp files if the BAM to be sorted won't fit in memory.
So to modify your example,
Code:samtools view -b -q 30 in.bam | samtools sort -o - deleteme > out.bam
Leave a comment:
-
samtools sort stdout
Hello
I am mapping reads from bacterial sequences to reference genomes and I am using bwa and samtools. I am trying to set up a pipeline and want to use stdin and stdout and pipe the data to avoid temporary files. I am using samtools-0.1.13.
Do you know if you can get the output of samtools sort to stdout?
The manual pages says that the -o option means stdout for samtools sort , but it doesn't seem to work on my system.
Here is the command line I have used to make quality filtering and sorting in one line and the error message I get:
>samtools view -b -q 30 5139_6_7.paired_ends.bam | samtools sort -o - > temp
Usage: samtools sort [-on] [-m <maxMem>] <in.bam> <out.prefix>
>samtools view -b -q 30 5139_6_7.paired_ends.bam | samtools sort - - > temp
And this makes as expected an empty temp file and the sorted alignment in "-.bam"
Do you know how I can avoid the *.bam output file?
Thanks
Peder Worning
Latest Articles
Collapse
-
by seqadmin
Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...-
Channel: Articles
04-04-2024, 04:25 PM -
-
by seqadmin
Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...-
Channel: Articles
03-22-2024, 06:39 AM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, 04-11-2024, 12:08 PM
|
0 responses
30 views
0 likes
|
Last Post
by seqadmin
04-11-2024, 12:08 PM
|
||
Started by seqadmin, 04-10-2024, 10:19 PM
|
0 responses
32 views
0 likes
|
Last Post
by seqadmin
04-10-2024, 10:19 PM
|
||
Started by seqadmin, 04-10-2024, 09:21 AM
|
0 responses
28 views
0 likes
|
Last Post
by seqadmin
04-10-2024, 09:21 AM
|
||
Started by seqadmin, 04-04-2024, 09:00 AM
|
0 responses
53 views
0 likes
|
Last Post
by seqadmin
04-04-2024, 09:00 AM
|
Leave a comment: