Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
samtools converting sam to bam filtering lre1234 Bioinformatics 6 10-30-2013 12:10 PM
samtools converting sam>bam Kienan Bioinformatics 17 07-16-2013 09:01 AM
BWA sam and Samtools sam->bam conversion problem maasha Bioinformatics 6 06-05-2013 07:39 AM
Help in converting Sam to Bam! zhacker Bioinformatics 15 04-21-2013 05:03 AM
SAM (from bowtie2) to BAM problem using samtools amango Bioinformatics 10 04-15-2013 12:52 AM

Thread Tools
Old 02-20-2017, 04:28 PM   #1
Location: South East Asia

Join Date: Nov 2008
Posts: 44
Default Problem Converting BAM to SAM on to Amazon S3 Using Samtools

In my Amazon EC2 instance I have the following:

ubuntu@ip-133-31-16-230:~$ df -h
Filesystem       Size  Used Avail Use% Mounted on
udev              79G     0   79G   0% /dev
tmpfs             16G  8.8M   16G   1% /run
/dev/xvda1       985G  136G  809G  15% /
tmpfs             79G     0   79G   0% /dev/shm
tmpfs            5.0M     0  5.0M   0% /run/lock
tmpfs             79G     0   79G   0% /sys/fs/cgroup
tmpfs             16G     0   16G   0% /run/user/1000
bar-something  1.0P     0  1.0P   0% /home/ubuntu/bar-something-data
bar-foolishbrat  1.0P     0  1.0P   0% /home/ubuntu/bar-foolisbrat-data
The last two file system `bar-bi` and `bar-foolishbrat` are Amazon S3 bucket,
mounted with the following command:

/home/ubuntu/go/bin/goofys bar-foolishbrat bar-foolishbrat-data
/home/ubuntu/go/bin/goofys bar-somehting bar-something-data
# Here we use Goofys. It can be achieved also with S3FS.
Now I have no problem doing this, in my instance

samtools view -h ~/bar-something-data/myfile.bam > test.sam
That is writing the SAM file in my instance file system. But when I do this, namely writing to the mounted S3:

samtools view -h ~/bar-something-data/myfile.bam > ~/bar-something-data/test.sam
It gave the following error:

samtools: writing to standard output failed: Invalid argument
samtools: error closing standard output: -1
How can I resolve this issue? Is there any other tool for converting BAM to SAM other than samtools?

Last edited by foolishbrat; 02-20-2017 at 04:35 PM.
foolishbrat is offline   Reply With Quote
Old 02-20-2017, 05:11 PM   #2
David Eccles (gringer)
Location: Wellington, New Zealand

Join Date: May 2011
Posts: 836

Is there any other tool for converting BAM to SAM other than samtools?
Ignoring the obvious "... why?"

Probably, but why would you want to use a spoon to dig yourself out of a hole when the excavator is still there?

The most recent versions of the samtools packages allow writing directly to files ('-o <fileName>'), which may fix the output redirect issue you have. I don't know for sure, because I've never played around with EC2.
gringer is offline   Reply With Quote

amazon s3, amazon web services, samtools

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 07:21 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO