I am trying to generate BAM files, however there is some error with reference indexing.
[samfaipath] build FASTA index...
[E::fai_build_core] Format error, unexpected "N" at line 1
[samfaipath] fail to build FASTA index.
./samtools_miseq.sh: line 19: 117505 Segmentation fault ./samtools view -bT $reference $file > $bamfile
here is my code
samtools faidx refseq.fasta
reference=refseq.fasta.fai
cd $INPATH
for file in $INPATH/*.sam ;
do
bname=$(basename $file ".sam")
echo $bname
bamfile=$INPATH1/$bname".bam"
namesort=$INPATH1/$bname"_namesort.bam"
fixmate=$INPATH1/$bname"_fixmate.bam"
positionsort=$INPATH1/$bname"_positionsort.bam"
markdup=$INPATH1/$bname"_markdup.bam"
cd /dir/samtools-1.10
./samtools view -bT $reference $file > $bamfile
./samtools sort -o $bamfile $file
# Add ms and MC tags for markdup to use later
./samtools fixmate -m $namesort $fixmate
# Markdup needs position order
./samtools sort -o $positionsort $fixmate
# Finally mark duplicates
./samtools markdup $positionsort $markdup
done
[samfaipath] build FASTA index...
[E::fai_build_core] Format error, unexpected "N" at line 1
[samfaipath] fail to build FASTA index.
./samtools_miseq.sh: line 19: 117505 Segmentation fault ./samtools view -bT $reference $file > $bamfile
here is my code
samtools faidx refseq.fasta
reference=refseq.fasta.fai
cd $INPATH
for file in $INPATH/*.sam ;
do
bname=$(basename $file ".sam")
echo $bname
bamfile=$INPATH1/$bname".bam"
namesort=$INPATH1/$bname"_namesort.bam"
fixmate=$INPATH1/$bname"_fixmate.bam"
positionsort=$INPATH1/$bname"_positionsort.bam"
markdup=$INPATH1/$bname"_markdup.bam"
cd /dir/samtools-1.10
./samtools view -bT $reference $file > $bamfile
./samtools sort -o $bamfile $file
# Add ms and MC tags for markdup to use later
./samtools fixmate -m $namesort $fixmate
# Markdup needs position order
./samtools sort -o $positionsort $fixmate
# Finally mark duplicates
./samtools markdup $positionsort $markdup
done
Comment