BWA aligning help
1
0
Entering edit mode
9.9 years ago
lcc1844 ▴ 40

I have used BWA-0.7.12 to align my reference to my reads using this command:

bwa mem hg19.fa reads.fq > aln.sam

It worked away for over an hour showing many lines of the same read/sequences message followed by this ending:

[M::main_mem] read 66226 sequences (10000126 bp)...
[M::main_mem] read 66226 sequences (10000126 bp)...
[M::main_mem] read 66226 sequences (10000126 bp)...
[M::main_mem] read 66226 sequences (10000126 bp)...
[M::main_mem] read 32148 sequences (4854348 bp)...
[main] Version: 0.7.5a-r405
[main] CMD: bwa mem hg19.fa read.fq
[main] Real time: 4518.796 sec; CPU: 4011.641 sec

I got the file aln.sam from this but now I am lost. I tried to open it and can't and I've tried to use Picard to convert it to a BAM file and got the error

[main_samview] fail to open "aln.sam" for reading

I am confused as to whether I have in fact aligned anything and got a SAM file with information in it! Any advice on what to try from here would be great as I am learning this all from scratch by myself.

Many thanks
Laura

software-error • 3.2k views
ADD COMMENT
0
Entering edit mode

The BWA prompt output seems OK... It is strange that you are not able to open it. How are you trying to open? Because maybe the file is to big to open with gedit, if you do head aln.sam do you see something?

ADD REPLY
0
Entering edit mode

Hi thank you all for responding - sorry for the late response (internet issues).

For head aln.sam I see:

@SQ    SN:chr10    LN:135534747
@SQ    SN:chr11    LN:135006516
@SQ    SN:chr12    LN:133851895
@SQ    SN:chr13    LN:115169878
@SQ    SN:chr14    LN:107349540
@SQ    SN:chr15    LN:102531392
@SQ    SN:chr16    LN:90354753
@SQ    SN:chr17    LN:81195210
@SQ    SN:chr18    LN:78077248
@SQ    SN:chr19    LN:59128983

For whoami && groups && ls -l aln.sam I see:

lcollopy adm cdrom sudo dip plugdev lpadmin sambashare
-rwxr-xr-x 1 lcollopy lcollopy 11519027162 Feb  4 16:09 aln.sam

Thanks again!

ADD REPLY
0
Entering edit mode

That means that your sam file is OK. You can continue :). You can follow your analysis using Pierre's suggestion to convert sam to bam.

ADD REPLY
0
Entering edit mode

Please give us the output of:

whoami && groups && ls -l aln.sam
ADD REPLY
1
Entering edit mode
9.9 years ago

You generated SAM, not BAM. It's just a text file. You can 'view' it with

more aln.sam

if you want to convert it to BAM use:

samtools view -Sb -o aln.bam aln.sam
ADD COMMENT
0
Entering edit mode

Hi thank you, my problem is when I try the conversion command I get this message:

[main_samview] fail to open "aln.sam" for reading

I now think my aln.sam file might be ok but I don't know why it can't be read?

ADD REPLY

Login before adding your answer.

Traffic: 1796 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