SEQanswers

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 01:10 PM
samtools converting sam>bam Kienan Bioinformatics 17 07-16-2013 10:01 AM
BWA sam and Samtools sam->bam conversion problem maasha Bioinformatics 6 06-05-2013 08:39 AM
Help in converting Sam to Bam! zhacker Bioinformatics 15 04-21-2013 06:03 AM
SAM (from bowtie2) to BAM problem using samtools amango Bioinformatics 10 04-15-2013 01:52 AM

Reply
 
Thread Tools
Old 02-20-2017, 05:28 PM   #1
foolishbrat
Member
 
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:

Code:
[email protected]:~$ 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:

Code:
/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

Code:
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:

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

Code:
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 05:35 PM.
foolishbrat is offline   Reply With Quote
Old 02-20-2017, 06:11 PM   #2
gringer
David Eccles (gringer)
 
Location: Wellington, New Zealand

Join Date: May 2011
Posts: 823
Default

Quote:
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
Reply

Tags
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 12:12 PM.


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