hi,
I used Bwa tool for mapping to get .sam file in output.Now I used samtools view to convert this .sam file into .bam file but it is not running.It gets exit within a second. Can anyone suugest why this is happening?
I added markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
Agreed. As I told you already, your SAM file is corrputed because STDERR messages are in it. Start over with the alignment and use any of the suggested solutions, or simply your script without nohup.
I moved your answer to the comment section as it would not help given the error message of OP, indicating that stderr and stdout are mixed in the same file.
I recommend against nohup as it mixes stdout and stderr which can be problematic, corrupting the output. If you want to capture stderr in a file, better wrap your code into a function like
and then run it like Alignment In.fq 2> stderr.log
Wrapping in a function is useful because as soon as your code gets longer you can simply catch all stderr in a file with a single 2> and do not run into trouble with mixing stderr/stdout. Also consider using GNU screen.
what is the output of
?
I added markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
Do you use
nohup
?Stderr
andstdout
seem to be mixed. I would always dobwa mem (options) in.fq | samtools view -o out.bam
yes I always use nohup
Likely not the source of your problem, but please use the new samtools syntax (with a recent version of samtools):
samtools view newoutputERX676467.sam -o newoutputERX676467.bam
Samtools recognizes file extensions.
i tried with this also,but still it is not working.
The problem is that you aligned with nohup. Don't do that. You'll have to repeat your alignment.
Agreed. As I told you already, your SAM file is corrputed because STDERR messages are in it. Start over with the alignment and use any of the suggested solutions, or simply your script without
nohup
.You are just missing to include the header in your samtools view command:
(It's the old samtools syntax, you may want to update it as Wouter suggested)
I moved your answer to the comment section as it would not help given the error message of OP, indicating that
stderr
andstdout
are mixed in the same file.