This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BWA alignment/Samtools; Fail to read the header

Hello,

I have an issue with my alignment.

This is an error in my log file: fail to read the header from "-".

Here is my script:

bwa mem -t 8 -R "@RG\tID:$2\tSM:$3" ~/scratch/pt6/pt6.fa  ${1}_1.fastq.gz  ${1}_2.fastq.gz 2>log.bwa_new.$1 |samtools view -S -h -b - >$1.unsorted1.bam 2>>log.bwa_new.$1

Samtools version: 1.10; Bwa version: 0.7.17-r1188

I would very glad if you could help me!

Thank you!

bwa samtools

what is the output of

bwa mem -t 8 -R "@RG\tID:$2\tSM:$3" ~/scratch/pt6/pt6.fa  ${1}_1.fastq.gz  ${1}_2.fastq.gz 2>log.bwa_new.$1 | head

and

echo bwa mem -t 8 -R "@RG\tID:$2\tSM:$3" ~/scratch/pt6/pt6.fa  ${1}_1.fastq.gz  ${1}_2.fastq.gz  log.bwa_new.$1

Dear Pierre,

Here is the answer to your questions (Iguess it works):

altai5@SQ       SN:NC_036879.1  LN:224244399
@SQ     SN:NC_036880.1  LN:108022953
@SQ     SN:NC_036881.1  LN:128755405
@SQ     SN:NC_036882.1  LN:196562556
@SQ     SN:NC_036883.1  LN:189151597
@SQ     SN:NC_036884.1  LN:159319378
@SQ     SN:NW_019932883.1       LN:4118956
@SQ     SN:NW_019932884.1       LN:7484060
@SQ     SN:NW_019932885.1       LN:5402389
@SQ     SN:NC_036885.1  LN:168369391


bwa mem -t 8 -R @RG\tID:HN\tSM:AL5 /home/qboy/scratch/pt6/pt6.fa altai5_1.fastq.gz altai5_2.fastq.gz log.bwa_new.altai5

It is the name of the fastq.gz file. It is not part of the file. My apologies. it just pops up when I run the bash script in prompt.

This is my command to run the script:

for f in `ls *i5_1.fastq.gz |cut -d"_" -f1`; do echo -ne "$f"; bash script_name $f HN AL5; done

I changed " to ' and it worked -_-

Thank you so much!

0 answers

No answers yet.

Log in to answer this question.