Entering edit mode
5.4 years ago
Ric
▴
430
I got 0 plus and minus reads by aligning single reads against a gene in the following way:
> bwa index ref.fasta
> bwa mem ref.fasta sample5-21.fq | gzip -3 > sample5-21.sam.gz
> splitsam.sh sample5-21.sam.gz forward.sam.gz reverse.sam.gz
Total reads: 1792444
Plus reads: 0
Minus reads: 0
Unmapped reads: 1792444
Time: 1.166 seconds.
What did I miss?
Hello Ric ,
it is unusual to
gzip
sam
files. Instead you should convert it to sortedbam
files usingsamtools sort -o output.bam input.sam
.But as
splitsam.sh
doesn't complain about the format, this is not your problem here.Please convert to sorted bam and post the output of:
fin swimmer
Did you check the results of bwa mem? According to splitsam.sh, there aren't maped reads in your sam file. Try:
and:
Indeed it is really strange to use gzipped sam files, but this is allowed by splitsam.sh (part of BBTools) - and apparently, splitsam.sh doesn't take bam as input. But I wouldn't gzip sam files, as very few tools will accept gzipped sam.
edit: take note you are also using splitsam.sh incorrectly, as it expects at least four arguments:
The reference is 5044 bp long and the reads are 21 bp long. Should I use a different aliger and if yes then which one?
Yes, bwa mem is intended to reads 70 base pairs or longer, you should use another aligner. I would recommend Bowtie (preferred) or Bowtie2 (you may have to tweak the settings).
Could you please report back if this improves alignment? Thanks.
I tried bowtie2 but I ran into this problem bowtie2 can't find index