Question: BWA aligning help
0
gravatar for lcc1844
4.1 years ago by
lcc184430
United Kingdom
lcc184430 wrote:

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: 

  1. [M::main_mem] read 66226 sequences (10000126 bp)...
  2. [M::main_mem] read 66226 sequences (10000126 bp)...
  3. [M::main_mem] read 66226 sequences (10000126 bp)...
  4. [M::main_mem] read 66226 sequences (10000126 bp)...
  5. [M::main_mem] read 32148 sequences (4854348 bp)...
  6. [main] Version: 0.7.5a-r405
  7. [main] CMD: bwa mem hg19.fa read.fq
  8. [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 • 1.6k views
ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by lcc184430

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 REPLYlink written 4.1 years ago by iraun3.5k

Please give us the output of:

whoami && groups && ls -l aln.sam
ADD REPLYlink written 4.1 years ago by RamRS20k
1
gravatar for Pierre Lindenbaum
4.1 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum117k wrote:

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 COMMENTlink written 4.1 years ago by Pierre Lindenbaum117k

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 REPLYlink written 4.1 years ago by lcc184430
0
gravatar for lcc1844
4.1 years ago by
lcc184430
United Kingdom
lcc184430 wrote:

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 COMMENTlink written 4.1 years ago by lcc184430

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 REPLYlink written 4.1 years ago by iraun3.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2329 users visited in the last hour